At the center of Wwise's Dynamic Dialogue system is the Dialogue Event, which is basically a set of rules or conditions that determines which piece of dialogue to play. The Dialogue Event allows you to recreate a variety of different scenarios, conditions or outcomes that exist in your game. To ensure that you cover every situation, Wwise also allows you to create default or fallback conditions.
All these conditions are defined using a series of State Groups and States. These State Groups and States are combined to create paths, which define the particular conditions or outcomes in the game. Each path is then associated with a specific sound object in Wwise. As the game is played and Dialogue Events are called, the game verifies the existing conditions against the paths defined in the Dialogue Event. The paths that match the current situation in game along with the mode, probability, and weighting of each path determine which piece of dialogue is played, if any.
For example, the following Dialogue Event contains the State Groups related to the names of each player in a sports game. The values of each State Group are combined to create the different paths or conditions that may exist. In this particular example, the commentator can use either the player's last name or full name.
To deal with situations where there are no states that match the current situation in game, you can create a path with a default or fallback state. These “fallback” paths contain one or more State Groups instead of States and are usually associated with a more general sound object. In the previous example, the fallback path is associated with the sound object “Them” instead of one of the player's names.
After you have recreated all the conditions in the Dialogue Event, it can be integrated into the game engine. When the Dialogue Events are called by the game, the sound engine resolves the Dialogue Event by returning the audio structure that corresponds to the matching path. The sound engine can then decide whether to insert the audio structure into a dynamic sequence for playback. The relationship between returning an audio structure and inserting it into a dynamic sequence does not have to be 1:1. This means that for each resolved Dialogue Event, a returned audio structure can be added to the dynamic sequence as many times, as necessary.
When creating dynamic dialogue, it is important that you work closely with your audio programmer, since many of the functions are only available in the Wwise SDK, including the ability to stitch words or phrases together into sentences.
Since the game engine uses the Dialogue Event name, you can create the events, integrate them into the game and then build and fine-tune the contents of each Event without ever having to re-integrate them into the game again. This gives you a great deal of flexibility to add or remove states, and to experiment with different sounds, all without additional programming.
Adding, removing, and moving State Groups within a Dialogue Event will automatically modify the paths. Although this is easily done in Wwise, this type of change will require programmer intervention because the code will need to be updated as well.
To help you easily identify a Dialogue Event in the interface, it is represented by the following icon.
Let's say that you are creating a hockey game with a play-by-play commentary. When a player shoots and scores, you want the play-by-play commentary to correspond to the Action in game.
To set up the different possibilities and outcomes in Wwise, you will need to create Dialogue Events for Players, Actions, Transitions, and so on. Each of these Events will contain a set of corresponding State Groups and States that you have created for your game. You must create a path that defines each condition or outcome and then assign an appropriate voice object to each path. During gameplay, the game will match the current states against the paths you defined in Wwise to determine which voice object to play.
The following illustration demonstrates how Dialogue Events created in Wwise can generate a play-by-play commentary that says “Cross shoots and scores”.
The previous illustration was simplified to show you how State Groups and Dialogue Events can be used in your game. In most cases, however, your game will require more sophisticated Dialogue Events that contain many different State Groups and States. Wwise allows you to set up a variety of complex scenarios that can make the dynamic dialogue in your game more realistic.
The following example shows you a more sophisticated example of the Player Dialogue Event. Notice how this Dialogue Event has several State Groups. When you have several State Groups, the selected states create the path. You can create a path for each combination of State Groups and States and then assign an object to each path. When each State within a particular path is met in game, the voice object that is assigned to that path will play.