Wwise Unreal 2019 – Chapter 03E: Environment -Start & Stop Events Via Box Triggers

Created By: Game Audio Resource Ltd     Date: 09/11/2019      Version: 1.00

Wwise UE4: Chapter 03 E – Environment:
Start & Stop Events via Box Triggers

In this guide we highlight how to start & stop Wwise Events when you enter and exit the house in the middle of the map, allowing the ambience to change. We will use a single trigger box with associated BP nodes to change between 2 Events every time the player character moves through the Box Trigger.

GUIDE STEPS:

  • STEP 01: Wwise Hierarchy
  • STEP 02: Unreal Hierarchy
  • STEP 03: Map Tagging & Blueprint Updates
  • STEP 04: Test
  • STEP 05: Bug Fixing

Download the free associated written guide:
Wwise_Unreal_Chapter_03E_Environment_Start_&_Stop_Events_Via_Box_Triggers


Video Guide


Written Guide

STEP 01:
Wwise Hierarchy

First we set up the needed Wwise Data

  1. Navigate to the Audio tab > Actor-Mixer Hierarchy > Environment Work Unit.
    Right click then select: New Child > Actor Mixer.
    Name it: ENV_Internal
  2. Select the Actor Mixer, then in the General Settings tab > Output Bus, Assign the Environment Audio Bus
  3. Also, in the General Settings tab, under Game-Defined Auxiliary Sends, tick the Use game-defined auxiliary sends box
  4. Right click the Actor Mixer, then select: New Child > Random Container.
    Name it: ENV_Internal_House
  5. Drag in a looping low air drone audio asset under the Actor Mixer
    Place it under the Path: SFX > Environment > New Folder – Internal
  6. Select the looping audio assets, then in the General Settings tab, tick the Loop tick box.
  7. Right click the Random Container, then select New Event > Play.
  8. Right click the Random Container, then select New Event > Stop > Stop.
  9. In the Events tab, right click the Environment Work Unit, then select: New Child > Virtual Folder.
    Name it: ENV_Internal
  10. Locate the Play and stop events
    Rename the 2 events to:
    > Play Event = SFX_ENV_Internal_House_Loop_Start
    > Stop Event = SFX_ENV_Internal_House_Loop_Stop
  11. Drag both Events into the new ENV_Internal Virtual Folder.
  12. We need to update the events to stop or start the global wind when the events are called.
    Select the Event SFX_ENV_Internal_House_Loop_Start
    In the Event Editor, right click the list then select: New Action > Stop > Stop.
    Add another Stop Action to the list, so you have 2 blank Stop Actions.
    Select each Stop event Action line individually, then change the Scope to Global
  13. Return to the Audio tab.
    Drag the ENV_Wind Loop and the One-shot wind gusts onto each of the 2 Events blank lines.
  14. Next, we add a fade to each of the 3 entries in the Event, so that in-game the sounds smoothly crossfade and don’t suddenly stop and start.
    Select the Play line. Then add a fade time Value of 1.
    Then add a Fade time Value of 1 to the 2 other Stop Actions in the list.
  15. Select the Event call SFX_ENV_Internal_House_Loop_Stop.
  16. Right click the Event list, then select: New Action > Play
    Add another Play action to the list, so that you have 2 blank Play Actions.
    Navigate back to the Audio tab > Environment > ENV_Wind Actor Mixer.
    Drag the Wind looping & one shot wind gusts Random Container onto each of the 2 Events blank Action lines.
  17. Now add a fade time value of 1 to each of the 3 Event Actions in the list.
  18. Save your Wwise Project updates, then Generate the sound Banks.

STEP 02:
Unreal Hierarchy

Next, we set up the associated Unreal hierarchy

  1. Navigate to the Content Browser > Content > Audio > Wwise_Event > Environment Folder.
    Right Click, then select: New Folder
    Name it: ENV_Internal
    Open the new folder.
  2. Open the WwisePicker (UE4 toolbar > Windows)
    Then under the path: Event > Default Work Unit > Environment > ENV_Internal, drag in the 2 new Start / Stop Events into the new UE4 Folder.
    Select Both of the Events then, right click and select Edit
    Assign both Events to the Sound Banks: SB_Environment
  3. Save the 2 Events that have been updated, then close the Event Window.
  4. Generate the UE4 Sound Banks

STEP 03:
Map Tagging

& BluePrint Updates

