Wwise Unreal 2019 – Chapter 05B: Weapon – Projectile Impact & Bounce

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

Wwise UE4: Chapter 05 B – Weapon:
Projectile Impact & Bounce

In this step we set up Wwise with a Blend Container so that we can trigger fast and slow impacts as the projectile bounces.
We also set basic blueprint parameters to stop over triggering of the projectile as it comes to a stop.

GUIDE STEPS:

  • STEP 01: Wwise Hierarchy
  • STEP 02: Unreal Hierarchy
  • STEP 03: Unreal Blueprint
  • STEP 04: Test

Download the free associated written guide:
Wwise_Unreal_Chapter_05B_Weapon_Projectile_Impact_&_Bounce


Video Guide


Written Guide

STEP 01:
Wwise Hierarchy

First, we set up Wwise with the associated projectile impact / Bounce content via a Blend Container using a Game Parameter for projectile speed, allowing the game to inform Wwise whether to play Fast or Slow impact audio assets.

  1. Navigate to the Game Syncs tab, under Game Parameter, right click the Default Work Unit, then select: New Child > Game Parameter.
    Name it: GP_Projectile_Speed.
    Select the Game Parameter. Change the Range values to the following:
    Min = 0
    Max = 3000
    Default = 3000
    TIP: This Game parameter will be added to the Blueprint and send the projectile speed value to Wwise, so we can switch audio assets based on the projects speed.
  2. Navigate back to the Audio tab, WEP_Shotgun Actor Mixer. Right click, then select: New Child > Blend Container.
    Name it: WEP_SHG_Projectile_Impact
  3. Open the Blend Container, then click on the New Blend Track UI Button.
    Name the Blend Track: Shotgun Projectile Speed.
    Close the Blend Track Editor.
  4. Right Click the Blend Container, then select: New Child > Random Container
  5. Copy & paste the Random Container, so that you have 2 Random Containers.
    Name each one individually:
    > Generic_Fast
    > Generic_Slow
  6. With the Blend Container selected, in the Contents Editor > Assign the Slow, then Fast Random Containers to the Blend Tracks list.
  7. Open the Blend Track Editor again
    Tick the Crossfade box, then click the >> UI Button, then assign the GP_Projectile_Speed Game Parameter.
  8. Then set the following co-ordinates in the graph for the slow and fast impacts.
    Slow 0 > 2000
    Fast 1000 > 3000
    TIP: What these do is tell Wwise what the projectile speed is, then play 1 of either 2 sets of audio assets based on the projectile speed. These speed values are default UE4 project values, which we will expose in the Blueprint later in this guide.
  9. Click on the >> UI Button in the Blends list. Select: Voice Volume.
    On the same line click on the second >> UI Button, then assign the GP_Projectile_Speed Game Parameter.
    Select the Voice Volume line, displaying a red line on the blend track.
    Add a Point marker at 1500
    Then drag the marker to 0.0 voice volume
    Close the Blend Track Editor window.
    – TIP: What this RTPC does is using the game Parameter: GP_Projectile_Speed, slowly reduce the volume of the Blend Container assign content from 1500 or below. 0 = silence.
  10. Drag in associated one-shot light and heavy projectile impact audio assets.
    Place the assets under the File Importer Destination Path: SFX > Weapon > Shotgun
  11. Navigate to the ShareSets tab, under Attenuations > Weapon Work Unit, Right click then select: New Child > Attenuation
    Name it: ATT_WEP_Projectile_Impact
  12. Open the attenuation, then set the following values:
    Change the Max Distance to 2000
    In the Graph, add a point marker to the red line, then move it to the coordinates X = 400, Y = 0
    Right click the red line after the 400 point marker, then select the Logarithmic (Base 3) Curve
    Close the attenuation window
    TIP: If you would like a larger Attenuation for the Heavy Impacts, create a another Attenuation named: ATT_WEP_Projectile_Impact_Fast. Then assign the max distance to e.g. 3000 and a marker marker at e.g. X = 500, Y = 0.0.
  13. Return to the Audio tab, the select the Blend Container.
    In the Positioning tab add the following:
    Tick Override parent.
    Under Listener Relative Routing > 3D Spatialization, change the drop-down to: Position.
    Under Attenuation assign the new ATT_WEP_Projectile_Impact Attenuation
  14. Right click the Blend Container, then select: New Event > Play
  15. Navigate to the Events tab
    Move the Event into the Weapon > WEP_Shotgun Virtual Folder
    Rename the Event to SFX_WEP_SHG_ Projectile_Impact
  16. Save the Wwise Project updates and Generate the sound Banks.
  17. Check the Weapon Sound Banks includes the new Projectile impact content.

