Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 15 Feb, 2008 
 

Joined: 11 Apr, 2007
Posts: 141
Location: England
Offline
INTRO

Those of you that are interested in sound modding will know that SupCom/Forged Alliance uses the XACT sound engine, which has caused some problems as it is difficult to mod.

Having experimented with adding sounds I came across one problem in particular. The main limitation was that it was not possible to control the volume of a sound depending on how far away you are. This is fine for UI sounds which to not attenuate over distance but becomes a problem for sounds like unit weapons and explosions.

In this thread I will show you how to overcome this limitation and more, getting your sounds using the same effects that the stock sounds are using.

NOTE: This is NOT a tutorial on how to use XACT. If you're looking for a basic tutorial you should see:
http://msdn2.microsoft.com/en-us/library/bb172335.aspx

TOOLS

In order to add new sounds to the game properly you will need at least two things

- The DirectX SDK (October 2006 for SupCom, November 2007 for Forged Alliance)
- The original project files for SupCom or Forged Alliance

Download the October 2006 SDK here
Download the November 2007 SDK here

Download the original project files here - Read the "CAUTION" section carefully when using.
These files were very kindly provided by o, big thanks to him for making this possible!

These project files are the XACT projects that were used to build the banks that ship with the game.

The source audio files are NOT included so you cannot rebuild the original wave banks or get audio out of the game with these files. It should be noted that I have slightly modified these files for convenience, so that when compiled they no longer build a project header or cue list, and the build paths were changed back to the default folder.

In the zip you will find one project for SupCom and one for FA. Pick the one appropriate to your needs.

CAUTION - IMPORTANT

If you want to use the effects shown in these files with your sounds you MUST use one of these files as a base, and you should NOT change, add or remove anything under Variables, RPC presets, DSP presets or Categories.

The reason for this is that many things are referenced by internal IDs which are hidden from you. As they are, the internal IDs in the projects match up exactly with the game. Changes you make to anything that goes into the global settings file will not carry over to the game. If you begin to modify these things you could accidentally change its internal ID without knowing. If you do this, presets and things that you attach to sounds will no longer match up to what is in the game any more.

Ideally you should never be modifying anything other than sound banks and wave banks.

For example:

- Say there's an RPC preset you want to use. The game uses an ID of 5 to reference it.
- In your project file it also has an ID of 5. However, you start to shuffle the presets around and remove one.
- Unknown to you, you have removed one with a lower ID than 5, and all the presets above that shift back an ID to fill the gap.
- The desired preset now has an ID of 4 in XACT, but it is still 5 in the game. It appears nothing is wrong and you compile your sound bank.
- Your sound bank is read by the game, it uses the preset at ID 4. A DIFFERENT preset to the one you wanted, which is at ID 5.

When this happens, bad, baaad things start happening as things are mismatched all over the place.

STARTING

You will find it useful to keep an extra copy of the original projects around as they are a fantastic reference for how things work, so the first thing you will want to do is make a copy of the file to work with, preferably placed in a folder by itself like how I have packaged them. (Subfolders will be created by XACT)

In your new copy you'll need to delete all the existing sound banks and wave banks.

Now create new wave banks and sound banks as you see fit for your sounds. After you are done you can begin tying your sounds to RPC presets.

RPC PRESETS

RPC presets are effects that you can apply to your sound, such as reducing volume over distance (attenuation).

You can attach RPC presets by opening your sound bank, right clicking on a sound (not a cue) and selecting "Attach/Detach RPC(s)" and you can also mass add/remove sounds by right clicking on an RPC preset in the tree and choosing "Attach/Detach Sound(s)". Drag and drop also works, whether it's RPC preset(s) to sound or sound(s) to RPC preset.

There are many presets and I cannot explain them all, you will have to explore them yourself. It is easiest to find similar sounds in the original file and see what effects are applied. Here are the presets typically used on common sounds.

For unit sounds (moving, engine noise, etc)

Angle_Attenuation
Attenuation
Duck

For weapon firing (not impact) sounds

Angle_Attenuation
Attenuation Weapons
Duck

For explosions and impact sounds

Angle_Attenuation
Attenuation Destroy
Duck

Unit select and most interface sounds do not use any effects.

CATEGORIES

You'll also notice there are categories for sounds. They mostly only adjust volume but the occasional category will also add a fade in/out or some other tweak. I like to assign categories to my sounds so they fit better with whatever is already in game.

You can assign a category by selecting a sound and looking in the properties panel and changing the Category item.

Here is a brief description of what goes in each category as I have worked out.

Default - Default

FMV - Sound that goes with videos

Interface - The sounds made when you press buttons and stuff.
....Unit Select - The sound made when you click on a unit.

Op_Briefing - Briefings from the campaign.

VO - Voiceovers, contains categories for the different languages.
....XX - Various language categories

World - Overall category for sounds made by game objects
....Units - Overall category for sounds made by units. (not weapons, not UI selection)
........UnitsXXX - Subcategories for units by faction and unit type
........ActiveLoopsXXX - Constant looping sounds (working sound made by mexes, gens, etc, not construction)
........Construction_Loops - Constant looping sounds for construction effects.
....Ambient - Stuff like trees burning
....Weapon - Weapon firing effects, not weapon impact effects.
....Destroy - All weapon impact effects and explosions.
....Rumble - For the rumbling sound you get when zoomed out.

FINISHING

