Interruptable Dialog System
Over the years of gaming one of the things that really bothered me and put me out of the game was the dialog not reacting to the environment
and what’s happening. One particular example happened in the game Prince of Persia: Two Thrones as the prince and the dark prince continued
talking while I was trying to fight enemies. It made me lose track of the conversation and that part of the story so I wanted to come up with
a solution using the Wwise middleware and I’ve come up with this interruptable dialog system.
I used an old GDD that I’ve written for the story and the dialog. In the game, the player plays as a thief who is cursed and had her soul connected
with an old evil mage. The playing style of the player determines if the thief and the mage like each other or not and since this is one of the main
topics in the game the dialogs need to be written to give the state of the protagonist. This brings out a few challenges:
The characters can talk anytime and something can happen while they are in the
There are no mimics to support the dialog as they are internal conversations.
The characters should react differently to the same situation depending on the fact of liking each other or not.
Now aside from the impeccable script and great sound performances I needed to provide a system that can manage these aspects so I followed 3 principles to achieve that:
We can see the dialogues as in the script of a movie with each character having cues and when a cue changes so will the character.
We can control the flow of a dialogue with events and parameters just like we can control the sound elements.
Telephone conversations shows us that even though we don’t use mimics we can transfer our opinion about the conversation by our reactions while the other person is talking.
To manage this I decided not to use the interactive dialog system that Wwise provides as it felt lackluster to what I was trying to achieve and used the basic switch
containers so that I can control the flow. One question to ask would be: why not use sequence containers and my answer is that I may have to go backwards if there is an
interrupt in the dialog which I will show in a bit.
So I setup a switch called dialoguecue to keep track of which cue we are in and I wanted to keep track of who is talking at the time and put another switch called
personTalking which we’ll see its benefits in a bit.
I also setup a parameter called CorruptionLevel( for lack of a better term) which defines if the thief and the mage like each other or not.
The higher the corruption level the more aligned they start to think. Using the CorruptionLevel parameter I decided to have 3 outcomes for each dialog:
Low Corruption: The thief and the mage don’t like each other
Medium Corruption: The thief starts to think more about her benefit
High Corruption: The thief and the mage starts to become almost one.
If it’s a conversation right after a mission this can branch into 6 conversation with each corruption level and if the mage is approving the mission outcome or not.
1 thing to also mention, for the high corruption dialogues I also setup an RTPC to add the mage’s voice onto the thief’s voice to have the effect of them becoming one and
controlled the audio level of it by using the RTPC.
Now that we can branch the conversations depending on the character’s relationship and the situations we’ll need to tackle the interrupt functionality. To achieve this
I recorded and branched out different interrupts for each character depending if they like each other or not. I also needed another parameter for the interrupt
which is StressLevel which controls what kind of an interrupt it is. Low being a little monster attacking and high being a god like monster attacking the player.
I also needed to keep track of who is talking at the time so that I can have the other person interrupt the conversation.
We’ll also have to return the conversation just as we interrupted. Again I branched them out to 3 corruption levels for each character without the stress
level as returning will be done when noone is there to interrupt. The one little tricky thing here is that regardless of whose turn it is in the conversation,
both characters can return to it; one can say anyway and keep going or the other can say: you were saying encouraging the other person to continue which is a
factor to increase interactivity.
To increase the interactivity even more, I also added some efforts which can trigger randomly after the other person starts talking just like a telephone
conversation. Again I branced them out to 3 depending on the corruption level as people react differently to the other person’s suggestions depending
on their own opinion of them. So in lowcorruption it can be a sarcastic laugh while in high corruption it can be mmhmm encouraging the other person to keep talking.
So the general dialogue event will go like this:
Setup the person talking before the dialogue and reset the dialogcue to 0
Increase the dialoguecue by one and play the respective switch container and add a small random chance of an effort to the other person,
we can use the silence inside the random container to ensure the small chance
If there is an interrupt coming let the other person have an interrupt event to cut the conversation and decrease the dialogcue by 1( so that we can get back to the conversation before)
Return to the conversation by playing a return event and using our conversation event which adds one to the dialoguecue and plays the respective element.
Keep going like this until the conversation ends.
To show this event structure I used the Wwise Post Event function to create the whole dialogue. This function gives me the ability to create big and timed events
to prototype, or use it as a dynamic mixing tool if I need.