Wwise Unreal 2019 – Chapter 04B: Character – Footstep Surface Type

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

Wwise UE4: Chapter 04 B– Character:
Footstep Surface Type

In this guide we will implement player character footsteps to be triggered by Unreal Blueprint nodes and animation timeline tagging.
We add a Wwise Switch so footstep assets can change depending on the surface type the player character moves over.

Please Note:

This is only a suggested process, to help get you started. There are many different & more advanced methods to implement footsteps and a surface type Wwise Switch.
One of the limitations of using the Blueprint suggested in this guide, is that you will lose the ability to hear footstep SFX in the Animation Editor

GUIDE STEPS:

  • STEP 01: Wwise Hierarchy
  • STEP 02: Unreal Hierarchy & Material Association
  • STEP 03: Animation Timeline Tagging
  • STEP 04: Anim BP
  • STEP 05: Test
  • STEP 06: Bug Fixing
  • Further Reading

Download the associated free written guide:
Wwise_Unreal_Chapter_04B_Character_Footstep_Surface Type


Video Guide


Written Guide

STEP 01:
Wwise Hierarchy

In this step we will set up the basic Wwise hierarchy to use a material-based surface type Wwise Switch.
The Surface types we will implement for this guide will be Grass, Gravel, Rock, Water & Wood

  1. Navigate to the Audio tab > Actor-Mixer Hierarchy > Character > CHA_Footstep Actor Mixer.
    NOTE: If you have already implemented a basic random container via this guide series in Chapter 04, delete the Random Container.
  2. Right Click the Actor Mixer, then select: New Child > Switch Container.
    Name it: CHA_FSP_Human.
  3. Right click the Switch Container, then select: New Child > Random Container.
  4. Copy & Paste as many Random Containers needed to match the amount of surface types you will be implementing. We will implement 5 Random Containers for this guide.
    Name each container individually the surface types you wish to use. E.g. Grass, Gravel, Rock, Water & Wood
  5. Drag in one-shot footstep run audio assets to each of the Random Containers matching the assets to the surface types.
    Place the assets under the File Importer > Destination path: SFX > Character > Footsteps.
  6. Next, we create a Wwise Surface Type Switch for the Switch Container to use.
    Navigate to the Game Syncs tab.
    Under the Switches folder, right click the Default Work Unit, then select: New Child > Switch Group
    Name it: SWT_Surface_Type_Anim
  7. Right click the new Switch, then select: New Child > Switch
  8. Copy & paste the Switch so that you have the number of switches needed for the amount of surface types you wish to use. E.g. we will have 5.
  9. Name each Switch individual the different surface type names you are using e.g. PM_Grass, PM_Gravel, PM_Rock, PM_Wood, PM_Water.
    – TIP: Ensure PM_ is prefixed before the surface type name. These naming conventions will reference Physical Materials in UE4 via BluePrint nodes
  10. Return to the Audio tab, CHA_FSP_Human Switch Container.
    In the General Settings tab > Switch > Group, assign the new SWT_Surface_Type_Anim we have just created.
  11. Set the Default Switch / State to any of the surface types that you are using. E.g. PM_Rock
    – TIP: What this does is if a surface type is not passed to Wwise by the game engine, Wwise will Default to the surface type added.
  12. With the Switch Container selected, In the Content Editor drag the corresponding surface type Random Containers on to the associated entries in Assigned Objects list.
  13. Right click the Switch Container, then select: New Event > Play.
  14. Navigate to the Events tab. Find the Event, then drag it into the Character > CHA_Footstep Virtual Folder.
  15. Rename the Event to: SFX_CHA_FSP_Human
    NOTE: if you have followed our guide series up till now (including Chapter 04) you can delete the SFX_CHA_FSP_Footstep Event we previously implemented.
  16. Save the Wwise Project updates & Generate the Sound Banks.
  17. Check the SB_Character Sound Bank, to ensure the new footstep content is included.

STEP 02:
UE4 Hierarchy & Material Association

