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.
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
- 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:
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
- 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.
- Right Click the Actor Mixer, then select: New Child > Switch Container.
Name it: CHA_FSP_Human.
- Right click the Switch Container, then select: New Child > Random Container.
- 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
- 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.
- 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
- Right click the new Switch, then select: New Child > Switch
- 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.
- 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
- 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.
- 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.
- 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.
- Right click the Switch Container, then select: New Event > Play.
- Navigate to the Events tab. Find the Event, then drag it into the Character > CHA_Footstep Virtual Folder.
- 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.
- Save the Wwise Project updates & Generate the Sound Banks.
- Check the SB_Character Sound Bank, to ensure the new footstep content is included.
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.
- 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
- Close the Project Settings window.
- In the Content Browsers > Content Folder, right click then select: New Folder
Name it: Physical_Materials
Double click to open the new folder.
- Right click, then select: Physics > Physical Material
In the pop-up window select: PhysicalMaterial, then click on the Select UI button
- Name the New Physical Material PM_Grass (or one of the surface types you set up in Wwise)
- 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.
- Add further Physical Materials for all the Surface types you wish to implement.
Assigning the surface type in each new Physical Material.
- Save all Physical Materials updated.
- 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
- 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.
- Once all Materials have been updated, select all materials. Then right click & select: Save All.
- 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.
- 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
- Generate the Sound Banks.
Animation Timeline Tagging
In this step we update the run animation with new footstep AnimNotify timeline Events.
- 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.
- 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
- Right click the timeline, then select Add Notify > New Notify
Name it: ANIM_SFX_CUS_FSP
(Animation SFX Custom Footstep)
- Copy & Paste the Notify Event then place the 2nd Notify Event half way through the timeline.
- Save the animation update.
We now add new Blueprint nodes allowing the engine to call all surface type parameters we have setup.
- 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
- 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
- In the My Blueprint tab > Functions list, drag the Get Surface Type entry into the graph.
- 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
- Copy and paste the Try Get Pawn Owner from the nodes in the BP.
- Now connect the Nodes as follows:
> AnimNotify_Footstep > Get_Surface Type,
> Get Surface Type > Post Event,
> Try Get Pawn Owner > Post Event – Actor input.
- 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
- Next, we set up the Function, Get Surface Type
Click on the Get Surface Type tab.
- 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
- Right click the graph, then in the search box, type: Try Get Pawn Owner, then select it, adding it to the graph
- Drag a line from the Try Get Pawn Owner > Return Value output, then search: GetActorLocation, then select it, adding it to the graph
- 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
- Connect the following nodes together:
> Get Surface Type > LineTraceByChannel
> GetActorLocation > LineTraceByChannel – Start input
> GetActorLocation > Vector + Vector – top input
> Vector + Vector > LineTraceByChannel – End Input
- Right click the graph, then in the search box, type: Break Hit Result, then select it, adding it to the graph
- 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)
- Right click the graph, then in the search box, type: ReturnNode, then select it, adding it to the graph
- 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
- 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
- Drag a line from the String To Name node, then search: ToString (Object), then select it, adding it to the graph
- Drag a line from the ToString (Object) to the Break Hit Result – Phys Mat Output.
- Drag a box around all nodes, then press C on your keyboard.
Name the comments box: SFX Surface type PM reference
- Save & Compile the AnimBP updates.
We can now test our updates in game.
- Load the map that you are working with.
- Connect Wwise to UE4,
- Then change to the Wwise Layout: Profiler.
Filter the Profiler log by the footstep content
- Solo the Associated footstep content in Wwise.
- 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.
- Make any balancing changes you wish to add.
- Disconnect Wwise to Unreal
- Save the Wwise Project updates and Generate the Wwise Sound Banks.
- 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.
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.
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
Check the blog comments for first person Changes needed