Once you've finished customising your sounds, compile by pressing F7. After it is done, retrieve the .xsb and .xwb files from the build folder (typically the subfolder "Win" from where ever the project is saved) and copy them to the "sounds" folder in Supreme Commander. Do NOT copy over the SupCom.xgs file as you will overwrite the original global settings, and that is bad. From there you can reference them just like how any other sound is referenced. Add a reference from a blueprint or similar and go test!

FURTHER INFO

XACT on the MSDN - http://msdn2.microsoft.com/en-us/library/bb174772.aspx

I will be glad to answer any questions you might have after reading this.
Feedback and suggestions for improvement are most welcome!

Changes:
18th Feb 2008
- Rewrote "CAUTION" section to make it clearer.
- Added some scary red text next to the project files download link to make people read the CAUTION section.

15th Feb 2008
- Initial post

_________________
.


Last edited by Armoured Fish on 02 Jun, 2011, edited 3 times in total.

Top
 Profile  
 PostPosted: 15 Feb, 2008 
 
User avatar

Joined: 01 May, 2007
Posts: 4219
Offline
Someone better sticky this quick.... BTW awesome work mate!

_________________
Image
Blackhole http://www.youtube.com/watch?v=B3aDT0Ft_Yg
WOFhttp://www.youtube.com/watch?v=FVqMqz8PgEc
FOD http://www.youtube.com/watch?v=be9cu9UHv-U
TML http://www.youtube.com/watch?v=1Apk08LAtxc


Top
 Profile  
 PostPosted: 17 Feb, 2008 
 

Joined: 13 Jul, 2007
Posts: 41
Offline
Hi there...

Can u shed some light on how to properly fade-out the battle tracks when switching back to base building mode? I've tried several methods such as attaching the RPC preset (i tried this after seeing your sample) and using the interactive playlist mode (tried different transition modes) for the battle cue but i just couldn't get it to work... most of the time either the music refuses to switch or it just wont play (like when i tried using the RPC preset)

Thanks in advance!!


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 11 Apr, 2007
Posts: 141
Location: England
Offline
It is not necessary to use interactive mode, you just need to attach the MusicRelease RPC preset. I don't know what could be causing your issues, have you looked at the log viewer to see if any errors appear?

The way music fades out is controlled by the MusicRelease RPC, as well as the lua code in UserMusic.lua which decides if a fade out should occur. The fade out fields in XACT do not seem to have much relevance.

Reading UserMusic.lua the switch from peace to battle is instant with no fade. The switch from battle to peace does allow fading which is done by the MusicRelease RPC preset. Before I applied this preset to my music mod the battle music would always cut out harshly, where as now it fades out over several seconds.

Hope this helps.

_________________
.


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 13 Jul, 2007
Posts: 41
Offline
Okay i tried it again, redid the RPC preset, attaching the RPC preset "MusicRelease", and copied exactly all the settings i see in your project files Still no go... when i attach the RPC preset to the sound banks, it will simply refuse to play at all (even the main menu song!).

I've even tried building the sound files using the project files sample you posted and still the same issue... music won't play

As far as errors go, there seems to be no errors at all.. everything builds perfectly

Just incase if you're wondering, my sound banks are exactly like the default...

Battle
Base_Building
Main_Menu

and the sound files for Battle is like Battle_01 until Battle_08
same goes for Base_Building... Base_Building_01 until Base_Building_08

All sound files for the same bank are in a single track, with infinite & play new wave on loop settings ticked for battle & base_building

its just that the moment i remove this preset the songs will play normally

any thoughts on this? maybe i missed a step somewhere... thanks again


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 11 Apr, 2007
Posts: 141
Location: England
Offline
Hmm, so at first you were not using the original project as a base? It is important that you use the original project files as it seems RPCs and other things are referenced by an ID, and if everything is not exactly like in the originals an XACT project could end up using different IDs for these things than what is used in the game.

Anyway, as for your problem I'm stumped, perhaps you could upload the project file somewhere. It would give me better insight as to what the problem is.

_________________
.


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 13 Jul, 2007
Posts: 41
Offline
Ok here's my little project file... hehe

http://rapidshare.com/files/92985064/Music.zip.html

EDIT: Update!!! I tried again from your project file... and for some reason the music is working properly already!! Was wondering why the first time i tried it didnt work... maybe it was because i saved it as a different project file so that i wont overwrite the original one... maybe you're right about this reference ID thingy after all... very very tricky part indeed.

Anyways, once again thanks A LOT for your time... really really appreciate it!!


Last edited by zero2nfinite on 18 Feb, 2008, edited 1 time in total.

Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 11 Apr, 2007
Posts: 141
Location: England
Offline
Hmm, ok, well that file suffers from the problem I explained in my previous post. You MUST use the original projects as a base, you can't just copy things over as they are not referenced internally the same way. The presets must be arranged exactly as in the original files for the IDs to match up with the compiled global settings in the game.

_________________
.


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 13 Jul, 2007
Posts: 41
Offline
Then I would suggest your initial XACT modding guide put emphasis on this issue, as there are many other RPC presets to be used by future sound/music modders. :D


Top
 Profile  
 PostPosted: 18 Feb, 2008 
 

Joined: 11 Apr, 2007
Posts: 141
Location: England
Offline
Yes, I did write briefly about this issue in the section under "Caution" but I will expand it into a clearer version.

_________________
.


Top
 Profile  
 PostPosted: 05 Oct, 2008 
 

Joined: 05 Jan, 2008
Posts: 31
Offline
Just to clarify I have to use the original project file. If I save it as a different name it screws up. But I can delete wave and sound banks and save over the file then build. Right now not working in FA.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy