top of page

Demonstrating character sounds triggered through anim notifies and surface dependant footsteps

Animation Notify

Most of all character sounds throughout the game are triggered using a custom Animation Notify by overriding the function Notify displayed below. This is a good way of synching audio to animation and can make the sound sets become more modular.

Footsteps & surfaces

This eating sequence, for instance, consists of individual notifies for breathing in, breathing out, biting into meat, chewing on meat and swallowing.

AnimNotify.gif

The code implementation for the notify is using a class called DinoSoundComponent, which is basically just a class responsible for calling the interface functions PlaySound and StopSound in the manager class, as well as a place to store the sound set data asset it self.

Footsteps & Surfaces

There is a special case for when playing footstep sounds, which are surface dependent, meaning that a grassy footstep sound will play if you step on grass, a watery sound if you step in water and so on.

This functionality is implemented with a simple line trace downwards and finding out what surface was associated with a hit (if there was a hit). The ground in the game is utilizing physical material assets which store their individual surface type, and the DinoSoundComponent in turn holds a collection of sounds per surface.

Event delegates

While animation notifies are a great way to synchronize audio to visual movement, not all audio has a designated movement tied to it. In these cases an event subscription approach with built in delegates and callback functions are used.

In the example below, a certain sound is supposed to start if you capture a new Zone in the game. In order to get notice about this we "subscribe" to the delegate OnTakeZone, which will BroadCast back to our callback function once a zone is taken.

Note: UPlayerSoundComponent is a subclass of DinoSoundComponent in this case, and calls the interface function PlaySound in the USoundManager class.

bottom of page