Animation Based Footsteps and Foley

Overview

The Character Tool can trigger AnimEvents for Footsteps and Foley which allows the sound to alter on the basis of the character or surface-type while using the same Animation.
The article Applying Audio to Characters Using the Character Tool is prerequisite knowledge for the following tutorial.

By making use of the AnimEvents in CharacterTools you can achieve:

  • Character based Footsteps and Foleys.
  • Animation sync'd Footsteps and Foleys.
  • Material based Footsteps.

Technical Detail

Setting up the Footsteps FXLibs

To enable character based Foleys and Footsteps requires "CharacterSounds" entries inside the Entity Lua script.

The following example is taken from the player.lua which can be found under Game\Scripts\Entities\actor.

footstepEffect = "footstep_player", -- Footstep mfx library to use
remoteFootstepEffect = "footstep", -- Footstep mfx library to use for remote players
bFootstepGearEffect = 0, -- This plays a sound from materialfx
footstepIndGearAudioSignal_Walk = "Player_Footstep_Gear_Walk", -- This directly plays the specified audiosignal on every footstep
footstepIndGearAudioSignal_Run = "Player_Footstep_Gear_Run", -- This directly plays the specified audiosignal on every footstep
foleyEffect = "foley_player", -- Foley signal effect name

footstepEffect

Specifies the Effect Library to use for first person player view

remoteFootstepEffect

Specifies the Effect Library to use for third person player view

bFootstepGearEffect

Specifies whether to play a hard coded gear sound

footstepIndGearAudioSignal_Walk

Specifies an AudioSignal triggered when walking

footstepIndGearAudioSignal_Run

Specifies an AudioSignal triggered when running

foleyEffect

Specifies the Effect Library to use for Foley entries

After specifying the Footstep Effect Library this entry has to be created in the MaterialEffects.xml table under \Game\Libs\MaterialEffects.

The corresponding effect (depending on the material) defines the actual ATL-Trigger to play. This is done in the Effect Library stored under \Game\Libs\MaterialEffects\FXLibs.

As an example: footsteps_player:metal_thick will look up the effect metal_thick in the foosteps_player.xml that is located in the FXLibs.


In this case the ATL-Trigger "Play_c_player_fts" is being played for each material, but with a set ATL-Switch that is based on the SurfaceType - this changes the sound accordingly.

Setting up Footsteps in Character Tool

For correct timing the "Footstep" entry is now required on each animation. This is achieved in the Character Tool and stored in the animevents file.

The following example is taken from Game\Animations\human\human_male\events.animevents.

By doubleclicking on the Timeline it is possible to create a new AnimEvent that will be triggered when the Animation hits the specific point.

For each AnimEvent it is possible to select between different types. In order to trigger Footsteps we are selecting "Footsteps" from the dropdown menu in the Animation Events.
Each AnimEvent can also be mapped to a specific bone. By clicking on the bone icon a dropdown menu with a selectionlist can be opened.

For Footsteps it is particularly important to map any bones correctly, this is because particles can also be triggered via the FXLibs.

Footsteps do take the character_speed ATL-RTPC into account. This parameter offers modification of sound depending i.e. on the game-world speed of the entity.

Setting up Foleys in Character Tool

Character based Foleys do not need to be run through the MaterialEffects.xml table because they are not dependent on the material. However, they require an Effect Library specifying the ATL-Triggers for the different Foley actions inside the foley_player XML under Game\Libs\MaterialEffects\FXLibs.

In order to access the specified FXLib we are selecting the "Foley" from the dropdown menu of the created Animation Event.

In the screenshot example below, the field on the far right is used to define what Foley action ("crouch_off") should be played.

Using the Foley FXLibs can be useful if/when you are using multiple characters, as it allows the sound to be altered on the basis of the character and while using the same Animation.

CVars and Tips

  • Since Footsteps and Foleys are dependent upon the Animation, the collaboration between the Audio and Animation sections of the game development team have to be strong.
  • The data stored in the animevents file does reference the name of the Animation. Therefore, defining a naming convention, animation folder structure and even placeholder animations early in the production cycle helps to stay on top of what will be a huge number of assets.
  • The animevents does work like an XML file so it can be opened with any text editor. This can be helpful through the copy/paste function as well as checking for naming convention and general debugging purposes.
  • Putting Footsteps and Foley entries onto the Locomotion Animations (e.g. _RELAXED) will cover most of the cases covered already. After that the Additive Animations can be populated with Footstep and Foley entries.
  • mfx_DebugVisual = Enables visual debugging for the MaterialEffects system.