K-class wrote:Well be nice to see how this map goes with altered sounds. I always wondered about that mixing it up a bit. Some Jimmy Barns or Midnight Oil playing blue sky mining over a mine.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Yeah, I have custom tracks for two scenarios but I didn't want to post copyrighted music and have NAMBLA (or are they called RIAA? Easy to confuse them...) knocking on my door.
It's relatively easy to do -- but you have to be aware of how high your average city is on your map and adjust the amplitude for a city's specified track (or tracks, you can have a city use different tunes for different eras). It seems when you specify a song for a particular city, if you don't adjust this value it will often be too quiet yet if you don't specify any track they seem to auto adjust all by themselves (using the default music which randomizes for a city).
Here is how you give a city a custom track. (I've tested this with a number of mp3 files and it seems if they are not bit rate 64, mono, 44 or 22khz they don't play correctly, or more often they don't play at all, or even sometimes crash you to desktop). You'll need some sort of music editor (I use Adobe Encore, but there are far cheaper and/or free editors/converters out there you can use instead) to convert your songs to 64 bit rate, 44khz, mono.
All are located inside of
Documents and Settings\[name]\My Documents\My Games\Sid Meyer's Railroads!\Custom Assets\XML
Lets add one song to a random city in a scenario called AUSTRALIA2, and lets call the song mysong.MP3 (you can edit any scenario and simply change where it says AUSTRALIA2 to whatever your scenario name is.)
Copy mysong1.MP3 to the directory called Sounds this is located in
Documents and Settings\[name]\My Documents\My Games\Sid Meyer's Railroads!\Custom Assets\
Next, you have to edit three files:
Edit: _SCENARIOS_\AUSTRALIA2\RRT_Cities_Australia2.xml
(remember, for your own scanario just change the name)
_SCENARIOS_\[scenario-name]\RRT_Cities_scenario-name.xml
Add the following inside any <city> </city> statement to give that city "mysong1.mp3" as it's track
Code: Select all
<CitySongs>
<CitySong>
<szSongID>AS3D_AUSTRALIA2_MYSONG1</szSongID>
<SongEras>
<szSongEra>ERA_EARLY</szSongEra>
</SongEras>
</CitySong>
<CitySong>
<szSongID>AS3D_AUSTRALIA2_MYSONG1</szSongID>
<SongEras>
<szSongEra>ERA_LATE</szSongEra>
</SongEras>
</CitySong>
<CitySong>
<szSongID>AS3D_AUSTRALIA_2_MYSONG1</szSongID>
<SongEras>
<szSongEra>ERA_MID</szSongEra>
</SongEras>
</CitySong>
You can see in the above statements that you can give the city different soundtracks based on the era -- I'll explain this later if needed. It should be self-explainitory that you simply repeat the following two xml file edits and change the <SoundID> <ScriptID> and <Filename> to match your other MP3 file you put in the \Audio\ directory.
Edit: \Audio\AudioDefines.xml
Add this anywhere between the other SoundData statements or after the last one.
Code: Select all
<SoundData>
<SoundID>SONG_AUSTRALIA2_MYSONG1</SoundID>
<Filename>MYSONG1</Filename>
<LoadType>STREAMED</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>
I am guessing that the <bInGeneric>1</bInGeneric> if set to 0 (no) means you could have an alternate Audio location for the tracks but I haven't figured out where you'd add the location information.
Edit: \Audio\Audio3DScripts.xml
Stick the following in between two other Script3DSound statements, or after the last one.
Code: Select all
<Script3DSound>
<ScriptID>AS3D_AUSTRALIA2_MYSONG1</ScriptID>
<SoundID>SONG_AUSTRALIA2_MYSONG1</SoundID>
<SoundType>GAME_MUSIC</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>1</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>FRONT</StartPosition>
<EndPosition>FRONT</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>300</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>800</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>2000</iMinCutoffDistance>
<iMaxCutoffDistance>2000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.0</fMinWetLevel>
<fMaxWetLevel>0.0</fMaxWetLevel>
</Script3DSound>
If your scenario takes place on a map that is located higher than normal you will have to adjust the min/max distance statements -- trial and error here: it doesn't seem to be based on anything visual as far as I can tell...
And that takes care of adding a new track to a city.
When I've tried unchanged MP3 files (good quality stereo ones) they either don't play or I get garbled garbage or a CTD, so you'll want to conform to 64bit/44khz/mono for your new tracks to avoid this issue. I'm guessing the reason this is so is because the game expects to reserve a channel for the train sounds and other ambient sounds.
Alternate method requiring no XML editing to replace your tracks in the game:
Inside your game installation directory, you'll find \Assets\Sounds\City_Music\[era name]
You can also simply replace these files with mp3 tracks of your own,
named exactly the same as the file you're replacing and they will play either randomly throughout the game, or as set in any scenario. You don't have much control by doing this though. Again, you will have to convert your mp3 tracks to 64bitrate/44khz/mono for them not to adversely effect the game.