8.4 Processor Optimization


8.4) Processor Optimization



In gameplay, 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. This is why 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 course, 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 games, 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 ambient sounds quickly add up the Voice Count. The fact is that a lot of these sounds are not important to hear. The bad guys walking 100 meters away might have footsteps quietly playing the distance, but they are not likely to be heard when there are ten 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, your project has settings that define a minimum volume that the sound would need to actually render the sound through a Voice.

Pic01 Project Settings

Pic02 Volume Threshold and Max Voice Instances

Pic03 Advanced Settings

Pic04 Limit Sound Instances

Pic05 Playback Priority

  1. In the Main Menu, choose Project, Project Settings and select the General Tab. (Pic01 Project Settings)

    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 dBFS. This means that there’s 80 dBFS 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, the Max Voice Instances. 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 weapon, effectively taking you out of the experience. Don’t worry, you’ll learn how to prioritize Voices later.

  2. Change the Volume Threshold for your system to -50 dBFS, and set the Max Voice Instances to 60, and click OK. (Pic02 Volume Threshold and Max Voice Instances)

  3. Go back to the Designer Layout, select the Atmo Actor-Mixer and in the Property Editor click the Advanced Settings Tab. Because there are lots of different sound elements in the atmo for the Platformer Game, the car horns, high heels and dog barking sounds, which consume a higher number of Voices per Object, it makes sense to limit the Voices that are being played back simultaneously. (Pic03 Advanced Settings)

    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 or Actor, meaning that in the example of a shooter game, 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.

  4. Select the Limit sound instances to check box, set the instance value to 25, and select Globally from the pull-down menu. (Pic04 Limit Sound Instances)

    There are some sounds that you want to make sure never get killed regardless of what is happening in the game. These could be the stereo beds for the general ambience. 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. In this case, you’ll protect the stereo beds by giving them a high Voice Priority number.

  5. Choose the Shopping Random Container and change its Priority value to 80. Repeat the same for the Traffic and Wind Random Containers. Now it’s nearly impossible for the stereo beds of the general ambience to ever be inadvertently turned off during gameplay. (Pic05 Playback Priority)

    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 Audio 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 Wwise Audio 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.