Wwise Cube en
Wwise Cube en
Cube Integration
Cube Integration
Wwise
Copyright © 2020 Audiokinetic Inc. All rights reserved.
This document (whether in written, graphic or video form) is supplied as a guide for the Wwise® product. This documentation is the property
of Audiokinetic Inc. (“Audiokinetic”), and protected by Canadian copyright law and in other jurisdictions by virtue of international copyright
treaties.
This documentation may be duplicated, reproduced, stored or transmitted, exclusively for your internal, non-commercial purposes, but you may
not alter the content of any portion of the documentation. Any copy of the documentation shall retain all copyright and other proprietary notices
contained therein.
The content of the Cube Integration documentation is furnished for information purposes only, and its content is subject to change without
notice. Reasonable care has been taken in preparing the information contained in Cube Integration, however, we disclaim all representations,
warranties and conditions, whether express, implied or arising out of usage of trade or course of dealing, concerning this documentation and
assume no responsibility or liability for any losses or damages of any kind arising out of the use of this guide or of any error or inaccuracy it may
contain, even if we have been advised of the possibility of such loss or damage.
Wwise®, Audiokinetic®, Actor-Mixer®, SoundFrame® and SoundSeed® are registered trademarks, and Master-Mixer™, SoundCaster™ and
Randomizer™ are trademarks, of Audiokinetic. Other trademarks, trade names or company names referenced herein may be the property of their
respective owners.
2
Table of Contents
1. Welcome to the Wwise Cube Integration .............................................. 1
Running the Cube Demo .................................................................. 1
Using Other Wwise Documents and Support ................................... 4
2. Understanding Wwise's Sound Engine Integration into Cube .............. 5
About the Audio Integration Process ................................................ 5
Integrating the Wwise Sound Engine ................................................ 5
Registering Game Objects ......................................................... 5
Integrating Audio ...................................................................... 6
Adding New Scripting Commands ............................................ 6
3. The Wwise Project ................................................................................ 7
Building the Actor-Mixer Hierarchy .................................................. 7
Building the Master-Mixer Hierarchy ............................................... 7
Using Game Syncs ............................................................................. 8
Creating Events .................................................................................. 8
Generating SoundBanks .................................................................... 9
Fine-Tuning your Audio in Real Time in Game ................................ 9
Integrating Changes into the Game .................................................. 9
Known Issues ................................................................................... 10
4. Need Help? .......................................................................................... 12
Using the Help ................................................................................ 12
Further Resources ............................................................................ 12
iii
Chapter 1. Welcome to the Wwise Cube
Integration
Audiokinetic integrated the Wwise sound engine into the first person
shooter game Cube. This version of Cube was provided to help you better
understand how to integrate the Wwise sound engine into your game and
provides a functional game for sound designers to experiment with Wwise.
This game was chosen as an example for the simplicity of its structure, and
because it is relatively easy to modify, if needed.
For Mac®, however, there are a couple of extra steps to follow beforehand.
The Cube Demo for Mac requires libSDL2 to be installed. Without this,
attempts to run the demo from the Launcher will present an error message:
"The SDL2 library is not detected. The Cube Demo for Mac requires SDL2 to
be installed according to the instructions at https://www.audiokinetic.com/
1
Welcome to the Wwise Cube
Integration
library/<version>/?source=Cube&id=install_libSDL2_for_mac. Please restart
the Wwise Launcher after the installation is complete." Likewise, attempts
to run the game from the Terminal will display this message: "Library not
loaded: @rpath / SDL2.framework / Versions /A / SDL2."
For different reasons, it may be that users prefer not to use the Launcher to
run the Cube Demo. There are alternative methods to run the Cube Demo,
with some differences depending on whether it is run on Mac or Windows.
Note
On Mac OS X
1. Method 1: Run under Xcode.
a. Check that Xcode is installed. If Xcode is not present in the
Applications folder, download and install it from the Mac App Store.
b. Make sure the unzipped Cube demo folder shares the same parent
folder as the installed Wwise SDK Mac distribution. For example, if
the Wwise SDK folder is ${HOME}/Wwise/wwise_${version_tag}/
SDK, then the Cube demo root folder must be ${HOME}/Wwise/
wwise_${version_tag}/CubeDemo.
c. In Xcode, open the following Xcode project: /path/to/CubeDemo/
cube_source/src/Mac/CubeMac.xcodeproj.
d. Build and run the project.
2. Method 2: Use the shell scripts.
a. Make sure the unzipped Cube demo folder shares the same parent
folder as the installed Wwise SDK Mac distribution. For example, if
the Wwise SDK folder is ${HOME}/Wwise/wwise_${version_tag}/
SDK, then the Cube demo root folder must be ${HOME}/Wwise/
wwise_${version_tag}/CubeDemo.
b. Locate the executable shell script for the desired configuration: /
path/to/CubeDemo/Mac/<configuration>/bin/RunCubeDemo.sh.
2
Welcome to the Wwise Cube
Integration
c. If the .sh files are configured to be opened by Terminal, double
click them in Finder. Otherwise, open Terminal then type /path/to/
RunCubeDemo.sh and press Enter.
3. Method 3: Run the executable in Terminal.
a. The current working directory must be where the executables are
located! Use the cd (change directory) command from $HOME to
../path/to/CubeDemo/cube. In Method 2, this detail is taken
care of by the shell script.
On Windows
1. Method 1: Use the BAT scripts.
a. Whether using the Wwise Launcher or the previous Wwise installer,
the Wwise installation creates BAT files in the "<WwiseRoot>\Cube
\cube" folder.
b. Double click the BAT of the Cube Demo version you wish to run:
debug, profiler, or release mode. Alternatively, open the Command
Prompt and type the path to the BAT and press Enter.
2. Method 2: Run the executable from the Command Prompt.
a. Navigate to the executable, "cube.exe", and run it. It can found
under "<WwiseRoot>\Cube\Win32\<mode>\bin" where "<mode>"
corresponds to the appropriate mode folder, namely Debug, Profile,
or Release.
3
Welcome to the Wwise Cube
Integration
4
Chapter 2. Understanding Wwise's Sound Engine
Integration 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.
Note
These files can be found in the following folder: <WwiseRoot>/
Cube Demo/cube_source/src.
The following tasks were involved when integrating the Wwise sound
engine into Cube:
• Registering Game Objects
• Integrating Audio
• Adding New Scripting Commands
5
Understanding Wwise's Sound
Engine Integration into Cube
• Dummy game objects, numbered 64-127. These are used for 3D sounds
that are not attached to a moving entity (for example, items spawning).
Integrating Audio
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
• Certain events also need to go to the server for network play; this is
handled by snd_clientevent().
Miscellaneous Sounds
• To find all other sound events occurring during game play, search for
snd_event() calls in the code base.
The following new sound-related commands 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.
6
Chapter 3. The Wwise Project
A Wwise project was created to facilitate the integration of the Wwise
sound engine into Cube. Most of the sounds in the Audiokinetic version of
Cube have been modified from the original game.
Note
The Wwise project file is located in the following folder:
<WwiseRoot>/Cube Demo/WwiseProject.
The following sections describe some of the work that was done in the
Wwise project.
For the Cube project, the following audio structure was created:
• In the "Main" folder, four actor-mixers were created to group sounds
into logical categories: Characters, Items, Monsters, and Weapons.
• Within the actor-mixers, a series of random and switch containers were
used to add variety and distinctiveness to the sounds in the project.
• Randomizers were applied to the volume and pitch properties for
some weapons and footsteps. The Randomizer randomly modifies the
property values of the object each time it is played.
• All sounds within the "Main" folder are 3D sounds that use Game-
defined positioning with a standard distance-based attenuation on
volume.
• In the "Maps" folder, there are sounds, voices, and music specifically
related to the map "dcp_the_core". All voices and music within this map
are 2D sounds that are streamed from the hard drive.
For the Cube project, the following bus structure was created:
• Three main control busses were created: Music, SFX, and Voice.
• The Environments bus groups a series of auxiliary busses. Each auxiliary
bus has a reverb effect inserted that represents a room in the game.
Which auxiliary bus is processing at runtime is decided in the game's
code.
7
The Wwise Project
• Auto-ducking was applied to the Voice bus so that Music is ducked when
a Voice is played.
• An RTPC was applied to the Volume property of the three main control
busses. These volume controls were mapped to the in-game volume
faders (using game console).
The Teleport looping Synth One sound uses the game parameter
"Distance_to_Object" on the "Base Frequency" parameter of the synth
to create an interesting pitch bend effect as you approach the teleporter.
This game parameter can be reused on other sound objects.
Creating Events
Wwise uses events to drive the sound, music, and dialogue in-game. Events
contain one or more actions that are applied to the different sound or
music structures within your project hierarchy. For the Cube project,
events were created and given names that matched the sound names
triggered by Cube.
8
The Wwise Project
Generating SoundBanks
SoundBanks are basically the product of all your work and are the final
audio package that becomes part of your game. They contain a group of
events, Wwise objects, and/or converted audio files that will be loaded into
a game's platform memory at a particular point in the game. For the Cube
project, the following two SoundBanks were created:
• Main - Groups all events used in all maps.
• dcp_the_core - Groups the events for the map "dcp_the_core".
Note
Refer to the documentation to learn how to use the Remote
Connection to connect to the game.
You will notice that the new sound is automatically played in the game.
6. Experiment with other sounds in your game to see how quickly and
easily you can fine-tune your game audio.
9
The Wwise Project
Note
Notice that you have two SoundBanks for this project: DCP_the_core
and Main.
2. From the SoundBanks list, click Select All.
3. From the Platforms list, select the Windows or Mac option depending
on the operating system you work on.
4. From the Languages list, select the English (US) option.
5. From the menu bar, click Project > Project Settings.
The Generating SoundBanks dialog box opens where you can view the
progress of the SoundBank generation process. When the SoundBanks
have been generated, the SoundBanks Generation - Completed dialog
box opens.
10.Click Close.
The new SoundBanks have been generated and integrated into the Cube
game. The next time you play Cube, the new sounds will be part of the
game.
Known Issues
As this is just an example of how to integrate the Wwise sound engine into
a game engine, the following issues were not resolved in this release.
10
The Wwise Project
11
Chapter 4. Need Help?
Using the Help
The Wwise Help contains detailed information on each interface element
in Wwise.
Further Resources
The Cube game and its Wwise project provide an idea of the workflow
of developing a full game with Wwise. If you want to learn more about
Wwise by looking at different approaches on game audio implementation,
we suggest you take a look at the following resources:
• Limbo - Also available from the Wwise Launcher on a Windows, you
can install Limbo, the multi-award game developed by Playdead with
the full Wwise project. Limbo might be more suited for more advanced
Wwise users because some sound hierarchies might appear quite
complex to newcomers. Limbo is not available to install from the Wwise
Launcher on a Mac.
• Video Tutorials - Video tutorials are available for all users in the
community section of our website. They are also available on
AudiokineticWwise's YouTube channel.
• Wwise Certification - The Wwise Certification online courses
offer several programs for learning Wwise fundamentals and
advanced specialized topics. Note that the Wwise-101 and Wwise-201
Certification Programs use Cube as the platform of choice for teaching
Wwise.
Note
Materials sent by content providers were all originally high
quality (48 kHz, 16 or 24 bits). However, to save download time
and disk space, the size of some of the sound assets has been
reduced.
12