Next, we update UE4 with the associated Wwise data & we associate the Wwise Switch surface types to Unreal Material, via new Physical Materials.

  1. In the Unreal Toolbar, navigate to: Edit > Project Settings > Engine > Physics > Physical Surface.
    Scroll down the list to the Physical Surface list.
    Add each of the surface types you have set up in Wwise e.g. Grass, Gravel, Rock, Water & Wood
  2. Close the Project Settings window.
  3. In the Content Browsers > Content Folder, right click then select: New Folder
    Name it: Physical_Materials
    Double click to open the new folder.
  4. Right click, then select: Physics > Physical Material
    In the pop-up window select: PhysicalMaterial, then click on the Select UI button
  5. Name the New Physical Material PM_Grass (or one of the surface types you set up in Wwise)
  6. Double click the Physical material to opens its properties.
    Under Physical Properties > Surface type, in the drop-down list assign the associated Surface Type. E.g. Grass
    TIP: The drop-down list can be slow to list all available properties, to the point you may have to close and open the Physical Material a few times or even re-start UE4.
  7. Add further Physical Materials for all the Surface types you wish to implement.
    Assigning the surface type in each new Physical Material.
  8. Save all Physical Materials updated.
  9. Navigate to the Content Browser > Content > Starter Content > Materials folder.
    Open the M_Ground_Grass Material.
    In the Details tab (Left hand side of the screen) under Physical Material > Phys Material, in the drop-down box assign the associated Physical Material. E.g. PM_Grass
  10. Go through all Materials in the folder assigning a PM Surface type most fitting to each material type.
    TIP: Trying to open each one in a new tab, not closing each one. As closing or saving each one takes a while, update all materials. Then close the tab, trigger a consistent save update message in a row for each material type. The first one you update, may take a while to process. Don’t worry if it looks like UE4 has frozen.
  11. Once all Materials have been updated, select all materials. Then right click & select: Save All.
  12. Open the WwisePicker. Then add the new Wwise Event SFX_CHA_FSP_Human to the: Content Browser > Content > Audio > Wwise_Events > SFX_Character > CHA_Footstep folder.
  13. Double click the Event, then assign the Event to the SB_Character Sound Bank.
    Save the Events updates.
    NOTE: If you have followed our previous guide, remove the old redundant event called SFX_CHA_FSP_Footstep. When you try to delete you will be asked to replace the event.
    Replace the markers with the new SFX_CHA_FSP_Human Event (you will need to generate the sound banks beforehand) then you can fully delete the event
  14. Generate the Sound Banks.

STEP 03:
Animation Timeline Tagging

In this step we update the run animation with new footstep AnimNotify timeline Events.

  1. Navigate to the Content Browser > Content > FirstPerson > Animations Folder.
    Open the FirstPerson_AnimBP.
    This is where will add BP nodes to support animation timeline AnimNotify Events.
    First we need to change the animation timeline footstep notify events (that we implemented in Chapter 04A) to a custom Notify events
    As only 1 animation exists using footsteps, we only need to modify 1 animation.
  2. In the top left of the FirstPerson_AnimBP select the Animation option
    Then open the FirstPerson_Run animation.
    NOTE: If you have followed this guide series up till now our implemented Chapter 04A, In the timeline delete any footstep AnimNotify_AKEvents
  3. Right click the timeline, then select Add Notify > New Notify
    Name it: ANIM_SFX_CUS_FSP
    (Animation SFX Custom Footstep)
  4. Copy & Paste the Notify Event then place the 2nd Notify Event half way through the timeline.
  5. Save the animation update.

STEP 04:
Anim BP