STEP 02:
Unreal Hierarchy

Next, we set up Unreal data with the new Wwise associated projectile impact content.

  1. Navigate to the Content Browser > Content > Audio > Wwise_Event > SFX_Weapon > WEP_Shotgun folder
  2. Open the Wwise Picker
    The drag in the SFX_WEP_SHG_Projectile_Impact Event into the Shotgun Folder.
  3. Double click the Event, then assign it to the SB_Weapon Sound Bank.
  4. Save the Event update.
  5. Generate the Unreal Sounds Banks.
    Import the updated Sound Banks

STEP 03:
Unreal BluePrint

Next, we set up the FirstPerson_Projectile Blueprint nodes with the Wwise variables we have implemented.

  1. In the Main Tool bar: select the Blueprint drop-down menu. Then under Open Blueprint Class
    Scroll to the bottom of the list, then select the blueprint: FirstPerson_Projectile.
  2. In the Components tab, right click the Collision Component, then select: Add Event > Add OnComponentHit, adding the new Event to the graph.
  3. Right click the graph, then in the search box type: Branch, select it adding it to the graph
  4. Right click the graph, then in the search box type: Get Velocity, select it adding it to the graph
  5. Right click the graph, then in the search box type: VectorLength, select it adding it to the graph
  6. Right click the graph, then in the search box type: Float > Float, select it adding it to the graph
    In the bottom box change the value to 250
  7. Connect the following nodes together
    > On Component Hit > Branch
    > Get Velocity > VectorLength
    > VectorLength > Float > Float node (top input)
    > Float > Float node > Branch node – Condition input.
  8. Right click the graph, then in the search box type: Set RTPCValue, select it adding it to the graph
    In the Set RTPCValue Node > RTPC box, add the Wwise Game Parameter name: GP_Projectile_Speed. (This must match the Wwise Game Parameter name exactly)
  9. Right click the graph, then in the search box type: Post Event At Location, select it adding it to the graph
    In the Post Event at Location node, AKEvent box, set the Event as: SFX_WEP_SHG_Projectile_Impact.
  10. Then Connect the following nodes:
    > Branch node – True output > Set RTPCValue node
    > Set RTPCValue node > Post Event at Location node
    > Get ActorLocation node > Post Event at Location node – Location input.
    > Vector Length node > Set RTPCValue – Value input.
  11. Mouse drag a box around the nodes we have added, then press C on your keyboard.
    Name the comment box: SFX Projectile Impact & Bounce RTPC Event
  12. Save & Compile the Blueprint

STEP 04:
Test

We can now test the updates in game

  1. Connect Wwise to Unreal
  2. Solo the Projectile Impact Blend Container
  3. Change to the Wwise Layout: Profiler
  4. Filter the capture log by Projectile_Impact
  5. Then play the map, fire the gun at a surface allowing the projectile to bounce off multiple surfaces. You should hear the initial Main hit, then multiple bounces of the projectile as it comes to a stop.
    However, before the projectile comes to a complete stop the event should stop triggering. (avoiding a lot of spam events being triggered at the end of the projectiles life)
  6. Make any balancing changes
  7. Disconnect Wwise to Unreal
  8. Save the Wwise project updates and generate the Sound Banks in Wwise & Unreal
<span>%d</span> bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close