Wind System
Weather sound effects such as rain or wind are an integral part of world-building. In many games, they can even have a gameplay dimension. In this post, we will see how to create a system to dynamically control the power of the wind in AtomCraft.
Assets creation
This implementation requires wind and leaves’ rustle sounds at different intensities. If you do not have an extensive collection of recordings captured under similar circumstances, using procedural audio to generate these sounds is very convenient. Since it comes with dedicated weather generators, we chose GameSynth to create the assets of the example project. Thanks to its MetaParameter system, we were able to automatically generate variations following the intensity of the wind/rustle, which made the process much easier.
- For both wind and leaves sounds, create 4 or 5 variations of increasing intensity.
- Make each variation loop seamlessly.
- Name the sounds so they can easily be sorted from the softer to the stronger variation.
Once ready, drag and drop all the assets in your Materials folder and change their Override Loop information Flag to True.
Implementation
The first steps are similar for both types of sounds:
- Create two Polyphonic Cues, “Wind” and “Leaves”.
- From the Materials folder, drag & drop the Materials on their respective Cue to automatically create the tracks.
- For both Cues, set the Voice Behavior property to Virtual Voice Retrigger.
Of course, if you trigger a Cue at this point, all its tracks will play simultaneously. Therefore, we need to crossfade between them to create a progression in the intensity. We will use the AISAC system to achieve this.
- In the Project Tree, create two AISAC-Controls: “WindPower” and “TreeDensity”.
- Under each track of both Cues, set the WindPower AISAC to control the track’s Volume.
- Create crossfades between each track to make the intensity of the sound grow as the value of the AISAC increases.
More control is also added at the Cue level. First, for the Wind Cue:
- At the root of the Wind Cue, add Volume and Bandpass – Cutoff Low graphs controlled by the WindPower AISAC.
- Decrease the Volume to 0.8 at the origin of the graph.
- For the Cutoff Low, start by quickly decreasing its value on the first fifth of the curve from 0.75 to 0.15. Then fade it out progressively to 0 until the end.
Then, for the Leaves Cue:
- Add the same graphs: Volume and Bandpass – Cutoff Low at the root. This time, they should be controlled by the TreeDensity AISAC.
- The Volume graph is a simple fade-in while the Cutoff Low is decreasing from 0.85 to 0.
It is now possible to control the amount of wind in your game! If your character is in an area with trees, use the Tree Density to add some rustling to the soundscape. Of course the stronger the wind, the louder the sound of the leaves will be.
You can test this implementation by downloading the Atom Craft project below.