Lesson 3

Table of Contents

Using Switches

In Cube, our Wwizard does a lot of running around; chasing the monsters, or in some cases, running from them. But as with most first person player perspective games, you never actually see his feet. Does this mean he doesn’t have any? Of course not! It’s the audio department's job to help convince the player that our player is actually attached to the ground and not just floating through the game. This can be done by attaching footsteps to the player’s movements.

To achieve this, you need to have the game communicate information to Wwise about when the player moves. This can be done using simple event-type game calls, but achieved using various methods. One approach would be to send a game call when the player starts to move, with another game call indicating when the player stops. In the case of Cube, each footstep the player takes is transmitted as an Event. If no footstep Events are transmitted, then the player isn’t moving.

You can attach a single footstep sound to the footstep Event, but it would be highly recommended that you provide multiple footstep sounds and randomly pick one each time the player moves so that they don’t become annoyingly repetitive. All of this can be achieved building on the information learned in the last two lessons, but something else you have to consider is what surface is the player walking on. In Cube, the Wwizard moves around and is sometimes walking on concrete, dirt, metal and more. It’s likely that a player would notice if they hear the sound of shoes on gravel, when the player is clearly walking on a stone floor, creating an undesired distraction and annoyance. To accommodate the change in surface, Wwise allows you to create a particular parameter, define options within that parameter, and then use that information to affect change to the sound in a game.

To understand the components involved in creating a switching system, let’s look at another example where you're working on a game and want to have a player turn on a radio, and that radio has three preset buttons each with a different type of music. Setting this up is a three step process. First, you define a parameter with a Switch Group object, then define options within that parameter using Switch objects, and finally assign which sounds you want to hear using a Switch Container object. The Switch Group object could be called Radio. Within that Switch Group, you would create three Switch objects called Preset 1, Preset 2 and Preset 3. Finally, using a Switch Container, you’ll decide which audio files you want to hear based on which preset is currently selected; for example, Preset 1 would play Rock, Preset 2 would play Jazz, and Preset 3 would play Classical.

Now let's use this idea to create a switching system for the Wwizard's footsteps.

Was this page helpful?