Wwise and SpotFX
This Tutorial explains how to make use of all the functionalities of Wwise for Sounds that are emitting from a spot location.
Setting up SpotFX in Wwise and CRYENGINE
Setting up the AudioTriggerSpot Entity in CRYENGINE
Using the AudioTriggerSpot Entity
CRYENGINE uses the AudioTriggerSpot Entity to playback WwiseEvents that are emitting Sound from a spot location in your Level. We call these Sounds SpotFX.
In Wwise there are multiple options to influence how sound will be heard (on an Entity) when it's played back in the ENGINE.
The AudioTriggerSpot can be found in the RollupBar under Objects/Audio. After selecting the AudioTriggerSpot Entity you can place it anywhere in your Level.
For a detailed explanation on how to correctly setup the AudioTriggerSpot Entity in your Level follow the instructions found here.
Working with Attenuations
When creating a new Sound Object in Wwise it will, by default, be a 2D Sound. This means the Sound will always play back the same and with no changes in volume or panning i.e. on account of the listener's and/or Entity's position.
Therefore, if you trigger a 2D Sound on an AudioTriggerSpot it will always Sound the same regardless of the location of your character or the AudioTriggerSpot Entity in your Level.
To setup a 3D Sound in Wwise, first create a new Sound Object in the Wwise-Actor-Mixer Hierachy, make sure to create an Event and include it in the Soundbanks as explained here.
The screenshot below shows a setup where the Sound Object would playback as a 2D Sound in CRYENGINE, this is because Wwise sets all Sound Objects to a 2D position type by default.
However, we want to place the Audio in the Game and have it attenuate properly and according to the listener's and Entity's position, therefore we define the Sound Object in Wwise to be a 3D Sound.
You can do this using the Positioning Tab of the Sound Object Property Editor. In the Positioning Tab select the 3D positioning type.
Afterwards create a new custom Attenuation for the Sound Object by clicking on the >> Button and selecting Default Custom (see screenshot below).
In Wwise it is useful to create Sharesets for the Attenuations you are using on multiple Sound Objects.
To learn more about Sharesets take a look at the Wwise documentation and the following tutorial video.
You can change the custom Attenuation by clicking on the button named Edit... in the 3D Section of the Sound Property Editor.
Set it to a range of for example 45 meters and attenuate the volume accordingly.
After you have finished setting up the Attenuation for your Sound generate your Soundbanks and connect the ATL Trigger on the Audio Trigger Spot in your Level.
You will notice that the Sound is now being attenuated according to the distance of the listener to the AudioTriggerSpot Entity.
In this example we have just made use of the Volume Attenuation, however within the Attenuation Editor inside Wwise you can also control the Filtering, Spread or Reverb-Sendlevel depending of the distance to the the listener.
Working with Cone Attenuation
Another useful Attenuation feature in Wwise and one that can be used inside CRYENGINE is the Cone Attenuation functionality.
This affects how the player hears the Sound depending on their positioning around the Sound emitting Entity.
For example take a normal speaker, it can sound open and loud while standing in front of it, but be made to sound more muffled and quiet when standing behind it.
This effect can be created in Wwise by enabling Cone Attenuation in the Attenuation Editor.
After enabling Cone Attenuation recreate your Soundbanks and then reload them via the "Refresh Audio" menu option in CRYENGINE.
If you are now moving around your created Audio Trigger Spot in game you will hear the Sound attenuating accordingly.
It will now take into account the distance as well as the position of the listener in relation to the Entity and attenuate the Sound accordingly.
Other Use Cases for Wwise Attenuations
The above explained behaviors are also relevant for Sounds that are not triggered by the AudioTriggerSpot.
The Wwise Attenuation can also used to setup ATL Triggers that can be called MaterialEffects, Particles or Animations.
If you want to learn how to connect the ATL Triggers for those use cases, then take a look at the following Tutorial Pages which can be found in Sandbox Editor and the ATL
Sounds in Animations
Sounds in Particle Effects
Sounds in Trackview Sequences
Randomizing Sound on the AudioTriggerSpot vs Randomization in Wwise
The AudioTriggerSpot offers randomization features which allow the retriggering of a Sound at a certain time and radius.
For example, this can be used to simulate seagulls which can be heard at different points in time and in different positions in the sky.
An example of this setup can be found in the CRYENGINE Sandbox Editor showcase Levels.
We have two ways to achieve this, either by using the functionality inside Wwise or inside the AudioTriggerSpot Entity.
What you choose to setup the retriggering or the randomized positioning on the AudioTriggerSpot depends on the implementation scenario.
In the examples below we are going to create a RandomContainer in Wwise and populate it with multiple Sounds
Using the AudioTriggerSpot
- Select the RandomContainer in Wwise and make sure it is set to Step and not to Loop Enabled.
- Randomized Retriggering:
- In CRYENGINE select the AudioTriggerSpot and enable PlayRandom in the AudioTriggerSpot properties.
- Set a value for MinDelay and MaxDelay to define the time range in which the ATL Trigger will be retriggered.
- Randomized Panning:
- In CRYENGINE enable PlayOnX/PlayOnY/PlayOnZ in order to enable on which axis of the Audio Trigger Spot the Sound position can be randomized on.
- Set a value for RadiusRandom to define the range in which the Sounds can be randomized.
Setting up this functionality in CRYENGINE is more performance effective when using Obstruction/Occlusion on the Audio.
Also, the randomized positioning takes into account the Obstruction/Occlusion of other materials between the spawnpoint for the Sound and the listener's position.
Note: In comparison to Wwise you do have less randomization options over the Entity.
Using Wwise Functionality
- Select the RandomContainer in Wwise and ensure it's set to Continuous.
- Randomized Retriggering:
- Select the RandomContainer in Wwise and enable the Loop checkbox in the Property Editor.
- Enable the Transitions checkbox and select Retrigger as the Transition Type.
- Enter a time value for the Transition. This time can also be randomized upon each trigger in Wwise.
- Randomized Panning:
Select "User-defined" as the Position Source in the Positioning Tab of the Property Editor.
When selecting the "Edit.." button for the User-defined Position Source you can now setup a Random Range for the X, Y and Z axis in which the Sound should be randomized.
Setting up this functionality in Wwise gives more options in terms of Randomization (Standard, Shuffle, Avoid Repeating Last) as well as Transitions.
Also, you can draw user defined positioning paths that let the Sound travel along predefined paths in Wwise.
On the downside, the user defined positioning will not take into account Obstruction/Occlusion values from where the Sound is spawning.
Also, with this setup the Obstruction/Occlusion will be calculated as long as the Play_ Event is active, and also if no Audio is currently playing inside of Wwise.
You can learn more about Obstruction and Occlusion in CRYENGINE here.
You have now learned how to setup your Wwise Project for SpotFX Sounds and to make them play correctly inside CRYENGINE.
Next, learn how to create and setup Ambiences in Wwise and CRYENGINE.