The Character Tool can trigger Animation Events 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 Audio & Character Tool is prerequisite knowledge for the following tutorial.
By making use of the Animation Events in CharacterTools you can achieve:
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 folder>\GameSDK\Assets
and in this *.pak,
in 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 folder>\Assets\gamedata.pak.
Within this *.pak file, the MaterialEffects.xml file can be found in
Libs\MaterialEffects
.
The MaterialEffects files are within the gamedata.pak.
MaterialEffects.xml opened in Excel
The corresponding effect (depending on the material) defines the actual audio system Trigger to play. This is done in the Effect Library stored under<
k and within this *.pak file, in Game folder>\Assets
\gamedata.paLibs\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.
Pic2: Footsteps_player.xml
In this case of the audio system Trigger "Play_c_player_fts" is being played for each material, but with a set audio system Switch that is based on the SurfaceType - this changes the sound accordingly.
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 <
and within this*.pak file, in Game folder>
\Animations.pakanimations\human\male\events.animevents
.
By double-clicking on the Timeline it is possible to create a new Animation Event that will be triggered when the animation hits the specific point.
For each Animation Event it is possible to select between different types. In order to trigger Footsteps we select "footstep" from the dropdown menu in the Animation Events.
Each Animation Event 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.
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 audio system triggers for the different Foley actions inside the foley_player XML under <Game folder>\Assets\gamedata.pak
and within this *.pak file, in Libs\MaterialEffects\FXLibs
.
Character-based Foleys in foley_player.xml
In order to access the specified FXLib we select 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 which 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.