We now add new Blueprint nodes allowing the engine to call all surface type parameters we have setup.

  1. Return to the AnimBP Event graph, click on the Blueprint option in the top left of the window.
    In the Event Graph, right click then search for the Event node: Event AnimNotify_Anim_SFX_CUS_FSP, selecting it adds it to the graph
  2. In the My Blueprint tab, under Function, click the + button
    Name it: Get Surface Type
    A new Tab opens with a new function we can build with.
    We will return to this in a bit.
    Return to the Event Graph
  3. In the My Blueprint tab > Functions list, drag the Get Surface Type entry into the graph.
  4. Right click the graph, then in the search box, type: Post Event, then select it, adding it to the graph
    In the Post Event node, > Ak Event, assign the SFX_CHA_FSP_Human Wwise Event
  5. Copy and paste the Try Get Pawn Owner from the nodes in the BP.
  6. Now connect the Nodes as follows:
    > AnimNotify_Footstep > Get_Surface Type,
    > Get Surface Type > Post Event,
    > Try Get Pawn Owner > Post Event – Actor input.
  7. Mouse drag a box around the 4 nodes, then press C on your keyboard. Creating a comment box.
    Name the box: SFX Footstep AnimNotify Event
  8. Next, we set up the Function, Get Surface Type
    Click on the Get Surface Type tab.
  9. Right click the graph, then in the search box, type: LineTraceByChannel, then select it, adding it to the graph
    In the Node tick the Trace Complex tick box
  10. Right click the graph, then in the search box, type: Try Get Pawn Owner, then select it, adding it to the graph
  11. Drag a line from the Try Get Pawn Owner > Return Value output, then search: GetActorLocation, then select it, adding it to the graph
  12. Right click the graph, then in the search box, type: Vector + Vector, then select it, adding it to the graph
    In the node change the bottom Z value to: -100
  13. Connect the following nodes together:
    > Get Surface Type > LineTraceByChannel
    > GetActorLocation > LineTraceByChannel – Start input
    > GetActorLocation > Vector + Vector – top input
    > Vector + Vector > LineTraceByChannel – End Input
  14. Right click the graph, then in the search box, type: Break Hit Result, then select it, adding it to the graph
  15. Right click the graph, then in the search box, type: Set Switch, then select it, adding it to the graph
    In the Set Switch node, name the Switch as SWT_Surface_Type_Anim (This must match the Wwise Switch name)
  16. Right click the graph, then in the search box, type: ReturnNode, then select it, adding it to the graph
  17. Then connect the following nodes together:
    > LineTraceByChannel – Out Hit output > Break Hit Result
    > LineTraceByChannel > Set Switch
    > Set Switch > Return Node
    > Try Get Pawn Owner – Return Value output > Set Switch – Actor input
  18. Finally, we need to convert the path from Break Hit Result node to the Set Switch node
    Drag a line from the Set Switch > Switch State input, then search: String To Name, then select it, adding it to the graph
  19. Drag a line from the String To Name node, then search: ToString (Object), then select it, adding it to the graph
  20. Drag a line from the ToString (Object) to the Break Hit Result – Phys Mat Output.
  21. Drag a box around all nodes, then press C on your keyboard.
    Name the comments box: SFX Surface type PM reference
  22. Save & Compile the AnimBP updates.

STEP 05:
Test

We can now test our updates in game.

  1. Load the map that you are working with.
  2. Connect Wwise to UE4,
  3. Then change to the Wwise Layout: Profiler.
    Filter the Profiler log by the footstep content
  4. Solo the Associated footstep content in Wwise.
  5. Now move the player character around the map, moving over different floor surface types.
    You should hear different footstep audio assets being triggered depending on the surface types the player character moves over.
  6. Make any balancing changes you wish to add.
  7. Disconnect Wwise to Unreal
  8. Save the Wwise Project updates and Generate the Wwise Sound Banks.
  9. Lastly, Generate the UE4 Sound Banks.

This guide hopefully gives you an insight not just to Footstep implementation but an idea of how to implement Wwise Switches.

STEP 06:
Bug Fixing

Due to a lot of oddities, random bugs or simply odd processing issues with surface types you may encounter some bugs.
The landscape terrain, can cause quite a few issues.
Ensure you have applied the following changes to landscape tile:
* Details panel > Landscape > Default Phys Material = the main default material you wish to you for all of your landscape
* Details panel > Collision > Generate Overlap Events check box is ticked.
Even with these suggestions, false positives can be experienced.
If you are still having issues with surface types on the base landscape tiles,
a hacky solution would be to add boxes just above the base landscape terrain. Then add the needed Material to each box. This should help all surface type to work across the landscape.
A suggestion for boxes is to use the Architecture wall tile 500×500, as textures do not stretch on these larger boxes. However, you may end up with loads of visible lines on the map of each boxes area.

Further Reading

There is  great Wwise blog dedicated to more advanced Wwise + unreal (and Unity) surface types for footstep content.
please see this Wwise blog, when you feel a bit more comfortable with Blueprints
https://blog.audiokinetic.com/-unity-3d/
Check the blog comments for first person Changes needed

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close