Table of Contents
Many video games are based on levels and oftentimes there are sounds that are only associated with particular levels, such as the sound of fireworks that are only heard at your character’s victory celebration when the highest level of the game is completed. It is unnecessary to load sounds into memory if the player has not reached that point in the game.
In this build of Cube, there is an Actor-Mixer object called Map Voices that contains objects of spoken word phrases that are only heard in a level in Cube called dcp_the_core.
-
Expand the Map Voices Actor-Mixer and audition any of the Sound SFX objects contained within.
Since everything within the Map Voices Actor-Mixer is only used for one particular level in the game, you have an opportunity to better manage memory by adding these sounds into a SoundBank that is only loaded when the dcp_the_core level has been reached.
-
In the Project Explorer, select the SoundBanks tab.
Unlike the projects used in previous lessons, this project has no SoundBanks at all. Every game needs at least one SoundBank, because it’s the SoundBank that contains the audio assets as well as all the instructions for how the audio will be played. All of your previous projects have only used a single SoundBank; however, in this project you’ll use two; one for the main sounds used throughout the game and another specifically used for the sounds used in a game level called dcp_the_core.
-
Right-click the Default Work Unit and choose New Child > SoundBank.
-
Name the SoundBank Main.
Game programmers have to code the game engine to load the SoundBanks by name, so it is imperative that your SoundBanks are named correctly.
-
In the same Default Work Unit, create another SoundBank called DCP_the_core.
Now you’re ready to specify which sounds are loaded with each of your SoundBanks.
-
In the Wwise menu bar, choose Layouts > SoundBank or press F7.
-
In the SoundBank Manager, expand the Default Work Unit.
You’ll see the two SoundBanks you just created.
Each SoundBank has columns related to data size. Currently both SoundBanks have values of 0, because nothing has been assigned to the SoundBanks. There is also a Max Size column where you can assign a value expressed in bytes to designate what memory budget is expected for the SoundBanks. Budgets are often dictated early on in the game development process but can change over the course of development. It’s important to know what your budget is and stick to it, because any memory resources you use are no longer available for other aspects of the game, such as graphics.
Setting a Max Size budget does not technically constrain you to that value, but it does give you a visual warning when you exceed the budget.
-
Set the Main SoundBank’s Max Size value to 9,500,000 and the DCP_the_core size to 6,000,000.
Now you need to assign objects to the SoundBanks. Remember from earlier lessons that this is done by dragging Events and/or objects into the SoundBank to ensure that the necessary audio assets are automatically part of that SoundBank.
You need to identify the Events that are only triggered in the dcp_the_core level. Fortunately, this is made easy for you, as level-specific Events have a unique prefix indicating they’re specifically used in a particular level.
-
Select all of the Events with a DCP prefix and drag them to the DCP_the_core SoundBank.
In previous lesson projects, the DCP_Music Event was placed within the Main SoundBank, allowing you to hear the Music Track in all of the game levels. However, in this lesson, you’re placing the DCP_Music event into the DCP_the_core SoundBank, which is only loaded when the specific game level used at the end of this game is loaded. This means that you will not hear the music if you play game levels other than the level used later in this lesson.
The data size of the DCP_the_core does not yet increase. This is because you have yet to generate the SoundBank, which you’ll do after you populate the Main SoundBank.
-
Drag all of the remaining Events into the Main SoundBank.
In the Event Viewer, select the Defeated_Bauul, then scroll to the very end of the list, hold Shift and click the very last Event, WeapLoad, to quickly select all of the Events you need in one step.
You now need to identify which SoundBanks you want to generate.
-
Select the check boxes for the Main and DCP_the_core SoundBanks as well as the Windows (or Mac, if you’re running this on a Macintosh computer) platform and English language.
-
Click Generate Selected.
The Generating SoundBanks window is displayed, which shows the progress as the system discovers and then converts all of the audio assets needed to play the Events you just added to the SoundBanks.
-
Close the Generating SoundBanks window.
-
In the Wwise toolbar, ensure the Platform Selector is set to the same platform for which you just generated SoundBanks (either Mac or Windows).
In the SoundBank Manager, you'll see that the data size of both SoundBanks has exceeded their budget, and the free space is shown as a negative number in red. This indicates how many bytes of data you need to reduce each SoundBank by to meet your budget.