This page presents an overview of interactive conversations and how they're implemented in the Dialogue System.
Conversations can occur between the player character (PC), non-player characters (NPCs), and objects (computer terminals, magic mirrors, etc.). The player can choose what to say, and NPCs respond interactively. Conversations can also occur solely between NPCs.
They can include text subtitles and cutscene sequences that can play animations, voice acting, camera work, Quick Time Events, and more. The flexible UI system lets you use any GUI system and UI layout, including elements such as animated portrait images, timers, and freeform text input.
A powerful condition and variable system lets you control the flow of conversations and track information such as character relationships and quest states. For example, an NPC may become hostile if the PC chooses aggressive dialogue choices, or the PC may complete a quest by talking with an NPC.
The Dialogue System is designed to be modular and easy to integrate with other products. It has built-in support for a number of GUI systems, gameplay frameworks, and visual scripting environments, and provides simple script templates for programmers to customize the Dialogue System's behavior and add support for other products. If you're not a programmer, don't worry! You can access the full functionality of the Dialogue System without writing a single line of code.
Interactive conversations (also known as branching dialogue) are a key feature of interactive entertainment. As opposed to static, linear dialogue, interactive conversations allow the participants (PC and NPCs) to choose their responses from a list, based on the current state of the game. These choices can further affect the state of the game and the direction of the conversation. Interactive conversations give the player freedom to express his or her character's personality while preserving artistic control for the game author.
An example interactive conversation is below:
The rest of this manual uses the following terms:
Term | Description |
---|---|
Dialogue Database | A Unity asset that contains all of the data below |
Actor | Participant in a conversation |
Conversation | A collection of linked dialogue entries |
Dialogue Entry | A line spoken by an actor, also containing other information such a Condition, Script, and Sequence |
Condition | The game state requirements that must be true for the actor to use the dialogue entry |
Script | Data values to set and actions to execute when the dialogue entry is spoken |
Sequence | A series of commands that can play audio and animation, control objects, and more |
Bark | A one-off line spoken without engaging in a full conversation; often used to add atmosphere to a scene |
The main parts of the Dialogue System are:
Part | Purpose |
---|---|
Dialogue Database | An asset in your project containing your conversations, quests, variables, etc. |
Actors | Participants in conversations; an actor trigger system starts conversations |
Dialogue Manager | The underlying engine that runs between the dialogue database and the Dialogue UI/Sequencer |
Dialogue UI | Displays subtitles and player response menus |
Sequencer | Runs cutscene sequences such as animation, audio, and camerawork |
These are the general steps to add conversations and quests to your project:
Your content goes into a dialogue database. The Dialogue System provides several methods to write content. You and your writers can choose the methods that work best for your project.
The Dialogue Manager is the engine that connects your dialogue database to actors and triggers in the scene, and manages the dialogue UI.
The term Dialogue Manager has two meanings:
DialogueManager
script interface.The Dialogue Manager GameObject maintains a master database of all loaded dialogue databases, a Lua virtual machine containing runtime data that your conversations and quests can access, and global user interface settings. Setting up the Dialogue Manager also includes selecting one of the provided prefab UIs or designing your own.
More information: How to Set Up the Dialogue Manager
For programmers, PixelCrushers.DialogueSystem.DialogueManager is a static class that manages a singleton instance of PixelCrushers.DialogueSystem.DialogueSystemController. Your scripts can access several useful properties and methods in DialogueManager
to manage the database and control conversations, barks, alerts, and sequences.
For more information: Scripting
Triggers make things happen in the Dialogue System. For example, you can place a Conversation Trigger on an NPC to start a conversation. You can specify the conditions of the trigger, such as whether it fires when the scene starts, when the PC enters the actor's trigger area, or when the PC "uses" the actor. You can also specify game state conditions such as quest states and relationship values.
The Dialogue System provides a large variety of triggers for starting conversations, barks, and sequences, as well as handling actions at the beginning and end of conversations.
More information: How to Set up Components