Table of Contents
In game play, every time a sound is to be played, a small amount of processing power is required from the game system’s CPU. While audio puts a relatively small load on the processor, consider that the processor must be shared with other aspects of the game such as 3D graphics rendering that can put tremendous stress on the system. For this reason, you need to be aware of how to maximize the audio engine’s use of the processor and not waste processing cycles unnecessarily.
Every sound played in game requires something called a voice through which it is played. Do not confuse this with the Voice object mentioned earlier in this lesson that is used with dialogue. In this case, you can think of a voice as the logical mechanism that produces the sound in the game. Every active voice uses processor cycles.
In some games, especially 3D world games like Cube, voice counts can quickly add up. If you have your character firing a weapon at 30 bad guys who are all firing their weapons back simultaneously, these sounds, plus the sound of all of their footsteps and all of the other background ambient sounds, can quickly add up the voice count. The fact is that a lot of those sounds are not important to hear. The bad guys walking 100 meters away might have footsteps quietly playing the distance, but those are not likely to be heard when there are ten other bad guys two meters away firing their weapons. The distant footstep takes just as much processing power to play as the gun being fired two meters away, so to render sounds that are unlikely to be noticed is a waste of processing. To minimize this waste, your project has settings that define a minimum volume that the sound would need to actually render the sound through a voice.
In the main menu, choose Project Settings and select the General tab.
You can see settings can be configured differently depending on the game system that you are developing for. For example, a Wii U has considerably less processing power than a PlayStation 4, so you adjust these values separately for each game system. The default setting for Volume Threshold is -80, which is a value in decibels. This means that there’s 80 dB of dynamic range in the game. If you wanted to relax the load on game system’s processor, you could reduce the dynamic range by changing the Volume Threshold to a higher number, but be aware that if you do this, there is a risk that some sound that you want to hear, such as subtle ambience may end up getting cut off.
There is also another parameter that defines the maximum number of voices that are allowed to play through the system at any one time. This prevents overloading the system altogether. Lowering this parameter ensures that the audio engine will require less processing on the CPU, but again it means that some sounds you want to hear may get cut off, especially in the heat of battle when there’s lots of action going on. Nothing is worse than when the game is at its most intense level, and you lose the sound of your main weapon, effectively taking you out of the experience. Don’t worry, you’ll learn how to prioritize voices later in this exercise.
Change the Volume Threshold for your system to -50, and set the Max Voice Instances to 40, and click OK.
Some sounds by nature can be real voice hogs. In Cube, some of the weapons like the chain gun can quickly create a lot of voices as the sounds of each shot overlap each other due to the rapid fire nature of the gun. To help manage this, it’s possible to manage how many voices any one object might take at any one point in the game.
Go back to the Designer layout and, in the Project Explorer, select the Weapons Actor-Mixer and, in the Property Editor, click the Advanced Settings tab.
The Playback Limit area allows you to set the total number of voices that can be used. You can set this so that the limit number applies to each game object, meaning that each character would have 50 voices available for their particular weapon, or it can be set globally, meaning that no more than 50 weapon sounds of any one type would be heard at the same time. The latter can be quite useful, as it is unlikely that the player would be able to distinguish much more than a few handfuls of sounds of the same type played at the same time.
Select the Limit sound instances to check box, set the instance value to 25, and select Globally from the pull-down menu.
There are some sounds that you want to make sure never get killed regardless of what is happening in the game. To accommodate this, Wwise has a voice prioritization system where you can rank types of sounds according to how important it is to hear them in the game. This way, when the game system must kill voices, it doesn’t silence the sounds that truly need to be heard.
A good example of a sound you wouldn’t want to unexpectedly turn off would be things like player dialogue or music. In this case, you’ll protect the music object by giving it a high voice priority number.
Choose the Cube Main Theme object and change its Priority value to 80.
Now it’s nearly impossible for the music to ever be inadvertently turned off during game play.
The Offset priority check box and setting specifies a value by which the priority of an object is offset when it reaches the max distance value specified in the Attenuation Editor. This is helpful for prioritizing objects such as footsteps that need priority when they are close to the listener, but are less important when they are far away.
Also in the advanced settings is the Virtual Voice area. Virtual voices represent sounds that would normally play, but they are instead added to the virtual voice list because their volumes are lower than the Volume Threshold set for the platform. The virtual voice list is a virtual environment where certain parameters of a sound are monitored by the sound engine. Sounds may move from the audible–physical voice to the silent–virtual voice and vice versa based on their volume levels. If the volume returns above the Volume Threshold or the number of playing sounds goes under the limit of simultaneous playing sounds, the objects automatically move back into the physical voice.