• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

AMB Sound Editor

Flintlock

Emperor
Joined
Sep 25, 2004
Messages
1,193
Behold what I've been working on for the past couple of months:

infantryattack.PNG


It's an editor for those special sound files with extension .amb that Civ 3 uses. (I don't know if I'll ever figure out what AMB stands for.) AMB files are pretty complex internally and needlessly so. When they're boiled down, all they do is play WAV files at certain times with two optional random effects applied.

Here's an example of using the editor to fix one of the broken AMBs included in Civ 3. The file in question is GalleyAttack.amb. You know how when galleys are in combat, all you hear from them is the sound of water splashing? The developers intended for there to be a peal of ballistas as well. The WAV files for that are in the Galley's art folder, named GalleyAttackArrow.wav and GalleyAttackBow.wav. However they are not played because the AMB file is broken. First let's load it up:

galleyattack-broken.PNG


Only the water splash effect is shown in the table because the editor only creates rows for correctly specified WAV sounds. To see the internals of the AMB in more detail, select File -> View AMB Details:

galleyattack-details-broken.png


"Bowg" in Kmap #1 is immediately suspicious, that seems like a typo. The var names from the Prgm sections are supposed to match with var names from the Kmap sections. Notice that one Prgm has a var name of "Bow" which does not match "Bowg" and another has the name "Arrow" which does not match "Arrow1". To fix this, we use Edit -> Add Row to create two new rows and fill them in with the parameters for the bow and arrow WAV sounds:

galleyattack-fixed.PNG


The params for the random effects come from the Prgm sections, the WAV file names come from the Kmap sections, and the times & durations come from the Midi tracks (not shown in the screenshot above). That's it, this AMB file is now fixed and we can listen to it by pressing "Play Preview" and save it to hear it in-game. If we were to look at the details again, we'd see two new sets of sound track + Prgm + Kmap, one for each of the new rows. The old broken data is still there, and it doesn't cause any problems, but we can delete it by selecting Edit -> Prune.

By the way, there aren't that many other broken AMBs in the game files. I've detected only four or five from among the 251 total AMB files. GalleyAttack.amb is the most seriously broken because you clearly hear that something is missing when it's played in-game. For the other broken files, either the missing sounds are subtle, or the needed WAV files were never included with the game, so fixing them is pointless or not possible. Fixing such files isn't the purpose of the editor, anyway, it's just as an example.

The AMB Editor is included with C3X starting in version 23. I considered making it a separate thing but it's small enough that I didn't bother. It adds only about 30 kB to the compressed size of the mod. The editor is a C script like the rest of C3X. That means it compiles itself when it's run like scripting languages such as Python typically do. Those .c files in the AMB Editor folder are the editor's source code, which I encourage you to have a look at if you're interested.

Download it here: https://github.com/maxpetul/C3X/releases/tag/Release_23_Preview_2
 
Last edited:
:thumbsup: Thank you for doing some forensic on the mysterious .amb files. Were they maybe used in an attempt to save disk space? Back in the days, no-one had heard of harddrives with hundreds of GB, and RAM was still an expensive luxury...
 
Flintlock... Thank You for the AMB Editor and explanations :thumbsup:

"Files containing the AMB extension are known as AIMMS Model Files as they refer to the models that the AIMMS (Advanced Integrated Multidimensional Modeling Software) created. The AMB file extension was developed by Paragon Decision Technology and the files with this extension are categorized as data files".
 
Were they maybe used in an attempt to save disk space?
I doubt it, I think the point was the randomized effects. AMBs might not even save disk space overall, it depends on how much their component WAV sounds overlap. Civ 3's WAV files are uncompressed, I'm pretty sure, so their sizes would be proportional to their lengths. If an AMB is made up of many WAV files that are overlapped as they play and without periods of silence in between, it would take less space overall to merge all the WAVs into one file.

"Files containing the AMB extension are known as AIMMS Model Files as they refer to the models that the AIMMS (Advanced Integrated Multidimensional Modeling Software) created. The AMB file extension was developed by Paragon Decision Technology and the files with this extension are categorized as data files".
"Advanced Integrated Multidimensional Modeling Software", wow. Civ 3's AMBs are overly complicated but they're not that complicated. This must be another kind of file with the same .amb extension.
 
"Advanced Integrated Multidimensional Modeling Software", wow. Civ 3's AMBs are overly complicated but they're not that complicated. This must be another kind of file with the same .amb extension.
That's a possibility... I have never found anything else explaining them through the years.
 
Back
Top Bottom