[BTS] Silence soundtrack but keep leader themes

livinginaz

Seven Ages of Man
Joined
Jan 27, 2020
Messages
137
Location
Land of the Yinzers, PA
As much as I do like the Civ IV soundtrack I don't wish to have the game make me sick of works I love, so I'd just like to turn it off instead of fussing with custom music for the same reason. However, the leader themes are unique, and not heard constantly so I'd like to keep them as part of the game's flavor. What's the best way to go about this? Can I just delete the music files outright or will this cause the game to crash/error out? Otherwise, I wonder if trying to replace them with silent mp3s of a short duration would work or cause lag when changing between the silent files. I know the names are specified in XML files.

I did try to tick the custom soundtrack option, which does silence the regular soundtrack, but after a minute or two of silence it just starts a new track from the game soundtrack.
 
If I just rename the three Soundtrack folders (base game and expansions) and launch a new game, I get some error messages:
Spoiler :

Civ4ScreenShot0000.JPG

My guess is that these will occur whenever a new era is entered. To avoid that, or if you'd rather not change the original folders, the clean way to remove the era music should be to replace the <EraInfoSoundtracks> lists in Civ4EraInfos.xml (XML\GameInfo in the assets folder of the BtS expansion) with empty lists: <EraInfoSoundtracks/>
A modified copy of that file can be moved into whichever mod you use (if the mod already contains Civ4EraInfos.xml, then that version would have to be modified) or, if you use no mod, it could be placed under My Games\Byeond the Sword\CustomAssets or inside a mod of its own.
 
If I just rename the three Soundtrack folders (base game and expansions) and launch a new game, I get some error messages:
Spoiler :


My guess is that these will occur whenever a new era is entered. To avoid that, or if you'd rather not change the original folders, the clean way to remove the era music should be to replace the <EraInfoSoundtracks> lists in Civ4EraInfos.xml (XML\GameInfo in the assets folder of the BtS expansion) with empty lists: <EraInfoSoundtracks/>
A modified copy of that file can be moved into whichever mod you use (if the mod already contains Civ4EraInfos.xml, then that version would have to be modified) or, if you use no mod, it could be placed under My Games\Byeond the Sword\CustomAssets or inside a mod of its own.
Thank you for the information, putting a modified era infos XML did the trick. What I did was outright delete the argument of <EraInfoSoundtracks> instead of just making it blank, but it seems to work without issue. I even left the music for ancient era alone and it stops once the new era begins (at least by giving myself the techs in WB). My biggest concern with this was that if there are errors running continuously in the background it could cause lag, as I do run Civ IV on an older computer. I had already begun to experiment with the CustomAssets folder, by just adding in files and renaming them to the music in the real assets folder. I'd forgotten which XML files controlled the music names.
 
