How to I add more music to the soundtrack?

MantaRevan

Emperor
Joined
Oct 9, 2011
Messages
1,541
There was a nice soundtrack editor utility for the vanilla version of Civ4, but it doesn't seem to work anymore. I've picked out music I'd like for the duller modern era, but I'm not sure how to get it to play naturally in game. :(

Do you guys know how to go about doing that?
 
You'll need an entry in Audio2DScripts.xml and AudioDefines.xml. The SoundID's of both should be the same, of course.

In Audio2DScripts.xml, you can control the volume of your song.

In AudioDefines.xml, you point to the filepath of the sound, without extensions; <Filename>Sounds/Soundtrack/MedHopingForRealBetterness</Filename> points to the file MedHopingForRealBetterness.mp3, but the .mp3 isn't mentioned.

Then, you'll need to go to CIV4EraInfos.xml, and add your song to the relevant era, using the AS2D-header that you also used in Audio2DScripts.xml.

It's pretty obvious, so long as you know in which .xml files to look. :)
 
You'll need an entry in Audio2DScripts.xml and AudioDefines.xml. The SoundID's of both should be the same, of course.

In Audio2DScripts.xml, you can control the volume of your song.

In AudioDefines.xml, you point to the filepath of the sound, without extensions; <Filename>Sounds/Soundtrack/MedHopingForRealBetterness</Filename> points to the file MedHopingForRealBetterness.mp3, but the .mp3 isn't mentioned.

Then, you'll need to go to CIV4EraInfos.xml, and add your song to the relevant era, using the AS2D-header that you also used in Audio2DScripts.xml.

It's pretty obvious, so long as you know in which .xml files to look. :)

I've never edited XML before, but I backed up my copy of BtS before doing anything.

There are a number of AudioDefines.xml files, and I suppose its safe to assume that BtS, Warlords, and Vanilla all have their own version of this file? I don't want to make edits to the wrong one.

I also use BAT mod 4.1, will any changes I make be incompatible with or not load for the mod? Thanks for your help.
 
XML files are usually (let's not talk about CIV4PlotLSystem.xml :p) very easy to understand and edit - and if not, there is always this forum and at least two Wiki-sites. :)

If you play Beyond the Sword, you will want the files in:

...\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Assets\XML\Audio

Mind, this could be slightly different for you, as I use the Steam version. But you can see where you need to go; not Warlords, for example, but Beyond the Sword.

I am unsure how BAT exactly works - is it a mod that can be loaded and unloaded? - but it shouldn't matter. Normally, with mods, you would need to go to:

...\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\TheNameOfYourMod\Assets\XML\Audio

But that only applies if your mod changes the files you're interested in. And I'm 99% sure BAT doesn't change the audio files - but you could check to be sure!

But yes, that is how the game works; it checks Civilization IV's files, it then checks Warlords' files, it then checks Beyond the Sword's files, and then it finally checks the files of the mod you have loaded. So yes, there are files in the Civilization IV or Warlords Assets directory that Beyond the Sword hasn't changed, and thus, that aren't in the Beyond the Sword Assets directory.
 
So if I edit the BtS XML, the changes I make should still take effect without having to make changes to the XML for BAT 4.1?

One thing I've noticed is that the classical era music doesn't seem to be logged like the rest of the music. The ancient era soundtrack is defined as classical, and then the game immediately jumps to the medieval era. For example, here's the first section of the code that displays what I know as the game's standard soundtrack:

Spoiler :
<SoundData>
<SoundID>SONG_ANCIENT_SOUNDTRACK_1</SoundID>
<Filename>Sounds/Soundtrack/Classical/AncientSoundtrack1</Filename>
<LoadType>STREAMED</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>


AncientSoundtrack1 is logged as classical, despite not being. How would I add music to the classical era?

When adding entries for new songs, should I include them next to other songs from that era? Does it matter where I add this in AudioDefines.XML?
 
Provided that the BAT folder, found in the Mods folder, doesn't contain any of the three relevant .xml files, yes.

I'm unsure what you're saying here.

The ancient era has four music pieces: http://i.imgur.com/uCscQtE.png

Whereas the classical era has nineteen (?) music pieces: http://i.imgur.com/0clYR2A.png

You add songs simply by adding them to such a list - to the nineteen classical songs, in your case. The order doesn't matter, no.
 
You'll have to forgive my lack of experience here, but are those imgur shots taken from Civ4EraInfos.XML or DefinesAudio.XML, and in what program(it would be easier for me to locate line 69 of the code if I wasn't relegated to using notepad)? It seems formatted like Civ4EraInfos.XML, but my version of both of those files seems to skip over the stuff you have in your 2nd screenshot?

Thanks for your patience :)
 
