SoundDoc-YA

Yet Another Sound Doc

*Always remember, reqs make lvls when they are munged and defined what gets packed into them.*

The game runs, the mission lua is read.

The LUA has lines to ReadDataFile which specify which lvl files to open, and which assets within them to load into memory.

The paths specified in the ReadDataFile lines are in the final _lvl_pc folder.

Sounds for each playable planet are wrapped up inside a single lvl named after that planet under _lvl_pc\sound

For example, _lvl_pc\sound\nam.lvl

The contents of what gets packed into that lvl is defined by a sound req of the same name.

Within each lvl can be packed any kind of data, including other lvls.

Typically there are 3 sound req files in each planet's sound folder.

1 req is for the final world sound.lvl to put on disk in the lvl_pc folder.

2 are era reqs that generate lvls that are put in _build_pc\sound\NAM\munged.

During the munge the 2 era lvls generated are subsequently packed into the world sound.lvl.

The world sound.lvl's contents are defined in the world's sound.req of the same name.

For example nam.req generates nam.lvl.

The world sound.req also contains streams which can be accessed in any era.

The contents of the world sound.req, nam.req for example, contains two sections, str and lvl.

The str section references stream (st4, stm) file names, the lvl section references req file names.

The era specifc sound reqs, nam1gcw.req for example, contains two sections, bnk and config.

The bnk section contains a list of sfx file names, the config section a list of snd, mus, and ffx file names.

Config files contain sound properties, and sfx, st4, and stm files contain sound sample paths.

When a mission lua ReadDataFile line opens the sound lvl it references the specific sub-lvl to use as well.

This only opens and loads the assets need for a specific mission.

Aside from that there are also global streams defined by a global req that are loaded on every level automatically.

In the mission lua there are also OpenAudioStream lines that open streams that have already been loaded.

Global streams, typically used for VO, are always available to be opened and used without a ReadDataFile line in the lua.

World specific music and streams need to be loaded from the sound.lvl and it's sub-lvls and streams.

When a world's sound.lvl and sub-lvls are loaded, they must contain the sound properties for any streams needed.

While all of the streams for both eras are packed into the parent sound.lvl for a map, the sub-lvls contain the snd and sfx files.

So when the game runs the lua loads the sound lvl and the streams defined in the parent in it's req as well as one era's sub-lvl.

The era's sub-lvl contains the sfx files (XBOX and PS2 only), and are loaded in order of dependency if any.

The STR section appears first in the nam.req because they need to be present before anything can reference them.

The SFX section appears first for the same reason, with the SND files that reference them following in the config section.

The same applies to the mission lua, the ReadDataFile line and OpenAudioStream lines must appear before any attempt to use them.

ReadDataFile appears at the top of the file before any OpenAudiostream lines that reference contents of the files it loads.

OpenAudioStream appears above any lines that use VO contained in those streams, for example the Low Reinforcement announcements.