Game: Mass Effect, made by Bioware
Replicated Feature: The looks and behaviour of the dialogue system and dialogue wheel
More Information: [Blog Post]
Using the Sample:
This sample is composed of four projects.
First, the ZSquare.Dialogue project contains the 4 main classes used by the Dialogue System:
- SpeechLine – represents a single line delivered by one character, or an event. This has a ID, a subtitle, optionally a sound file to be played when this line is played, and if the sound file is absent, a duration of the speech line
- DialogueBranch – represents a series of SpeechLines that together compose a sequence of interactions between characters (excluding the Player Character). A branch leads the dialogue from one choice to the next. A branch also has a set of Precondition and Consequences. Normally, these would be analyzed by some other system of the game to determine if a certain branch can be chosen (for example, a certain amount of points in a skill), or to determine the outcome of a branch (for example, in a dialogue one branch might cause people to become hostile, and another would cause them to surrender). I represented these as Key-Value string pairs, and their analysis is not handled by this sample.
- DialogueHub – represents a point in the dialogue where the Player can make a choice between replies. It can contain up to 6 choices, and can also hold up to 5 Investigation topics. When a hub has investigation topics, these are shown under a sub-choice called “Investigate”. Choosing an Investigation topic causes the corresponding branch to play, and then the dialogue returns to the hub from which the choice was made. Normal (non-Investigate) choices advance the dialogue to other hubs.
- Dialogue – representa the whole dialogue, holding lists of SpeechLines, DialogueBranch and DialogueHubs. Because of the complex nature of the relation between these entities, each of them is referenced by an ID. So, a DialogueBranch holds a list of SpeechLine IDs, and a DialogueHub holds a list of DialogueBranch IDs.
The ZSquare.Dialogue.Pipeline project provides some Content Pipeline classes to allow loading of Dialogue objects in an XNA project.
The Editor project is just that. An visual editor to create a dialogue description file. For an example, you can use it to open the example.xml dialogue file inside the Content folder of the DialogueSystemSample project.
Which leads us to the main project of this sample, the DialogueSystemSample project. Some important classes encountered here are:
- BranchPlayer – plays a DialogueBranch, playing the sound and making the subtitle available.
- HubPlayer – handles filling and displaying the DialogueWheel, allowing the player to make choices in the dialogue.
- DialogueWheel – displays and handles the input of the player in order to choose one of the presented options
- DialoguePlayer – given a Dialogue object, it uses the above classes to handle the playing of the dialogue and interaction with the Player.
For illustrative purposes, I included an example dialogue (using text-to-speech for the voices).
The controls used in the sample are:
- X – skip current speech line
- Left Thumbstick – highlight a choice on the DialogueWheel
- A – Activate the highlighted choice from the DialogueWheel
(Unlike Mass Effect, pressing X does not activate a choice, it only skips the current line).
Screenshots:
Download: DialogueSystemSample.zip


by Catalin’s XNA Experiments » Mass Effect Dialogue Sample, on 04.05.09 @ 11:33 pm
[...] sample’s page can be found here. Have [...]
by Clarvalon, on 04.10.09 @ 11:13 am
Very nice. The Mass Effect dialogue wheel is, as far as I’m concerned, the only real evolution of the dialogue tree common in the old point ‘n click adventures.
P.S. I managed to get an unhandled exception in the Editor but I’m jiggered if I can recreate it.
by Catalin Zima, on 04.10.09 @ 12:57 pm
About the exception… it’s entirely possible. The main point of the sample is the dialogue handling, as seen in the XNA project. The editor is just an extra bonus, which I did to avoid writing XML manually
So yeah, if you encounter any exceptions… I’m sorry
Thanks for the feedback
by Martin Caine, on 04.20.09 @ 2:08 pm
Wow, very nice sample. I only wish one of our current games needed a dialogue system!
by Catalin Zima, on 04.20.09 @ 2:31 pm
Maybe for your future games
by simonjohnroberts, on 06.29.09 @ 1:17 am
I really am going to look this over again.
It’s like the third time I’ve been here.
top work incidentally.
by Niklas Rother, on 04.06.10 @ 6:07 pm
Really cool!
But you missed adding Keyboardsupport
But i´ve done it for you: Simple replace DialogueWheel.HandleInput(GameTime) with this:
if (!Visible)
return;
Vector2 leftThumbstick = input.CurrentGamePadStates[0].ThumbSticks.Left;
if (leftThumbstick.Length() < 0.2f)
{
highlightedChoice = -1;
}
float angle = (float)Math.Atan2(-leftThumbstick.Y, leftThumbstick.X);
angle += MathHelper.PiOver2;
if (angle < 0)
angle += MathHelper.TwoPi;
highlightedChoice = (int)(angle / (MathHelper.Pi / 3));
highlightedChoice = highlightedChoice % 6;
if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad9))
highlightedChoice = 0;
else if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad6))
highlightedChoice = 1;
else if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad3))
highlightedChoice = 2;
else if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad1))
highlightedChoice = 3;
else if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad4))
highlightedChoice = 4;
else if (input.LastKeyboardStates[0].IsKeyDown(Keys.NumPad7))
highlightedChoice = 5;
else
highlightedChoice = -1;
if (highlightedChoice == -1)
return;
if (entries[highlightedChoice] != null)
if (input.IsDialogueChooseBranch(null))
{
ChosenBranchID = entries[highlightedChoice].BranchID;
this.Visible = false;
}
Now you can select the entries with the numpad
by Catalin Zima, on 04.06.10 @ 6:25 pm
Cool, Thanks!
I only ever played ME on the Xbox, so I only thought about controllers when implementing this sample. But yes, this would be of great help if you wanted to use it in a windows game.
by Gedanken zu Dialogen | Niklas Rother - XNA Computer & mehr, on 06.01.10 @ 7:56 pm
[...] muss also eine andere Lösung her! Einen Ansatz gibt es hier: Der Autor hinter diesem Blog hat versucht das Dialogsystem von MassEffect zu reproduzieren. Leider [...]