Understanding the Sound Engine Integration into Cube
The following tasks were involved when integrating the Wwise sound engine into Cube:
Cube, originally developed by Wouter van Oortmerssen, is an open-source single or
multi-player first person shooter game that is readily available from the Cube web site
(http://cube.sourceforge.net/). To accommodate the integration of Wwise, the following
modifications were made to the version downloaded from the Cube website:
The existing sound code was rewritten to use the Wwise sound engine.
The audio content was moved into a Wwise project.
Dependencies on other libraries (SDL, SDL_image, libpng) were removed.
Extra audio (footsteps, rocket thrust sound) was added.
Some game config and content files were modified to accommodate the above
changes.
Two kinds of game objects were registered in the sound engine:
Pointers to the baseent struct. These are the moving entities of the game world:
players, monsters, and projectiles.
Dummy game objects, numbered 64-127. These are used for 3D sounds that are not
attached to a moving entity (for example, items spawning).
The core of the audio integration code is located in the <WwiseRoot>/Cube
Demo/cube_source/src
folder in the following files:
The following types of sounds were involved in the integration process:
Monster Play Sounds:
Each character has associated pain, die, and footstep events. (See monstertypes[]
in monster.cpp.)
Footstep events are posted from the monsterfootstep() function, which also sets
the 'Material' switch corresponding to the texture underneath the character, to drive
the footstep switch container.
Items have associated pickup events. (See itemstats[] in entities.cpp)
Weapon Sounds:
Each weapon has an associated event. (See guns[] in weapon.cpp)
Projectiles have a splashing event (S_FEXPLODE, S_RLHIT).
The rocket has a continuous thrust sound (played by the event S_RLTHRUST).
Velocity in baseent is boosted to enhance Doppler effect. The sound is stopped by the
rocket splash event (S_RLHIT).
Shooting while quad damage is enabled also posts the event S_ITEMPUP.
Network Sounds:
Miscellaneous Sounds:
Adding New Scripting Commands
The following new sound-related commands were created to help you manage the sounds. These
can be used in the '.cfg' script files:
akevent <string>: post an event (by name) on the local player game object
(player1).
soundvol <int>: to set the sound volume (0-255).
musicvol <int>: to set the music volume (0-255).
voicevol <int>: to set the voice volume (0-255).
texturematerial <int> <string1> <string2>: this is essentially the
same command as 'texture', but with an added parameter which is the associated material
for footsteps.
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise