1.4) Events and Actions
For everything that happens in the game that may need an audio response, the Audio Programmer has added lines of code to transmit a message informing Wwise about what has occurred. This message is referred to as a Game Call. Game Calls are just simple messages that say things like “Hey, the shotgun was fired”, but in reality this message is sent as a string of text or numbers. When this message is received by the Wwise Audio Engine, any number of things can happen as defined by you, the Technical Sound Designer.
The first thing that you usually need to do is to create an Event, so that Wwise can catch an incoming Game Call. Think of it like a game of catch between the game engine and the audio engine. The ball being thrown from the game engine is the Game Call, while an Event is a type of Object within Wwise designed specifically to catch Game Calls. The important thing to note is that each Game Call needs an identically named Event to be received by Wwise.
In the Project Explorer View of the Designer Layout, click the Events Tab right next to the Audio Tab. (Pic01 Events Tab)
It’s in the Events Tab where you’re going to allow Wwise to understand the incoming Event Game Calls, that Wwise should expect to see transmitted from the game engine. Within the Events Tab you see a folder titled Events and within that folder there is an Object called Default Work Unit. Work Units serve as the foundation for Wwise. Work Units contain information related to particular sections or elements within your project and help you organize it.
In many games, many people or even companies are concurrently working on different parts of a game. For example, one team may be working on all of the weapon sounds while another focuses on ambient sounds. In this scenario, each team could have its own copy of Wwise and create their unique Work Units that houses their assigned Events. Later in the production, multiple Work Units can be brought into a single project in order to bring all of the different sound elements in a game together.
Work Units are actually simple XML files created within the project structure of Wwise.
Anything you create in Wwise is referred to as an Object. Be careful not to confuse this with the Game Object term which relates to items within the game that play back sound sent from the sound engine. Objects in the Wwise interface are represented by small square icons. There are over 20 types of Objects, each providing unique functionality for how you can create and control sound within the Wwise Audio Engine. Objects exist within a Hierarchy and typically Work Units are at the top of this Hierarchy. Like the bricks that make up a building, these Objects are building blocks that can be used for purely practical applications, or they can be arranged in intricate and creative ways.
Click the Default Work Unit within the Events folder and notice the Event icon. (Pic02 Event Icon)
If the icon is being clicked, a new Event Object is created and you are prompted to type its name. How you name an Event Object is critical. It is imperative that the name of the Event Object perfectly matches that name of the Game Call being transmitted from the game engine. Just like dialing a phone number, if you’re off at one number, it won’t connect.
To ensure that this works well, typically the Technical Sound Designer decides what kinds of things the sound engine needs to be aware of and creates the Events for each of these things in Wwise. The Technical Sound Designer then informs the Audio Programmer of the Events’ names so that he/she can program the game engine to transmit Game Calls with the same name. In this scenario, the Platformer Game has all Events implemented, so there is no need to create a new Event. You can see all implemented Events in the Default Work Unit, nicely organised into Virtual Folders. There is however not a single Event linked to a Wwise Object, which is what you are doing next. (Pic03 Implemented Events)
Selecting an Object reveals its associated Properties in the Event Editor to the right. Different Objects have different Editors of varying complexity. Most have a Notes field that is incredibly important because you can add extra information to avoid any confusion about the Event name. With a name like Fire_Shotgun_Player, the Event likely relates to the shotgun being fired, but not all Events are intuitively named. Notes provide a way to provide more information to help you and others who might be reviewing your work better understand what you’ve created.
Let’s now link the footstep sound to an Event. This is done via an Action defined for this footstep Event.
Click the playFoleyFootstep Event in the Robot > Foley folder of the Events Tab.
The Event Editor to the right is displayed showing the Event’s name and its Event ID, with two empty panes below. This is where you indicate what Action you want to happen whenever Wwise receives the playFoleyFootstep Event from the game engine. (Pic04 Event Editor)
Click the Add >> button found in the lower left of the Editor.
A list of possible Actions is displayed. As you can see, there are a lot of options, but all you need for now is the first option – Play. (Pic05 Actions)
Select Play from the Action list.
The Play Action is added, but the Action's Target column indicates that there is no Object being referenced. Now you need to indicate that you want to play the Sound SFX Object that you created earlier. (Pic06 Target)
If you do not see the Target column in the right pane, then drag the border between the two panes in the Event Editor to the left until the Target column is displayed.
Select the empty Target box, click Browse… and select your Sound SFX Object from the Default Work Unit in the Actor-Mixer Hierarchy. Click OK. (Pic07 Browse for Target)
You’ve now connected the playFoleyFootstep Event to the platformer_foley_footstepGeneric_M01 Sound SFX Object. Wwise lets you simulate what will happen in the game by allowing you to play not just Sound SFX Objects, but also the Events themselves. Playing the playFoleyFootstep Event should trigger the footstep sound. Before you can do this, you need to make sure that the playFoleyFootstep Event is visible in the Transport Control View. (Pic08 Play the Event)
Inspect the Action in the Event Editor more closely. (Pic09 Action Properties)
An Event can have a lot of different Actions, targeting completely different aspects of the game’s audio. Each Action, depending on the Action itself, has quite a few Properties that can change the behavior of the targeted Wwise Object, such as Probability and Fade-in and Fade-out Options. You don’t need to change anything for the footstep Event for now.