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:
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.
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.
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.