Player Breathing System
A convincing breathing system can play a crucial role in enhancing the player’s experience. It is a great way to provide feedback about the character that can serve both the gameplay and the narrative of a game. In this post, we examine how such a system can be designed in Atom Craft.
In order to control the breath of the character, audio assets with different intensity levels need to be prepared. This implementation includes:
- 4 levels of breathing intensity, from slow to fast.
- Separate inhale and exhale sounds for each intensity level.
- Several variations for each state (they must have almost the same duration to avoid timing disparities).
Once the assets ready, they are imported in the project’s Materials folder.
The basis for the breathing system is the alternance between the inhale and exhale sounds. To achieve this:
- Create a “Breath” Cue of Sequential type and add two tracks for Inhale and Exhale. This will allow us to play them successively.
- On the Cue properties, change the Playback Mode to PlayList, so that the playback continues repeatedly; and set the Voice Behavior to Voice Stop, which will limit the number of concurrent voices.
Then, to manage the intensity of the breathing:
- On both the Inhale and Exhale tracks, create a Polyphonic Sub Sequence.
- Slightly randomize their Volume and Pitch ranges.
- Within each Sub Sequence, create four tracks for each level of intensity.
- Create a new Sub Sequence – this time of type Shuffle – on each of these four tracks.
- Drag and drop your Materials in the Shuffle Sub Sequences, making sure you go through the same process for the Inhale and Exhale parts.
Finally, in order to make the changes in breathing rate sound more natural, markers are added to the Polyphonic Inhale and Exhale Sub Sequences:
- The Shuffle Sub Sequence region for the first level of intensity should be the longest.
- Create Sequence Start and Sequence End Markers at the start and at the end of the region respectively.
- Add these markers to both the Inhale and Exhale Sub Sequences.
By doing so, the End marker is used to restart the playback instead of the end of a region, which makes adjusting the pace of the breathing easier.
The hierarchy of the Cue should look like this:
Now that the Cue is set up, an AISAC is used to switch between the intensity layers.
- First, in the Project Tree, create a new AISAC called “Breath_Control”.
- Then, in the Inhale and Exhale Sub Sequences of the breathing Cue, make the AISAC control the Volume of each of the four intensity tracks.
- Edit the graphs to make them crossfade from Level 1 to 4.
- In our case, since there was too much contrast between the attack of the sounds used in Level 2 and 3, we slightly attenuated the attack of the Level 3 sounds by changing the EG – Attack Time during the crossfade.
It is now possible to seamlessly increase or decrease the intensity of the breathing.
To match the speed of the breathing to the intensity, we will rely on the Sequence Start and Stop Markers we previously added, so that the duration of a breath remains constant independently from the duration of the materials used.
This means that the Playback Rate of the Cue can now be used to adjust the breathing rate. Since this parameter can only quadruple the rate at the most, we will need to apply it twice to reach the maximal breathing speed:
- Both at the Cue and at the Inhale/Exhale Sub Sequences levels, create a Playback Rate graph controlled by the AISAC.
- At the Sub Sequence level, the graph should be a straight line going from 1 to 4.
- At the Cue level, the graph goes from 0.6 to 2.7, with an intermediate point at 1 when the control value reaches 0.075. Note that these values have to be adjusted depending on the duration of your own materials.
- Finally, add a Volume graph at the Cue level to reduce the overall volume at low intensity.
Here is the final hierarchy for the Cue including the AISAC.
You can try the breathing system by dowloading the project below.