3.4) Attenuations ShareSets
You now managed to match an Emitter’s position to the Game Object’s or Actor’s position and orientation related to the Listeners within the game. Great! But one thing is still missing. As the Player Character is passing by an Emitter, the sounds Volume stays the same. As everyone knows from real life, sound should get quieter as a Listener moves further away from an Emitter. This behavior is handled by so called Attenuation ShareSets. Such a ShareSet can define the Attenuation for an Emitter and as the name implies can be shared across various Wwise Objects.
Open the ShareSets Tab in the Project Explorer.
You see a variety of ShareSet Work Units that are divided into different folders based on their type.
With your Default Work Unit selected, click the Create new Attenuation icon. (Pic01 Create an Attenuation Shareset)
If you think about it, the physics of an environment affects all types of sounds equally, so in most cases, you’ll create only very few Attenuation ShareSets, that can be used for a majority of the sounds used in the game.
Name the Attenuation Object Attenuation_FxExplosions.
Now let’s assign the Attenuation ShareSet to the explosions.
Attenuation Curves can be applied to Wwise Objects in the Actor-Mixer Hierarchy (and also the Interactive-Music Hierarchy) using the Property Editor’s Positioning Tab. To explore how Attenuation Curves work, you’re going to add the newly created Attenuation to the explosions Actor-Mixer. (Pic02 Attenuation Assignment)
How close would you need to be before you hear it? How fast should the Volume get quieter as the Player Character or the Scene Camera moves away? At what distance between the Emitter and the Listener should the sound be so quiet, that it becomes unnoticeable? Attenuations are typically used to simulate the natural weakening of an Emitter’s signal as it moves away from the Listener. Wwise uses a series of Curves to map Wwise Property values, such as Volume and Filters, to specific Distance values. With these Curves, you can create a sophisticated distance-based roll-off for your sound (and music Objects). These are one of many things that Attenuation Curves address and a Technical Sound Designer should think about.
Next to the Attenuation, click Edit.
There are seven different Attenuation Curves, each displayed in a different color. You are not going to use all of them in this course, but some most important ones. You can however look for them in the Audiokinetic Wwise Documentation for your version of the Wwise Audio Engine. In this scenario, the distance between the Game Object emitting the sound and the Listener will determine the Volume. The Distance value is displayed on the x axis of the graph in Game Units defined by the game engine. Wwise determines this distance by comparing the x, y and z coordinates, as well as other information to indicate the direction the Game Object is facing of both the Emitter and the Listener relative to one another at the moment a sound occurs.
The most obvious change to a sound as its Emitter gets further away is that it gets quieter. The Volume change is displayed on the y axis of the graph in dBFS. So, by default, the current Curve is affecting Volume linearly, as indicated by the red diagonal line in the graph view. (Pic03 Volume Curve)
To properly adjust an Attenuation Curve, you need to understand the meaning of the games Distance Units make appropriate decisions. A Distance Unit is defined by the game itself and is pre-determined in the initial phases of the game’s development. For example, for a game about being an ant, the Distance Unit may be a millimeter, while for a game about intergalactic space travel, the Distance Dnit might be in light years.
The X axis of the graph represents Distance, and the amount of Distance represented on the graph can cover any range by modifying the Max distance Property.
Change the Max Distance Property to 15000 and press Enter. (Pic04 Max Distance)
Currently the Attenuation Curve shows that the sound gets quieter as the distance increases. You can audition how this change in distance affects the sound by dragging the Distance parameter cursor left and right as you play the sound. (Pic05 Previewing an Attenuation) As with every Curve in Wwise, the shape of the Attenuation Curve can be modified. This can be done either by double-clicking on any point of the red line and creating a new node, which can than be used to adjust values, or by right-clicking along the red line and choose a pre-defined Curve based on a mathematical function.
Change the linear function for the Attenuation Curve to a logarithmic function, since this best reflects the natural weakening of sound in real life. (Pic06 Curve Functions)
In a game it isn’t really necessary to create a “realistic” Attenuation, since the laws of physic could be completely turned upside down in the game world, but in this instance let’s settle for a logarithmic function.
Generate the Sfx SoundBank and save your project. Then play and listen to the Attenuation ShareSet you just created for the explosions.
Sounds pretty good, doesn’t it? Feel free to change the Shareset later on, for now let’s create a new Curve for the Low-pass Filter. After Volume, one of the most important changes to a sound as it travels through the air is that high frequencies are diminished over distance and the sound gets more and more muffled. This can be achieved by mapping the Distance Property to the Curve for the Low-pass Filter.
In the Curves area, select the Low-pass Filter and set its Curve type to Custom.
Hold Ctrl and select the Output Bus Volume Curve to display both Curves and experiment with how the change impacts the sound. In some cases, after you get the shape of the Curve just right, you may find that you want to adjust the overall scale of the Curve to be different. This can easily be changed without having to re-create your curves. The same principle can be applied to the High-pass Filter. (Pic07 Low-pass Filter)
Now select the Spread Property and set its Curve type to Custom.
You will now see a green line going from a Spread value of 100 at Distance 0 all the way to Spread 0 at Max Distance. (Pic08 Spread Curve) What does this do? With Spread you can determine, at what distance a multichannel sound file should be downmixed to mono. But why is this useful? Let’s look at one of the actual sound files of the explosions in the Source Editor. (Pic09 Source Editor)
As you can clearly see, it is a stereo therefore multichannel sound file with two channels. This means at a Spread value of 100, the sound is being played back as a stereo file. This is good at close distance between the Emitter and the Player Character or the Scene Camera, because a stereo file allows the explosion to be perceived spatially bigger due to subtle movement of the Audio Signal between the left and right channel. At close range this is most always what you want. Now, as in real life, the further the distance between the Emitter and the Listener the more an Emitter is being perceived as a point source. This makes sense if you compare it to your visual perception, because the further the distance between an Object and the human eye, the smaller the Object is being perceived. If the Object, in your case a Game Object within the scene is at great distance from the Player Character or the Scene Camera looking like a point, how could its sound be super wide? Therefore you have to set Spread to 0 at a certain distance so that the visual and acoustical perception match one another and the channels of the multichannel sound file get downmixed all the way to mono. (Pic10 adjusted Spread Curve)
Last but not least, let’s look at the Cone Attenuation Property. Click the checkbox to activate it.
Accounting for how sound changes over distance is important, but what about how sound changes when the source of that sound doesn’t move any further away, but instead turns away. For example, imagine that you’re listening to the sound of a trumpet, where the trumpet player is directly facing you at a distance of 3 meters. If that trumpet player now spun 180º so that their back is facing you, would it sound the same? Because the bulk of the trumpet’s energy is projected forward, and the listener is behind, the sound would be perceived as quieter and more muffled. To account for these changes in a sound sources direction, Wwise offers Cone Attenuation. (Pic11 Cone Attenuation)
The Attenuation Preview is designed to give you a visual representation as well as a way to simulate the relationship between an Emitter and the Listener. It’s natural to think that the graphic for the Cone Attenuation puts the Listener in the center of the circle, with the red dot representing the emitter; however, it’s just the opposite. As a whole, the diagram represents how the sound emitting Object in the game will project its sound into the world with that sound source positioned at the center of the circle. The position of the Listener is defined by the red dot. (Pic12 Listener Position Preview)
Try out different values and move the red dot for the Listener, so you get a picture of what the explosion sounds like if the listener is on the side or behind it.
Of course, this makes no sense for an explosion, since it doesn’t have such a narrow directivity like the before mentioned trumpet. There are of course lots of situations in a game where a Cone Attenuation is crucial for an Emitter, but you can leave it unchecked for your Platformer Game, since this game is a much more stylized game with less focus on hyperrealistic sound propagation.
Different games and most of all different genres of games handle Attenuations completely different. It is not solely up to the taste of the Sound Designers, but ultimately up to the gameplay and how players choices are affected by it.