Author Topic: Initial ambience format (amb) analysis  (Read 825 times)

0 Members and 1 Guest are viewing this topic.

Offline scient

Initial ambience format (amb) analysis
« on: May 22, 2019, 03:54:17 AM »
So I got easily distracted today from working on Veh code and started poking around ambience file format. I'd be curious if anyone else has done analysis on them. This is pretty rough break down that I'll likely improve once I spend more time on audio but I thought I would post it.

soundx.dll: sub_10003A30(char *)

SMACX (not full list of functions but I thought might be interesting as list of triggers, not all factions use all):
void __cdecl load_music(int factionID)
void __cdecl ambience_veh(int vehID)
int __cdecl ambience(int)
Ambience::load(char const *)
Ambience::unload(void)
FactionAmbience::begin(void)
FactionAmbience::tech(void)
FactionAmbience::terraform(void)
FactionAmbience::production(void)
FactionAmbience::general(void)
FactionAmbience::basewin_show(void)
FactionAmbience::basewin_hide(void)
FactionAmbience::design_window_show(void)
FactionAmbience::design_window_hide(void)
FactionAmbience::new_base(void)
FactionAmbience::popup1(void)
FactionAmbience::eot(void)
FactionAmbience::hostility(void)
FactionAmbience::energy_resources(void)
FactionAmbience::base_liberated(void)

prgm: [size: 36 + variable string lengths]
offset : [size]
 +0: [4] 'prgm' ; string header
 +4: [4] length ; excludes header and length
 +8: [4] unk1 ; audio property?
+12: [4] unk2 ; audio property?
+16: [4] unk3 ; audio property?
+20: [4] unk4 ; audio property?
+24: [4] unk5 ; audio property?
+28: [4] unk6 ; audio property?
+32: [4] unk7 ; audio property?
+36: [variable] ref1 (null terminated string) ; kmap reference or file path?
+??: [variable] ref2 (null terminated string) ; can be same as ref1; offset is ref1 length + 1; optional?

prgm count:
aset1.amb: 14 (SMACX factions)
bset1.amb: 12 (Believers)
gset1.amb: 13 (Gaians, Peacekeepers)
mset1.amb: 10 (Hive, Morgan)
pset1.amb: 1 (unused, incomplete Peacekeepers?)
sset1.amb: 7 (Spartans)
uset2.amb: 8 (University)
ustart.amb: 8 (Start Menu)

kmap: [size: 44 + variable string lengths]
offset : [size]
 +0: [4] 'kmap' ; string header
 +4: [4] length ; excludes header and length
 +8: [4] unk1 ; audio property?
+12: [4] unk2 ; audio property?
+16: [4] unk3 ; audio property?
+20: [variable] ref1 (null terminated string) ; reference used by prgm?
+??: [4] unk4 ; audio property?
+??: [4] unk5 ; audio property?
+??: [4] unk6 ; audio property?
+??: [4] unk7 ; audio property?
+??: [4] unk8 ; audio property?
+??: [variable] ref2 (null terminated string) ; looks to be file path
+??: [4] unk9 ; looks like it could be some kind of length or offset

kmap count:
aset1.amb: 12 (SMACX factions)
bset1.amb: 12 (Believers)
gset1.amb: 13 (Gaians, Peacekeepers)
mset1.amb: 10 (Hive, Morgan)
pset1.amb: 1 (unused, incomplete Peacekeepers?)
sset1.amb: 13 (Spartans)
uset2.amb: 8 (University)
ustart.amb: 8 (Start Menu)

trak: [length: 20]
offset : [size]
 +0: [4] 'trak' ; string header
 +4: [4] length ; excludes header and length
 +8: [4] unk1 (signed); index?
+12: [4] unk2 (signed); index?
+16: [4] unk3 (signed); index?

trak count:
aset1.amb: 12 (SMACX factions)
bset1.amb: 6 (Believers)
gset1.amb: 27 (Gaians, Peacekeepers)
mset1.amb: 18 (Hive, Morgan)
pset1.amb: 0 (unused, incomplete Peacekeepers?)
sset1.amb: 5 (Spartans)
uset2.amb: 6 (University)
ustart.amb: 16 (Start Menu)

glbl: [size: 8 + variable length]
offset : [size]
 +0: [4] 'glbl' ; string header
 +4: [4] length ; excludes header and length
+??: looks like a large number of index values

glbl count:
aset1.amb: 1 (SMACX factions)
bset1.amb: 1 (Believers)
gset1.amb: 1 (Gaians, Peacekeepers)
mset1.amb: 1 (Hive, Morgan)
pset1.amb: 1 (unused, incomplete Peacekeepers?)
sset1.amb: 1 (Spartans)
uset2.amb: 1 (University)
ustart.amb: 1 (Start Menu)

chnl: header referenced in soundx.dll function but unused in amb files; assume this is related to setting some kind of channel data

MThd: start of midi part of file
See: http://somascape.org/midi/tech/mfile.html

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

You ivory tower intellectuals must not lose touch with the world of industrial growth and hard currency. It is all very well and good to pursue these high-minded scientific theories, but research grants are expensive. You must justify your existence by providing not only knowledge but concrete and profitable applications as well.
~CEO Nwabudike Morgan 'The Ethics of Greed'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 36.

[Show Queries]