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).