What I did was outright delete the argument of <EraInfoSoundtracks> instead of just making it blank, but it seems to work without issue.
Great, so one can also easily comment out the soundtracks elements:
Spoiler :
<EraInfoSoundtracks>
<!--EraInfoSoundtrack>AS2D_ANFORTAS_WOUND</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHAIRMAN_DANCES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHCONNE</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHRISTIAN_ZEAL</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_COMMON_TONES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_GRAND_PIANOLA_1</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_GRAND_PIANOLA_2</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_HARMONIELEHRE</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_HYMING_SLEWS</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_LOOPS_AND_VERSES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_MEISTER_ECKHARDT</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_SHAKING_AND_TREMBLING</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_THE_PEOPLE_ARE_HEROES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_TROMBA_LONTANA</EraInfoSoundtrack-->
</EraInfoSoundtracks>
I even left the music for ancient era alone and it stops once the new era begins (at least by giving myself the techs in WB).
Right, the Ancient ones are low-key and blend nicely with the ambient sounds. (Except for the one piece with vocals; can't abide that one anymore.)
 
Great, so one can also easily comment out the soundtracks elements:
Spoiler :
<EraInfoSoundtracks>
<!--EraInfoSoundtrack>AS2D_ANFORTAS_WOUND</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHAIRMAN_DANCES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHCONNE</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_CHRISTIAN_ZEAL</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_COMMON_TONES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_GRAND_PIANOLA_1</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_GRAND_PIANOLA_2</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_HARMONIELEHRE</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_HYMING_SLEWS</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_LOOPS_AND_VERSES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_MEISTER_ECKHARDT</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_SHAKING_AND_TREMBLING</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_THE_PEOPLE_ARE_HEROES</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_TROMBA_LONTANA</EraInfoSoundtrack-->
</EraInfoSoundtracks>
Right, the Ancient ones are low-key and blend nicely with the ambient sounds. (Except for the one piece with vocals; can't abide that one anymore.)
Yeah, the ancient soundtrack is quite nice to me so I left it alone. The vocal one is the most offensive for sure. I think much of Civ III’s soundtrack was also fairly good at sitting in the background like that. I had tried to experiment before with putting in III music in place of IV before your tip.

This leads into something else, I noticed there’s a line in the XML called <bFirstSoundtrackFirst>0</bFirstSoundtrackFirst> and I wonder if it’s possible to specify the track that plays first in a new era. I had thought about making AncientSoundtrack4 play when the game starts, and then play CivIIIModAsian when the modern era starts since the former track is a remix of the latter.
 
That indeed seems to be the effect of that XML tag. Here's what the (GameCore) DLL does with it:
Spoiler :
Code:
int CvGame::getNextSoundtrack(EraTypes eLastEra, int iLastSoundtrack) const
{
	EraTypes eCurEra = GET_PLAYER(getActivePlayer()).getCurrentEra();
	CvEraInfo& kCurrentEra = GC.getEraInfo(eCurEra);
	if (kCurrentEra.getNumSoundtracks() == 0)
	{
		return -1;
	}
	else if (kCurrentEra.getNumSoundtracks() == 1 || (eLastEra != eCurEra && kCurrentEra.isFirstSoundtrackFirst()))
	{
		return kCurrentEra.getSoundtracks(0);
	}
	else 
	{
		return kCurrentEra.getSoundtracks(GC.getASyncRand().get(kCurrentEra.getNumSoundtracks(), "Pick Song ASYNC"));
	}
}
Edit: from CvGameInterface.cpp
So, if no tracks were loaded from XML (empty list in Civ4EraInfosxml), -1 gets returned to the caller in the EXE. Presumably, the EXE will then simply not play any era music. If a new era has been entered and FirstSoundtrackFirst is set (or if there's only one track), then the first track gets returned (or rather: its numerical ID). Otherwise, a track is chosen uniformly at random. The iLastSoundtrack parameter is unused, i.e. it can happen that the same track plays twice in a row. (I also seem to recall experiencing that in the game.)
 
Last edited:
This leads into something else, I noticed there’s a line in the XML called <bFirstSoundtrackFirst>0</bFirstSoundtrackFirst> and I wonder if it’s possible to specify the track that plays first in a new era
IIRC it's not just the first to be played in a new era but also the first to be played after reloading a save.

BTW: If you want to experiment with music, you can also take a look at my MoreMusic modcomp. It was designed for AND2/CoM but you can easily modify it to an other mod. I'm very much into good, non-repetitive game music 😎🎼
 
IIRC it's not just the first to be played in a new era but also the first to be played after reloading a save.

BTW: If you want to experiment with music, you can also take a look at my MoreMusic modcomp. It was designed for AND2/CoM but you can easily modify it to an other mod. I'm very much into good, non-repetitive game music 😎🎼
I'll play with that a bit this evening, I am not sure if reloading a save is a hard-and-fast rule or not, but I do feel like when I load a save from the main menu it tends to play the same thing, not when I load a save while in a match already. I didn't pay attention to these things until I undertook this little endeavor.

I'll have to check out your mod, it seems like the changes it does to the XML could make it easier to play with new music than what I was doing. Interesting that it adds new menu music, I also replaced my own Baba Yetu with the original Civilization theme; since I play custom games I never hear it when the map generates.
 
Top Bottom