Modifying the Main Menu music

Tutorial for Command & Conquer 3 C&C3

Avatar of Nighthawk

Nighthawk

Category: Code
Level: Beginner
Created: Sunday October 14, 2007 - 14:04
Updated: Saturday May 5, 2012 - 18:12
Views: 5959
Summary: Shows you, in greater detail than the SDK, how to change the main menu music.
Rating
  • Staff4.0
  • Members-
  • Average4.0/5.0

1 vote

Tools Needed: An XML Editor (Notepad works just fine), an audio converter (if your music is not in MP3 format already).

This is the first in a series of tutorials that will show you how to modify the music in C&C3.

This tutorial will show you how to modify the music played on the main menu. Later, we will look at changing the skirmish screen , credits and loadscreen music; and adding new tracks that will be played ingame.

The SDK does give you a rather basic tutorial on modifying music, and it does provide you with the basics you need, but for some people that may not be enough.

Anyway, on with the tutorial. Music in C&C3 is composed of MP3 files. If you've merely existed for the past few years, you'll know what that is. MPEG-1 Audio Layer 3 is now one of the core standards of sound, and the music industry in particular, yielding high quality sound with low disk space costs.

It should be noted that, although I recommend, and am going to base this tutorial on, the MP3 format, you can also use WAV files for your music. I wouldn't recommend this however, as WAV files take up large amounts of disk space compared to MP3s. Conversion to MP3 is quite simple, especially if you have Windows XP Media Centre Edition, it comes with a built in converter (it's what I used to convert the music file I used here to MP3 format from WAV). If you don't have MCE, there are a number of free converters available on the Internet, just use Google.

In C&C3, there are several key factors which you must adhere to when choosing your MP3s:
  • They must be mono or stereo, no surround sound here.
  • There will be a small gap if it is a looping track, so make sure that your MP3 file starts and ends with silence.
  • They take 1% of the CPU to play, so several at once may cause trouble with lower-spec computers.
  • There is a hardcoded limit of 13 MP3 files playing at once.
  • They should only be used for large files that actually need the format, such as mission speech, music or ambient streams.


By now you should have chosen your MP3 file, or you can use the one I've provided at the bottom. With that out of the way, let's move on to the tutorial itself - changing the main menu music.

Changing the Main Menu music:

Firstly, we need to create a new XML file to contain our sound edits. In this example, we will create a file called 'NewSound.xml' within the 'data' directory of your mod's file structure. It must be included in mod.xml and mod_l.xml like any other mod file, and contain the same headers as any other mod file. That is not covered in this tutorial, it's common sense.

If you don't want to create a file from scratch, you can copy the 'SoundMod.xml' file from the SampleMod. I would recommend this, it saves a lot of hassle.

Now, you need to create an <AudioFileMP3Passthrough /> entry for your new main menu music. If you've copied SoundMod.xml, change the existing entry.
Here is an example, taken from the SampleMod's SoundMod.xml file:
              
Code
<AudioFileMP3Passthrough id="MOHMainScreen" File="AUDIO:MedalofHonor.mp3" />
        <MP3MusicTrack id="ShellLowLODMP3" inheritFrom="MP3MusicTrack:BaseMP3MusicTrack" Volume="60">        
            <VolumeSliderMultiplier Slider="NONE" Multiplier="1.0" />
            <Filename>MOHMainScreen</Filename>            
        </MP3MusicTrack>


The 'id' is a unique identifier for your track. Both id fields shown above need to be unique. The 'File' denotes the path of your music track, relative to the MOD SDK directory. In this case, AUDIO:MedalofHonor.mp3 denotes 'MOD SDK\Audio\MedalofHonor.mp3'. Your audio files DO NOT go within your mod's own directory structure.

Volume, as you might guess, controls the volume that your track will be played at. Don't make it too loud, or too quiet. The SampleMod has this set to 60, I would keep it at that. Ignore the inheritFrom and <VolumeSliderMultiplier /> entries, they don't need to be edited.

The <Filename> field denotes what track will be played. This file does not actually exist, but is instead a fake that stops the track from being drowned out by the main menu movie. I'd advise that you change the name, but don't remove it.

You should now have a finished Main Menu music entry. My example is below:
              
Code
<AudioFileMP3Passthrough id="MODMainScreen" File="AUDIO:TDMenu.mp3" />        
        <MP3MusicTrack id="ShellLowLODMP3" inheritFrom="MP3MusicTrack:BaseMP3MusicTrack" Volume="60">        
            <VolumeSliderMultiplier Slider="NONE" Multiplier="1.0" />
            <Filename>MODMainScreen</Filename>            
        </MP3MusicTrack>


The music file I am using is Tiberian Dawn's menu and map selection theme, converted to MP3 format (downloadable here).

Next, head to the SampleMod's SoundMod.xml and copy the BaseMP3MusicTrack section into your XML. If you can't find this file, or just can't be bothered to go hunting for it, here's the section you need:
              
Code
        <MP3MusicTrack id="BaseMP3MusicTrack"
            Volume="55.0"
            ReverbEffectLevel = "0"
            DryLevel = "100"
            SubmixSlider = "MUSIC"
            Control = "ALLOW_KILL_MID_FILE"
            Priority = "CRITICAL" >
        </MP3MusicTrack>


Without this section, you'll get probems with your music.

Save your XML file. I shouldn't have to tell you this, you should save often incase of crashes and whatnot.

Now, go to MiscAudio.xml, within the CnC3XML\Sounds folder. Copy the entire MiscAudio block out of it and into your XML file, remembering to change the id tag. Both these points are a must, you can't just copy the lines you'll change, the game needs to read the entire block, and it needs to be unique, so a new id is needed.
Go to the 'LowLODShellMusic' entry and change the parameter to the id of the <MP3MusicTrack /> entry from the section we created earlier, not the AudioFileMP3Passthrough id. Do the same with HighLODShellMusic, with the same track (even though it is called ShellLowLODMP3 in my example, the name is not important, as long as it's unique).

Now save your XML, and ensure that it is included in your mod.xml and mod_l.xml files. Now build your mod. I would recommend that you use the New Buildmod.bat, created by CodeCat, and downloadable from http://forum.cncreneclips.com/index.php?showtopic=17506.

Congratulations, you've now changed the main menu music. One tiny, tiny step on the ladder to modding greatness!

In the next tutorial, we will look at changing the music on the skirmish menu, credits screen, score screen, and loading screen.

Links / Downloads

 HitsAdded
CodeCat's BuildMod.bat1216October 14, 2007 - 14:14
Tiberian Dawn Menu Theme (mp3 format)1180October 14, 2007 - 14:14

Credits

Frank KlepackiMusic
CodeCatNew Buildmod.bat

Return to top