Version
This method will apply if:
The game or its audio/motion content can be split into multiple sections.
This method works well for single player games, where all possible sounds and motion are only driven by the current location of the player in the game. By splitting the content into multiple SoundBanks, you can manage memory more efficiently than the first method, yet still benefit from a relatively easy integration of audio and motion in your game.
To begin with, you must first determine how to split up your SoundBanks. For example, you may decide to split up your SoundBanks as follows:
One general SoundBank containing all the Events that can occur at any point in the game. This SoundBank would be loaded into memory at all times.
One SoundBank per level, or one per environment. For sounds and motion that depend on the actual location of the main character.
And possibly some additional SoundBanks, depending on the requirements of your particular game.
To create multiple complete SoundBanks in Wwise:
Create the SoundBanks you will need for the game and then name them appropriately, for example, “CommonEvents”, “Level_1”, “Level_2”, and “Level_3”.
Group your Events into Virtual Folders in Wwise. Create one Virtual Folder per SoundBank and then drag each Virtual Folder into its corresponding SoundBank. By adding Virtual Folders to your SoundBanks, you can avoid having to edit the contents of your SoundBanks every time a new Event is added to your project. When the contents of your Virtual Folder change, the SoundBank automatically gets updated.
Add all Events to their respective SoundBanks. This step is only required to add Events that fall outside the original folders, if any. If an Event needs to be in multiple SoundBanks, then simply add it to the required SoundBanks.
Generate the SoundBanks and copy the generated SoundBank folder to the game application.
To integrate the multiple complete SoundBanks in game:
In the game, simply load the right SoundBank at the right time. For example, the game could load the general SoundBank at the beginning and then load the other SoundBanks based on the player's actual location in the game. Note that some games will need to have enough memory to load more than one “level” at a time, to allow for transitions between levels.
The following sample of code gives you an idea how these SoundBanks can be loaded in game.
// Initialize the sound engine here. ... // Load the Init bank and the Common SoundBank. AkBankID bankID; // Not used in this sample. AKRESULT eResult = AK::SoundEngine::LoadBank( L"Init.bnk", AK_DEFAULT_POOL_ID, bankID ); if ( eResult == AK_Success ) { eResult = AK::SoundEngine::LoadBank( L"MyAllInONeBank.bnk", AK_DEFAULT_POOL_ID, bankID ); } ... // And at various places in the code, based on the actual needs: eResult = AK::SoundEngine::LoadBank( L"Level_1.bnk", AK_DEFAULT_POOL_ID, bankID ); ... eResult = AK::SoundEngine::LoadBank( L"Level_2.bnk", AK_DEFAULT_POOL_ID, bankID ); ... eResult = AK::SoundEngine::LoadBank( L"Level_3.bnk", AK_DEFAULT_POOL_ID, bankID ); ... eResult = AK::SoundEngine::LoadBank( L"Level_1.bnk" ); ... eResult = AK::SoundEngine::LoadBank( L"Level_2.bnk" ); ... eResult = AK::SoundEngine::LoadBank( L"Level_3.bnk" );
Note | |
---|---|
As an alternative to the LoadBank() command, you could prepare your SoundBanks using the AkBankContent_All command. The advantage of preparing your SoundBanks is that you avoid the possibility of duplicating media in memory. Refer to the section “Preparing Banks” in the Wwise SDK documentation. |
The following table lists the pros and cons of the Multiple Complete SoundBanks method.
Pros |
Cons |
---|---|
May require a lot less memory than the “All-in-one” SoundBank technique. Very easy to integrate in game. |
Not well adapted for online or Event-based games, where the audio or motion requirements are driven by more than just simple facts like the main character's location. May cause some media file duplication loaded in memory, because SoundBanks can contain duplicated data. May increase the total space of the SoundBanks on disk because different SoundBanks may have similar content. |
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise