The Link :

Breath System in Wwise & UE5 (Part 1)

One of the feature I’m the most happy with in The Link is SH-1 (the player character) breath system.

The goal of this system is in the same time to be a diegetic manner to feedback the character health status with sound and to create tension for the player when his/her character may not be far from death.

This video shows the different kind of breath and the transition between them :

I built this system on following game parameters :

  • The distance between the creature and our character
  • Her level of toxicity (related to the filters she has to carry on allowing her to stay in life). This parameter also allow heartbeat and a tinnitus to be heard when the toxicity level is high
  • Her level of fatigue (which is more an instant feedback of the action she is doing).

* PC stands for Player Character (I generally use this abbreviation when I start to build player character’s systems but I don’t have its name yet).

** GPP_ is the abbreviation I use for Game Parameter Programing : Those are game parameters that will need to be hooked by myself or a programmer in the game and that are not internal to a system in Wwise (I use GPI_ when its the case)

I used blend containers to make smooth transitions between different type of breath. I initially went for the same option for the container at top of hierarchy but I couldn’t make it work in the game and I’m still searching why it was not working same than others. As I had to find a solution to make it work I went for a switch container (the problem with the switch is that it’s hard to make a smooth transition with sounds that are continuous as the switch is instantaneous when activated).

  • At the lower level of the hierarchy, each random container contains 12 samples of breath corresponding to the kind of breath SH-1 do when she is idling, walking or running. Those are set up on continuous play mode, infinite looping mode and the next sample is waiting the end of the one which is playing because of the sample accurate transition mode.
  • Then, the blend container « Healthy » allows the transition between them depending of GPP_PCFatigueLevel which is linked to a « fatigue score » calculated in UE5, every move add fatigue points to the score every second and to idle slowly reset it.

This game parameter has an interpolation time (slew rate) which allow to slow down the transition between one value to the other in order to mimic how a breath would evolve in the real world : there is always a latency between the moment we start running and the moment our breathing frequency and intensity increases… The reverse is also true when we stop the effort).

  • « No Enemy » blend container allow the evolution from healthy breath to unhealthy ones depending of the GPP_PCToxicityLevel. The toxicity level is updated differently according to the number of filter Sh-1 posses. While she has all of her 3 filters, the toxicity level stay the same but if she starts to loose some (in order to use them to attract the creature for example), this level start to grow and she becomes unhealthy. GPP_FatigueLevel is then working the same way than before but playing unhealthy breath sounds. There is also a voice volume automation depending of the toxicity level helping to bring at the top of the mix while the toxicity level is growing.
  • The top level switch container is switching between breath styles depending of the distance between the character and ennemies (in our game, the creature) :
    • When there isn’t enemies, the system runs as described earlier.
    • When there is enemies in a radius of 5 to 14 meters around the character, we can hear stressed and appealed breaths with a higher voice volume.
    • When there is enemies in a radius of less than 5 meters, the character is trying to hide its breath while she’s hidding, we can hear discrete stressed breaths with a lower voice volume.

To link a switch container to a game parameter (here GPP_CreatureDistanceFromPC) you can tick the little box that appear at the top of the contents editor when clicking on a switch group. This allow to bind switches with a game parameter value. This is nice because you don’t have to set switches in Unreal or any other game engine and can set up multiple different switch containers with only one game parameter.

The whole system has just to be post as one single event in the game (at its start) to work and be heard. I decided to manage it like most of the event supposed to run at start and follow the character position : launch it inside of the character blueprint with the Unreal Begin Play event. This allows every of those event to be posted when the character blueprint is used in the game (which was right at the start for us).

Finally in order to be sure to never hear two breath sounds in the same time I used the wwise advanced settings to limit sounds instances occuring in the same time to 1. With this the system discard any new instance that could play in the same time than an instance which is already playing.

The kill voice setting allow to simply kill the newest instance… (in another context it can be used to keep a discarded event in a virtual voice to play it right after the first instance stop.)

I hope you enjoyed to read this article, this is the first one I have ever written and I’ll try to write about other feature I implement in the games I work on soon !

Do not hesitate to ask a question or to tell me if something make you feel like it is still blurry ! I’ll answer as soon as I can…

EDIT : After i wrote this article I figured that there was a more optimized way to implement this system in wwise, saving voices mainly, thanks to a « hidden »  switch container feature… Follow this link to read the update : The Link : Wwise & UE5 Breath System Part 2