Not to worry! They come from CIV4EraInfos.xml, viewed with Notepad++ (this I would definitely advise you to get; it's free, Google it!).

That is curious... What is the path of your file? Are you sure you are using the Beyond the Sword one?
 
MantaRevan:

In addition to need my speed's excellent advice, I put a little something in the BAT Mod forum for you. :)
 
Not to worry! They come from CIV4EraInfos.xml, viewed with Notepad++ (this I would definitely advise you to get; it's free, Google it!).

That is curious... What is the path of your file? Are you sure you are using the Beyond the Sword one?

I believe so. The path is C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Assets\XML\GameInfo
and here is what I get:

http://imgur.com/a/mgTRe

http://imgur.com/a/C9Hc9

http://imgur.com/a/jD3KQ

Note the jump from the 4 ancient STs to the middle ages, unlike the screengrabs you posted.
 
In semi-nullification of my previous post, I checked the version of Civ4EraInfos.XML contained in the BAT 4.1 mod folder(as lemonmerchant so helpfully suggested) and found that it properly contains the classical and ancient eras sorted separately. For all intents and purposes this solves my problem, though it does pose a question as to why the Vanilla BtS version is different than it probably should be.
 
Ah, that is because you are looking at the Civilization IV files, and not the Beyond the Sword files, as I suspected.

In \steamappas\common, you will find at least these three games, probably:

Sid Meier's Civilization IV
Sid Meier's Civilization IV Beyond the Sword
Sid Meier's Civilization IV Warlords

That is pretty obvious; you want to play Beyond the Sword, so you go to the middle one.

But remember how the game checks for files? It first looks at Civilization IV's files, then those of Warlords, then the files of Beyond the Sword, and finally those of mods.

The above Beyond the Sword folder is, to Steam, as different from the Warlords folder as it would be from the Team Fortress 2 folder. Steam isn't telling Beyond the Sword to look at the files of a whole different game.

Instead, these files are included inside the Beyond the Sword folder. So in the folder:

...\steamapps\common\Sid Meier's Civilization IV Beyond the Sword

You can see the folders 'Warlords' and 'Beyond the Sword':

http://i.imgur.com/OzsjiEg.png

Which indicates that the Assets folder shown above is that of basic Civilization IV. Whereas the Assets folder in ...steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword is the Assets folder of Beyond the Sword.

Is that understandable? :p

But I'm glad it was solved! :)
 
So I'll need to place an actual audio file in the game's folders for the XML to refer back to, though I'm going to double-check here before attempting anything given previous confusion. All the actual audio files for the soundtrack I can find are in
C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Assets\Sounds\Soundtrack

despite the fact that I'm pretty sure that this is the 'vanilla' file location. Is this the correct place to put the MP3s, and if not, where? (There's no 'ancient' folder here, just classical and above, which indicates that it's probably vanilla)
 
You can put them anywhere you wish, as you'll be pointing to the file path in AudioDefines.xml: http://i.imgur.com/6lCMsNq.png

Beyond the Sword's limited soundtrack can be found here:

...\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Assets\Sounds\Soundtrack
 
I certainly feel like progress is being made here!

Is this correct?

http://imgur.com/a/Jvly9

http://imgur.com/a/ekYGY

Lastly, I suppose I need to make an entry in Audio2DScripts.XML. I've looked in the BAT 4.1 files and the mod doesn't appear to have its own version of this file, unlike the other two. Is this the correct filepath?

C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Assets\XML\Audio ?
 
Yes. Your Audio2DScripts.xml entry will, based on these two pictures, need to have AS2D_Armenia (seen in your CIV4EraInfos.xml) as its ScriptID, and ARMENIA (seen in your AudioDefines.xml) as its SoundID.

And yes, you would find the file there. :)
 
Yes. Your Audio2DScripts.xml entry will, based on these two pictures, need to have AS2D_Armenia (seen in your CIV4EraInfos.xml) as its ScriptID, and ARMENIA (seen in your AudioDefines.xml) as its SoundID.

And yes, you would find the file there. :)

You've been a huge help :D. Is there a reason for the ScriptID lowercase format? All the other script IDs are all uppercase. I finished everything for Armenia as a test case and ran a past save from the classical era to try and see if I could get it to play. Kept reloading the game for about 45 mins and it never did. Now, induction fallacy means that technically I could have just been unlucky, but I'm pretty sure I heard every other song at least once, most twice. Could it have to do with the fact that I turned down the min and max volumes(the track is a little too loud in my opinion)?

My Audio2DScripts.xml file:
http://imgur.com/a/sm2Aq
 
Well, you wrote it in lowercase. :p

Mhm, what if you disable all classical era songs except for your new one, to test it? You can comment out things by using <!-- and -->, for example:

http://i.imgur.com/8yMRkx0.png

Now, AS2D_MEDIEVAL_VIKING won't be read or seen, and so, this song will never play in this era.

I wouldn't know why it (presumably) doesn't work...

You could move your song (Armenia.mp3) into Beyond the Sword's soundtrack folder. You put it in:

...\Sid Meier's Civilization IV Beyond the Sword\Assets\Sounds\Soundtrack

But Beyond the Sword's soundtrack folder is:

...\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Assets\Sounds\Soundtrack

If your sound file a .mp3 file, actually? I'm unsure to what extent that matters, but there may be some rules concerning the bit rate or who knows what.

I would also advice you to adhere to the format that the game uses: SoundID would be SONG_ARMENIA and ScriptID would be AS2D_ARMENIA (and so these would also change in CIV4EraInfos.xml and AudioDefines.xml).

Changing the volume is something I often do, and it shouldn't matter.
 
They are MP3 files, and I tried everything on your list to no avail. Unfortunately I can't seem to get this to work. Disappointing, considering how easy this ought to be, but I'm not the best at this. I can always use the Custom Soundtrack folder instead, but let me know if you've got any other ideas.
 
Back
Top Bottom