Next, we shall add collision boxes to the map to start the internal room air loop and stop the external wind assets when the player character enters the house via a door.
Then when the player character exits the house via a door, we will stop the internal air sound and restart the external wind loop content.

  1. Open the Map we have created in Chapter 01 (or the map you are working with)
  2. Drag the following 2 Events into the map:
    SFX_ENV_Internal_House_Loop_Start
    SFX_ENV_Internal_House_Loop_Stop
    TIP: The position of the events does not matter, so place them anywhere.
  3. In the World Outliner list, right click the Audio_SFX folder, then select: Create Sub Folder
    Name it: ENV_Internal
    Drag the 2 Internal_House Events into the new folder
  4. Select each event individually then in the Details tab > AK Component > Occlusion Refresh Interval, change the value to 0.0
  5. In the Modes tab, search box type: Box Trigger
    Drag the Box Trigger from the list into the map, Position the Trigger at the house entrance door on the ground floor.
    Then with the Box Trigger selected in the WorldOutliner list, adjust the scale size of the Box trigger in the Details tab, so it fully covers the Ground Floor Door entrance.
  6. Name the Box Trigger: TRG_ENV_House_GF_Door_01.
  7. Drag the Box Trigger into the WorldOutliner > Audio_SFX > Environment > ENV_Triggers Folder
  8. Now we have the Box Trigger implemented we need to tell a BluePrint what to do it.
    In the Central Toolbar, Select Blueprints > Open Level BluePrint.
  9. In the World Outliner, select the Box Trigger (TRG_ENV_House_GF_Door_01)
    Then in the Level BluePrint, move to a large empty space in the graph, then right Click the graph, then in the search box type: OnActorBegin.
    Then Select the OnActorBegin… node from the list. Creating a new node in the graph.
  10. Right click the graph, then in the searchbox type: Flip flop, select it, to add it to the graph.
  11. Right click the Graph, then select the following AK node:
    AudioKinetic > Actor > Post Event
  12. In the Post Event node > AK Event, assign the Event: SFX_ENV_Internal_House_Loop_Start
  13. Drag the SFX_ENV_Internal_House_Loop Start_01 Event from the World Outliner list Audio_SFX > ENV_Internal folder into the Level BluePrint graph.
  14. Right click the Graph, then select the following AK node:
    AudioKinetic > Actor > Post Event
  15. In the Post Event node > AK Event assign the new Event: SFX_ENV_Internal_House_Loop_Stop
  16. Drag the SFX_ENV_Internal_House_Loop Stop_01 Event from the WorldOutliner list Audio_SFX > ENV_Internal folder into the Level BluePrint graph.
  17. Now connect the nodes together in the following path:
    > OnActorBegin > FlipFlop
    > FlipFlop A > Post Event (SFX_ENV_Internal_House_Loop_Start)
    > SFX_ENV_Internal_House_Loop Start_01 Node > Post Event Actor (SFX_ENV_Internal_House_Loop_Start)
    > FlipFlop B > Post Event (SFX_ENV_Internal_House_Loop_Stop)
    > SFX_ENV_Internal_House_Loop Stop_01 Node > Post Event Actor (SFX_ENV_Internal_House_Loop_Stop)
  18. Compile & Save the Level BluePrint.
  19. Play the map. Confirm that when you enter the house the External global wind fades out, and the internal air loop fades in.
    Then exit the house and confirm the internal air sound fade outs and the external wind sounds fade in.
  20. You have now set up one door to change the ambience depending on if you are entering or exiting the house. As this is simply a continuous A/B switch if we exit the first floor door then enter the house again via the ground floor door, the wrong ambience will be triggered.
  21. Next, we need to add the same process again for the first-floor balcony door.
    Use a new Box Trigger around the first-floor door. Then associated the new Box Trigger to a new OnActorBegin Node in the Level BP.
    With the FlipFlop node A, B paths, this time we will place them in reverse as we are inside the house first. e.g.
    A = SFX_ENV_Internal_House_Loop_Stop
    B = SFX_ENV_Internal_House_Loop_Start
    TIP: Using this method ensures an area is contained to trigger the correct Events needed when the area is entered and exited.
    Obviously if the player start position is inside the house, then the GF door Box Trigger FlipFlop A / B paths will need adjusting / reversing.
  22. As we have now set up all the BP nodes we need, we will group all our new nodes together.
    Left mouse click drag & hold a box around the new nodes. Then press C on your keyboard.
    Name the Comments bar: SFX Trigger Environment Internal
  23. Compile & Save the Level BluePrint.

STEP 04:
Test

Now we can test the updates in-game.

  1. Connect Wwise to Unreal,
  2. Then change to the Wwise Layout: Profiler.
  3. Solo the Associated Environment content.
  4. Play the map
  5. Now move the player character inside the house. You should hear the ambience change.
  6. Then move the player character up the stairs and out onto the roof. You should now hear the ambience change to external wind and fade out the internal air sounds.
    Check all fade outs sound smooth.
  7. Make any balancing changes you wish to add.
  8. Disconnect Wwise to Unreal
  9. Save your Wwise Project updates and Generate the Wwise Sound Banks.
  10. Lastly, Generate the UE4 Sound Banks, then import the Sound Bank changes.
%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close