Custom sound.lvl effects in game

Started by Phobos, October 29, 2011, 06:25:13 PM

Previous topic - Next topic
October 29, 2011, 06:25:13 PM Last Edit: November 10, 2011, 07:58:29 PM by Inactive
Who can get custom sound.lvl effects to work in game? So far I can build sound sphere regions and background sound music but not yet custom weapon or unit sounds. I have idea for mod map that would require custom sound effects so I will be testing some ideas soon if anyone wants to help then I suggest download sound.lvl 1.2 builder

when i get sound effects working i will release sound.lvl 2.0 builder with way more options and easier customization

another thing is the 32mb memory limit on sound streams for effects. how can this be overridden?

direct wav path might make it possible to extract wav from lvl chunks:
http://www.secretsociety.com/forum/display_message.asp?mid=323

QuoteAuthor:     Psych0fred
E-mail:     psych0fred@hotmail.com
Date:     1/31/2005 11:23:10 PM
Subject:     How to Use Shipped Sounds
Message:     It's now possible to use shipped sounds missing from your levels even though I haven't finished the tool or tested adding sounds not shipped with the game. I have a demo map I am working on as a tutorial for various things and I set it up using the hailfire droid in the gcw era complete with all of it's sounds. The map itself uses kashyyyk's sounds and supplements it with just the additional samples the hailfire droid requires. So if anyone wants to try it let me know if you need help, otherwise go ahead and update your mod tools with these assets so you can do it when I finally release a BFBuilder update.

http://www.secretsociety.com/forum/downloads/PremungedSoundConfig.zip

The instructions are as follows:

1. Read the readme.txt to install.

2. In your mission.lua after picking a and setting up your base sound.lvl, add another ReadDataFile line for your mod as follows:

ReadDataFile("dc:sound\\modid.lvl;modidgcw")

name it appropriately for the era.

3. The hard part, building the sound reqs and configs. Look in the datamodid\Sound\worlds\modid folder for modid.req

Modid.req is the file that defines what is included in the lvl you Read above. Inside this req are two sections, one entited str and one entitled lvl. The section entitled lvl lists the sub-lvls to be included in the final lvl created by modid.req (modid.req -> modid.lvl).

Since in number two we are loading modid.lvl;modidgcw at the very least I need "modidgcw" under the lvl section in modid.req. Such as

REQN
    {
        "lvl"
        "modidgcw"
    }


This tells the munge to include modidgcw.lvl in modid.lvl, where modidgcw.lvl is created from modidgcw.req.

3.5 So you need to create modidgcw.req under datamodid\Sound\worlds\modid if it doesn't already exist.

That file also contains two sections, one entitled bnk and one entitled config. BNK is for sound bank and CONFIG is for sound config file. The BNK section defines the sfx files to include. In this case we want to load modidgcw.sfx so we edit the first section to look like the this:


REQN
    {
    "bnk"
    "align=2048"     
    "modidgcw"
    }

This loads modidgcw.sfx, which if it doesn't exist you need to create. SFX files are just text files that list paths to sample sources. You will fill these out by copying and pasting lines from the Assets\Sound Config Files folder. Before doing that, you first have to determine what sound config files are required to play the samples.


In my map I added the hailfire droid, which actually uses sounds from the hailfire droid AND the spider walker, so both config files were needed in the req, but no config files need to be copied since they are in the lvls that shipped with the game. So all I had to do was edit the config section to look like this:

    REQN
    {
    "config"
    "cis_tread_hailfire"
    "cis_walk_spider"
    }

NOTE: The actual config files are also in the Sound Config Files folder for you to look up their names.

3.8 Now you need to create/add sample paths to modidgcw.sfx. This you do by finding an sfx file in Sound Config Files that contains the vehicle(s) you need and copying the appropriate section from that sfx file into modidgcw.sfx. In my case I needed the hailfire droid sounds plus the spiderwalker blaster sound to complete the halfire droid, so I opened geo1cw,sfx and found the section labeled Hailfire Droid and copied that section into my modidgcw.sfx. I then found the one line for the Spiderwalker blaster and copied it below the others. Modidgcw.sfx:

..\..\cw\effects\eng_hailfire_hi_lp.wav           -resample pc 22050
..\..\cw\effects\eng_hailfire_low_lp.wav          -resample pc 22050
..\..\cw\effects\eng_hailfire_mid_lp.wav          -resample pc 22050
..\..\cw\effects\wpn_hailfire_missile_fire.wav    -resample pc 44100
..\..\cw\effects\wpn_spderWalker_laser_fire.wav    -resample pc 44100

4. The last step, editing soundmunge.bat
In you datamodid folder edit the soundmunge.bat file line that ends in -template to include -stub c:\windows\media\chord.wav (see below for entire line)

@if /i %1==pc set BANKOPT=-template -stub c:\windows\media\chord.wav

The munge needs to find a file and that's one that ships with windows so everyone should have it. Adding the stub switch to that line tells the munge to not include the files in sfx because they are already in the shipped lvls. Instead it saves a pointer to them.

When you munge you'll see an error about more thn one line referencing the same sample, ignore them. That's no error, it's an assert confirming what you did. Once you munge, it should work.

I don't think I forgot anything except you do have limited memory (32mb roughly) for sound. When you run out you'll hear audio streams such as music and vo, but NO sfx. You can do a MEM on the console in SPTEST.exe to see how much memory you are using.

If anyone has questions post them here and I'll duplicate this post on my message board to archive it.

This may sound complicated, but it's not. As long as you know reqs are include files that define what is in an lvl the rest is easy.

you can use bf2 sound lvls in bf1. just sayin there's also new possibilities that dont require making it yourself
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)