Created By: Game Audio Resource Ltd Date: 20/07/2019 Version: 2.00
In this guide we will add Various underwater audio assets & Data that will be controlled by global underwater Wwise state, for when the player character is above and below water
- STEP 01: Ambience Loop
- STEP 02: Underwater Global Control
- STEP 03: PlayerInWater Wwise State
- STEP 04: Body Splash In / Out
- STEP 05: Test & Integrity Report
Task Time Needed: Around 1 Hour
Chapter 06 D – Step 01
In this step we will assign an underwater loop asset to play when the player is underwater.
- Under the Actor-Mixer Hierarchy > Default Work Unit > Environment WWU, right click, select New child > Actor Mixer. Name the new mixer ENV_Underwater
- Drag your Underwater looping audio asset into the new mixer, place it under SFX, Environment > Underwater.
- Select the loop asset, then in the Property Editor > General tab window tick the loop box.
- In the Project Explorer > Events tab find the event Map_Loaded in the unused folder. Then Cut move it to the Environment work Unit.
- Select the event, then in the Event Editor, right click > New Action > Play.
- Drag the underwater loop asset from the Actor_Mixer hierarchy onto the new event Play line.
- In the properties of this new event instruction, change the fade time to 1
- Finally, we need to define only to play the asset when the player character is underwater.
Return to the Audio tab Actor-Mixer …. Environment_Underwater Actor-Mixer.
In the Property Editor select the States tab.
- Select Add State Group > Default Work Unit > PlayerInWater.
- In the States list change the Voice volume Value for No to -96 (Silence)
- We need to assign an output bus. Select the ENV_Underwater Actor-Mixer.
In the Property Editor > Generals Tab assign the Output Bus to the … > SFX > Environment Mixer
- Now we can test the asset in Wwise.
Select the Underwater looping audio asset.
Then in the transport control, click on States, this will display the underwater state.
Set the PlayerInWater state to Yes
Press play or space bar
You now hear the underwater asset.
While the assert is playing, change the PlayerInWater state to No. The loop should fade out and stop playing.
Chapter 06 D – Step 02
Underwater Global Control
In this step we will add a global control for all assets, when the player is underwater.
- Under the Master-Mixer Hierarchy > Master Audio Bus, select SFX mixer.
- In the Property editor, select the states tab.
- Select Add State Group > Default Work unit > PlayerInWater.
- In the Voice Low-Pass filter column change the value of the PlayerInWater Yes state to 50.
- Then in the Bus Volume column change the Yes value to -5
As this setting also affects the Underwater Mixer Bus. We need to offset the Underwater content.
- Select the ENV_Underwater Actor-Mixer. Then in the Property Editor > States tab.
Add the following value changes for the Yes state
Voice Low-pass = -25
Voice Volume = +5
Chapter 06 D – Step 03
PlayerInwater Wwise State
This import step sets up the PlayerInWater state to work correctly depending on the situation in the game environment.
- In the Project Explorer > Events tab > unused folder, find the following events:
- Drag these 4 sound events into the Default Work Unit > Bodyfall Work Unit.
- Select the event SplashIn_Player. In the Event Editor list, right click and select: New Action > States > Set State
- In the Target field of this new action, right click select Set Target > Default Work Unit > PlayerInWater > Yes.
- TIP: You have now defined that the PlayerInWater state Yes will play when the sound event SplashIn_Player is called via code. Basically, when the player character enters water (above waist height)
- Next click on the event SplashOut_Player. In the Event Editor list, right click and select: New Action > States > Set State
- In the Target field of this new action, right click select Set Target > Default Work Unit > PlayerInWater > No
- TIP: You have now defined that the PlayerInWater state No will play when the sound event SplashOut_Player is called via code. Basically, when the player character exits water (above waist height)
- TIP: We do not need to assign this state to the monster versions of these events:
As the PlayerInWater state is coded to the player character only.
- TIP: If you have the time to try assigning the PlayerInWater state to the Monster splash in/out events, I suggest to do so. It will give you more insight into how states work and improve diagnosing issues and bugs in the future.
Finally, we need to set a property to tell the engine at the start of the level not to play the water loop.
- Locate the Map_Loaded Event under the events tab > Default Work Unit > Environment, right click select New Action > States > Set States.
- Then in the target window select Set Target > Default Work Unit > PlayerInWater > No.
Chapter 06 D – Step 04
In this step we will add assets to play when an entity enters and exits water above waist height, using the SplashIn & SplashOut events.
- In the Actor-Mixer Hierarchy > Default Work Unit > Body , add 2 new random containers.
- Name the Random Containers:
- Drag the associated audio assets In to the corresponding random containers.
Place them under SFX > Body > Body_Splash
- Return to the 2 splash random containers, then assign the output bus in both containers to the Body mixer Bus.
- Now we need to associate these random containers to sound events.
In the Project Explorer > Events tab locate the SplashIn_Player event under Bodyfall
A Play property should be set up with Placeholder_Silence_One_Shot (from an earlier guide). Drag the Bodyfall_Splash_Into_Water random container onto the target box.
Repeat this process with all 3 other Splash related events assigning the corresponding random containers to each target box in each event
- TIP: Use the 2 window Project Explorer screen layout as described in the last Chapter (06_C)
- All data is now set up, Generate the sound banks.
- Save your Wwise project updates.
Chapter 06 D – Step 05
Test & Integrity Report
Lastly, we check our updates in game
- Boot up the game and connect Wwise to the game.
- Load the map Load Maps > more maps (3) > map island_pre
- TIP: Is this a great map for testing underwater and large volumes of water audio content.
- Move the player character under water.
The underwater loop should start to play as the players character goes underwater. The loop should then stop when the character comes out of the water.
You will also notice the Test footsteps, play under water but are not affected by the volume and low pass values we set up. For now, Mute the TEST_Footstep Random Container.
- TIP: In the upcoming Footstep guide, we will remove footsteps from playing under water and add water wades and bubbles to play instead.
- Finally run an integrity report to confirm no errors exist.
- TIP: You will now notice the PlayerInWater State is no longer listed in the Integrity Report.
- TIP: You may notice that, the splash In or Splash out sometimes triggers twice when entering or exiting water. Toward the end of this guide series we will overview limiting optimization and options