Skip to content

Getting Started

Dominik Pavlíček edited this page May 3, 2023 · 115 revisions

Table of contents

  1. Download the Plugin
    1. Marketplace
    2. GitHub
  2. Instal the Plugin
    1. Marketplace
    2. GitHub
      1. Game Folder
      2. Engine Folder
  3. Enable the Plugin
    1. Marketplace
    2. GitHub
  4. Open the Project
  5. Before you Start
    1. Dialogue Defaults
      1. User Interface
      2. Subtitles
      3. UI Commands
    2. Dialogue Editor Defaults
      1. Nodes Settings
      2. Decorators Settings
      3. Wiring
      4. Auto Arrange
  6. Dialogue Manager Component
    1. Add Component
    2. Setup Component
    3. Component Events
  7. Participant Component
    1. Prepare Actor
    2. Add Component
    3. Setup Component
    4. Component Events
  8. How to make Dialogue
    1. Create Dialogue Tree
    2. Graph Functions
    3. Make dialogue data
    4. Intro to Decorators
  9. Dialogue Flow
    1. Flow Graph
    2. Node Types
  10. Fix Issues
    1. How to start dialogue

1. Download the Plugin

Marketplace

Marketplace Download

If you have already the plugin claimed, simply select the plugin and install it to the Engine version you are working with. Marketplace release always supports the last three major releases according to Epic Games policies.
If you don't see your Engine version listed on the Marketplace, you can always download the GitHub release.

GitHub release

GitHub Download

If you feel experimental or simply need an older project to work with, the GitHub release page got you covered. All releases are listed HERE.
There are always two versions:

  • MounteaDialogueSystem
  • MounteaDialogueSystem_Binaries

The Binaries version skips the code build when opening the project and is recommended for Blueprint-based projects.


2. Instal the Plugin

Marketplace

Instal from Marketplace

Epic Games Launcher does the job for you, so you can continue to another chapter.

GitHub

Instal from GitHub

With the GitHub release, there are two ways to install the plugin. Both have their advantages and disadvantages.

Game Folder

If you instal the plugin in Game Folder, this plugin will be available for this specific project only. If you are using the Blueprint project, it might require creating a dummy C++ class for packaging.
Installation to Game Folder requires you to drop the plugin into: .../ProjectFolder/Plugins
If you have no Plugins folder, simply create a new one.

Engine Folder

If you instal the plugin in Engine Folder, this plugin will be available to all projects using this Version! With Engine Folder you shouldn't need to create a dummy C++ class for packaging.
Installation to Engine Folder requires you to drop the plugin into: .../EngineFolder/EngineVersionFolder/Engine/Plugins/
Engine is usually installed in: C:/Users/{user}/UnrealEngine/{engine_version}


3. Enable the Plugin

Marketplace

Marketplace

If you are opening the project for the first time, you need to enable the plugin in Edit/Plugins/Mountea Framework

It will ask you to restart your Editor.

GitHub

GitHub

If you are using the GitHub release, the plugin should be installed by default. If not, you need to enable the plugin in Edit/Plugins/Mountea Framework
It will ask you to restart your Editor.


4. Open the Project

Open the Project section

If you are opening the project for the first time, you will be greeted by a Welcome Screen. This popup window shows:

  • If you open the project for the first time
  • If a new version is released

Welcome Screen contains useful links as well as full Changelog, so you can see what version with what features.
Welcome Screen requests those data from GitHub page, so if you have no access to the internet, this popup will not show any Changelog information ❗


5. Before you Start

Before you start creating any super complex dialogue, there are a few steps that must be done. In order to make everything work, you should set up default values and. So let's start with those annoying configurations before so we can focus on dialogues later.
Dialogue System comes with two configurations, one for Runtime (Game) and the other for Editor. We will go over both configurations in more detail in a second.

Default settings can be found here: Window/Project Settings/Mountea Framework

Dialogue Defaults

Dialogue Defaults are the Runtime (Game) default values we are using for in-game functionality. Runtime settings contain two categories, which are:

  • User Interface
  • Subtitles

User Interface

User Interface

User Interface category contains options to tweak what UI is displayed for the Dialogue. Version 1.0.0.x comes with this options:

  • Default Dialogue Widget Class
  • Input Mode

Default Dialogue Widget Class

Default Dialogue Widget Class is used to determine what User Interface class is used for Dialogue.

❗ This value is not mandatory for functionality, however, if left empty, then each Dialogue Manager must implement Dialogue UI.
❗ Default Dialogie Widget class must implement IMounteaDialogueWBPInterface in order to be displayed in the dropdown.
❗ This value is by default empty and must be populated by hand.

Input Mode

This value provides information on whether player is allowed to use just UI or Game and UI inputs during dialogues.
❗ This value is only informative and does not provide any logic by its own.

Subtitles

Subtitles

Subtitles settings provide a lot of options to tweak out various options which are then propagated to Widget Classes. Subtitle Settings can be ignored if better or different option is implemented, this serves just the safe defaults purpose.
Subtitles settings are already containing default values and those can be changed anytime. Here is a list of individual settings with their explanation.

Update Frequency

This value defines how often (per second) is UI updated when using update events. This is used for progress bars, lerping colours etc. Lower the value, the higher the performance impact. The higher the value, less smooth the output is. Generally, a good balance is 0.05s to achieve solid visual results combined with a small performance impact.

Skip Fade Duration

This value defines how quickly (in seconds) the voice will be cut off once Skip is requested. Generally, this value should not be changed, as this provides a solid balance between the audio cutting and UI timing, however, you can always try what fits you the best.

Allow Subtitles

Quite a self-explanatory option, which drives if Subtitles can even be shown.
Currently, C++ function is driven by this specific value, which means if this value is changed/saved in runtime, it must be overridden!

Subtitles Settings

Subtitles Settings are useful, a very powerful tool providing a lot of versatility to tweak out subtitles visuals.
Subtitles Settings are split into two parts:

  1. one is Subtitles Settings setting up the default subtitles
  2. another is Subtitles Settings Override settings, which give one more step to tweak out specific subtitles types

Subtitles Settings

What options do Subtitles Settings provide you with? Basically the same you know from Widget Blueprints, the ability to set:

  • Subtitles Color and Opacity
  • Subtitles Font with font size and font material
  • Shadow offset
  • Shadow Color

All those settings are useful for making a nice font, which is readable while being editable using config write in runtime.

Subtitles Settings Override

Subtitles Settings Override do nothing different than Subtitles Settings but provides the ability to specify Row ID.
But what actually is Row ID? Row ID is a unique identifier which consists of:

  • int index
  • Widget Class

This way you can specify for each Dialogue Row what unique ID it has (in the range between 0 - 255).

This is very useful to visually define story lines (let's say yellow colour) and non-story (white colour) without the need to define any new widgets or any complex logic in Blueprints.

Dialogue Widget Commands

Dialogue Widget Commands

Dialogue Widget Commands are a list of string commands that define what actions are supposed to happen. This is to simplify the code base and provide generic functionality which can be called with specific parameters, avoiding dozens of unique functions.
There are a few hard-coded values which are in use by the plugin's C++ libraries. Those values cannot be deleted from Editor and should not be deleted from the config file! Those values are:

  • CreateDialogueWidget
  • CloseDialogueWidget
  • ShowDialogueRow
  • UpdateDialogueRow
  • HideDialogueRow
  • AddDialogueOptions
  • RemoveDialogueOptions

Those values are used in this Widget Blueprint class: /MounteaDialogueSystem/WBP/WBP_Dialogue

Dialogue Editor Defaults

Same way as Runtime values have their default values saved in the Project Settings, Editor values are saved there as well. Those values are per-project, therefore once set up for one project, all other projects won't reflect those changes (unless using default config files, explained later).

Dialogue Editor Defaults are split into three main categories: * Nodes Settings * Node Wiring * Auto Arrange

Updating any value affects the Dialogue Editor in real-time.

Nodes Settings

Nodes Settings

This category is the one which is probably most important and affects most visuals. In this category, you can switch Node Themes, you can switch Node Style and even set a different colour for specific Node Classes!
In the screenshots below, you can see a difference between different settings, affecting the Nodes.

All settings in this category have just and only visual impact and have no effect on functionality whatsoever. We made those to give you more room to make the system easier to adopt and fit your style.
Node Type

Node type defines whether nodes will have Hard Corners or Soft corners.
Default: Soft Corners

Node Theme

Node theme defines whether the node foreground colour is bright or dark. This affects Node Validation too!
Default: Dark Theme

Decorators Info Style

This setting has quite a visual impact. There are two options:

  • Unified
  • Stack

Unified displays one large bubble, containing all text fields. This style comes with nice icons for Inheritance.
Stack breaks texts into individual chunks, in order:

  1. Inheritance
  2. Implementation
  3. Node name

Default: Unified

Display Automatic names

This value allows showing node class names, instead of a manual label. This is a non-destructive operation, therefore changing this from false to true and back again doesn't remove manual names.
Default: false

Override Node Background Colours

Using this map, you can select Node Class and give it a different background colour.
In the screenshot, you can see Start Node (the first one) being pink instead of green.
Some nodes are not allowed to be selected, those are not visible in the graph and serve only as base abstract classes.

Allow Native Decorator Edit

True/false value, allowing opening Decorators in IDE if those decorators are C++ based.
In the screenshot below, you can see that the last decorator doesn't have the tool icon next to it. That indicates it is native C++ decorator.
If Native Decorators Edit would be allowed, this decorator would have the tool icon next to it as well, opening the default IDE when clicked on.

Default: False

Decorators Info

Decorators Info

Decorators info is Nodes Settings sub-category and contains two options:

  1. Show Detailed Info: Number of Decorators
  2. Show Detailed Info: Does inherit Decorators

The two values define what info is visible in the Dialogue Node itself. In the screenshot below, you can the following:

  1. Yes/Yes
  2. Yes/False
  3. False/False
  4. False/Yes

Default: Yes/Yes

Wiring Settings

Wiring Settings

Wiring settings affect only the edge wire, connecting Nodes together.
In the current version, the edge is straight and goes directly from Node to Node, with no additional settings, logic or advanced visuals. For the next releases, we plan to add nicer wiring, where the edge wire would deform nicely based on tangents from point A to point B.

In this category, there are only two settings:

  1. Wire Width
  2. Arrow Type
Wire Width

Wire Width defines how thick the connecting wire is, using a range to avoid strange clipping and visual artefacts.
Range: 0.1 - 1.5
Default: 0.5

Arrow Type

Arrow Type provides a simple way to change the Wire arrow. There are the following options:

  • Simple Arrow
  • Hollow Arrow
  • Fancy Arrow
  • Bubble
  • Nothing

Default: Hollow Arrow

Auto Arrange Settings

Auto Arrange Settings

Auto arrange settings contain one main value and multiple advanced ones.
Advanced settings won't be covered in this part!

Optimal Distance

Defines how far Dialogue nodes should stay apart.
The lower the value, the closer the nodes are together. This can lead to clipping!

Default: 100


6. Dialogue Manager Component

Dialogue Manager Component is one of the major components, responsible for handling the Dialogue flow. This component implements IMounteaDialogueManagerInterface, which contains flow functions.
Dialogue Manager Component is an Actor Component, it has no transform and is attached directly to the Actor.

❗ Dialogue Manager Component should be attached to Player Controller, as the Controller is responsible for handling the dialogues.

Dialogue Manager Component is blueprintable, which means, that you can create child Blueprint classes using this class. This is useful in cases when some specific logic is not implemented or new attributes are needed to better drive the dialogue flow.
For easier implementation, there is premade one Blueprint, in folder /MounteaDialoguePlugin/Blueprints/Components.

Add Component

Add Component

To add Dialogue Manager Component to any Actor (again, best is to add it to Player Controller), all you need to do is open the Actor and use the Add Component button, then search for Mountea Dialogue Manager and use whatever fits you the best.
❗ BP version contains a predefined WBP class, otherwise has no extra settings.

This is all you need to do in order to enable the Player Controller side.

Setup Component

Setup Component

Once you add the component to your Actor, you will see settings similar to those in the picture below.
As you can see, the Dialogue sub-category is under the Mountea category. This is futureproofing, as other Mountea Framework plugins are added, they all are added to the same category and won't be scattered across the Actor's Details panel.

Dialogue Widget Class

Same as with the Defaults, this is Class picker.
❗ Either this value or Defaults value must be defined in order to make the Dialogue System work.

The same rules and limitations apply as for the Defaults:
❗ Dialogue Widget class must implement IMounteaDialogueWBPInterface in order to be displayed in the dropdown.

Any Widget Blueprint can implement this interface, so making your own Dialogue WBP is actually quite a simple task.

Default Manager State

Default Manager State defines which state will be set once this component's Begin Play is called.
❗ Active state is not allowed to be set as the Default state


All other variables in Dialogue Manager Component are read-only values shown for debugging purposes.

Events

Dialogue Manager Component Events

Dialogue Manager Component comes with a handful amount of Events, which can help either debug or tie logic to them.

Here is a list of Events with short explanations.

On Dialogue Initialized

This Event is called once Dialogue successfully initializes, which means that Participants can start a dialogue and all needs are met.
If Dialogue doesn't start, On Dialogue Failed is called instead.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Started

This Event is called once Dialogue successfully start, which means that Participants are now in dialogue with each other.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Closed

This Event is called once Dialogue is closed, no matter how this happened - either manually by ending the dialogue or by any other means.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Context Updated

This Event is called once Dialogue Context is updated, no matter what changes.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance. This data contains up-to-date values.

On Dialogue UI Changed

This Event is called once Dialogue UI has changed, either by creating a new one or closing an existing one.
This Event is called once Dialogue Starts and once Dialogue is Closed.
This Event provides Dialogue UI Class and Dialogue UI Reference pins, which contain what UI data are in use.
❗ Those pins might be Null, please validate them before using them

On Dialogue Node Selected

This Event is called once any Dialogue Node is selected, therefore becoming the Active Node.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Node Started

This Event is called once any Dialogue Node starts, indicating this is the Active Node.
This Event means that Dialogue Rows are being executed if any are attached. The same for Decorators.
If this Node has any Dialogue Rows, each will be executed, calling On Dialogue Row Started.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Node Finished

This Event is called once any Dialogue Node finishes, indicating this Node has no Dialogue Rows to be executed or any other logic.
This Event will be called after the last Row is finished, which is called from On Dialogue Row Finished.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Row Started

This Event is called for each Dialogue Row and its data to be processed.
Once Dialogue row is finished On Dialogue Row Finished is called to close this Dialogue Row.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Row Finished

This Event is called for each Dialogue Row and its data once it is processed.
Once the last Dialogue Row is finished On Dialogue Node Finished is called to close the Node itself.
This Event provides a Dialogue Context pin, which contains transient Dialogue data for this specific dialogue instance.

On Dialogue Failed

This Event is called if Dialogue fails to proceed. This could be called during initialization or during gameplay for various reasons.
The reason, why the Dialogue failed, should be described in the Error Message pin this Event provides.

On Dialogue Manager State Changed

This Event is called once Dialogue Manager State has changed in value, providing the new value as a pin.

On Dialogue Voice Start Request

This Event is called once Voice is requested to start playing.
This plugin does provide a Decorator to handle voices, however, to avoid any hardcoded logic, this could be easily updated. This Event allows to abstract the Voice calls in Events based fashion.
This Event provides the Voice Sound Base which is requested to play.

On Dialogue Voice Skip Request

In the same manner as On Dialogue Voice Start Request provides a way to start the voice, this Event is called once Skip is requested.
This Event provides the Voice Sound Base which is requested to play.


7. Dialogue Participant Component

Dialogue Participant Component is a helper Component, which identifies in-game Actors as Dialogue participants. Those Actors then can be used in Dialogues and being dialogued with.
Dialogue Participant Component implements the IMounteaDialogueParticipantInterface interface, which contains flow functions.
Dialogue Participant Component is an Actor Component, it has no transform and is attached directly to the Actor.

❗ Unless Dialogue Manager Component, Participant can be attached to any Actor. This Actor does not need any other logic.
❗ In order to make Dialogue Participant work flawlessly, Audio Component is strongly recommended to add to the parent Actor.
❗ Player Pawn must be Dialogue Participant as well, as this component does not differentiate between Player and NPC Actors.
❗ This component must be added to Player Pawn.

Dialogue Participant Component is blueprintable, which means, that you can create child Blueprint classes using this class. This is useful in cases when some specific logic is not implemented or new attributes are needed to better drive the dialogue flow.
For easier implementation, there is one premade Blueprint, in folder /MounteaDialoguePlugin/Blueprints/Components.

Prepare Actor

Prepare Actor

Actor preparation for Dialogue Participant is actually simple. There are two possible use cases for this component:

  • Active Participant who can have their own dialogue
  • Active Participant who doesn't have any own dialogue

The first option is useful for NPCs that can be interacted with.
The second option works as a check so Dialogue can jump between its participants. This one is supposed to be set for the Player.

❗ In order to play voices all Actors involved in Dialogue must have Audio Component.
Dialogue won't fail without Audio Component, however, there will be no voices.

For this example, I will use Character class. Let's make a new Blueprint inheriting from Pawn and call it BP_NPC.
Once done, you will see something similar to this class.

Now, we need to assign two components:

  1. Dialogue Participant Component
  2. Audio Component

Why Audio Component?
Audio Component is a crucial component responsible for playing dialogue voices. Without an audio component, no voices can be heard, completely breaking the dialogue immersion.
If there is no dubbing, however, there is no need for an audio component.

Add Audio Component

Adding an audio component is as easy as it gets. In the same way, we are adding all components, we will add the Audio.

❗ Feel free to use any child classes of Audio Component, but the audio component must inherit from Audio Component

Once you have an audio component, there are a few steps that are necessary to perform.

  1. Give your component a name
  2. Attach it to a socket (if you have a mesh component as a parent)
  3. Add a tag
  4. Set Auto Activate to false

This is all you need to do in order to prepare your Actor's audio component to be Mountea Dialogue ready!

Add Participant Component

This part is covered here.

Add Component

Add Component

To add Dialogue Participant Component to any Actor, all you need to do is open the Actor and use the Add Component button, then search for Mountea Dialogue Participant and use whatever fits you the best.

This is all you need to do in the Class definition.
❗ We strongly recommend not defining dialogues in Class defaults, unless a very specific Actor is placed. Dialogue data should be updated on in-level instances.

Setup Component

Setup Component

Once you add the component to your Actor, you will see settings similar to those in the picture below.
As you can see, the Dialogue sub-category is under the Mountea category. This is futureproofing, as other Mountea Framework plugins are added, they all are added to the same category and won't be scattered across the Actor's Details panel.

Dialogue Graph

This is the most important single variable of this Component.
This is the Dialogue Graph selector, which defines what Dialogue Graph is this Component using.

❗ In order to make Dialogue work, this value must not be Null.

This value can be changed during gameplay, however, limitations apply:

  • Changing value is not allowed during Dialogue (state is Active)

Dialogue Graph is validated once Dialogue is requested to start.

❗ Should be updated per instance in the Level

Default Participant State

Default Participant State defines which state will be set once this component's Begin Play is called.
❗ Active state is not allowed to be set as the Default state

Audio Component ID

Either Name or Tag of the Audio Component of this Actor. This allows an easy way to pre-define relations between Participant and its Audio Component.
SetAudioComponent can be used instead.

❗ Should be updated per instance in the Level

Events

Dialogue Participant Component Events

Dialogue Participant Component comes with a handful amount of Events, which can help either debug or tie logic to them.

Here is a list of Events with short explanations.

On Dialogue Graph Changed

This Event is called once Dialogue Graph has changed and only if changed.
This Event provides a New Graph pin, which holds the reference value of the Dialogue Graph that is set as a new Graph.

On Dialogue Participant State Changed

This Event is called once Participant's State has changed and only if changed.
This Event provides a New State pin, which holds the value of the Participant State that is set as a new Participant State.

On Audio Component Changed

This Event is called once Audio Component has changed and only if changed.
This Event is called even when the value changes to Null.
This Event provides a New Component pin, which holds the reference value of the Audio Component that is set as a new Audio Component.
❗ This Event might provide a Null pin

On Starting Node Saved

This Event is called once Audio Component has changed and only if changed.
This Event provides a New Start Node pin, which holds the reference value of the Audio Component that is set as a new Audio Component.
❗ This Event might provide a Null pin


8. How to make Dialogue

Create Dialogue Tree

Create Dialogue Tree

Creating a new Dialogue Tree is easy, as all major Mountea Dialogue assets are exposed to right-click quick menu. You can see those in the screenshot below.

Once Dialogue Tree is created, you can open the asset and start editing the Dialogue! But that is just the very first step in the journey of making an dialogue.
Let's now focus on creating actually playable Dialogue Tree.

Open Dialogue Tree

Open Dialogue Tree

Once you open Dialogue Tree, you will notice that there is already one Node created, and that is a Start Node.
This is what you are greeted with upon the first arrival to the Dialogue Tree.

Start Node

Start Node

Let's now explain why is there the Start Node and what does it do.

Start Node is a special type of Node, which indicates where the Dialogue starts. It is an anchor, helping the underlying system to get idea how the Dialogue flows. This node is specific in some other aspect, too:

  • you cannot copy this node
  • you cannot paste this node
  • you cannot delete this node

Dialogue Tree Details

Dialogue Tree Details

Now, let's focus on the Details Panel. This is something you are probably familiar with from regular Blueprints, as this Details Panel is the same - a place to edit properties.

Search
Search

The search bar in the Details panel provides a handy tool when searching for:

  • Decorators
  • Tags

In the screenshot below you can see how the Search works.

Decorators
Decorators

Decorators have their own Chapter.
Each Graph can have its list of Decorators, which are actions performed upon execution of the Active Dialogue Node. This is further explained in Flow Graph.

You have those options with Decorators:

  • add a decorator to an array
  • clear decorators array

With each Decorator, you have the options:

  • delete entry
  • open the documentation page

With Blueprint Decorators you have extra options:

  • browse to the asset folder
  • open blueprint
Gameplay Tags
Gameplay Tags

To any Graph, you can add Gameplay Tags. Those have currently no additional logic.

Select Node

Select Node

Selecting any node is as easy as selecting anything in Unreal Engine. Simply left click on the Node.
All Nodes can be Selected and Hovered. You can hover over the selected Node. Hovering over any Node will show a tooltip window with a short description of the Node.

Tooltip

All tooltip Nodes consist of two parts:

  • Generic part
  • Specific part

Generic Part tells you the Name and whether this Node implements and inherits decorators.

Specific Part gives a brief explanation of the Node itself and how to use it.

Node Details

Once you select any Node, will see a Details Panel.
As you can see, the Node Details Panel is customized, showing a custom button.

❗ Each Node type has its unique Node Details. Node types are displayed in the screenshot below
❗ All Nodes have a Documentation button

In the screenshot below, you can see different Node types and their Details Panels.

Create Node

Create Node

There are two ways how to create a Node in the Graph, and those are:

  1. Right-click and select a node from Menu
  2. Select a node, drag an edge from it and upon release select a node from Menu

In the end, Node creation is the same, there are just two ways how to get to it.

Connect Nodes

Connect Nodes

Once you have at least 2 Nodes in the Graph, you can connect them. Connection is automatically created if you create Nodes using edge release.

❗ Some Nodes cannot have input connections
❗ Some Nodes cannot have output connections
❗ Some Nodes cannot be connected
❗ Infinite loops are not supported

To connect Nodes, you drag from the existing Node using the left mouse button and release the cursor above the other Node.
If the connection is allowed there will be a message. A such message will be displayed for invalid connections, too.

Valid Connection.

ValidConnection.mp4

Invalid Connection.

InvalidConnection.mp4

Make Graph

Make Graph

Let's imagine a simple scenario:

  1. Player approaches NPC
  2. NPC asks if the Player can help it
  3. Player can choose if Yes (dialogue continues) or not (dialogue ends)
  4. If the player chooses No, then the dialogue ends
  5. If the player chooses Yes, then NPC tells the Player what he needs to do
  6. After that part is done, the Player tells the NPC he is going to do what he was asked for

Now, let's make this part in the Dialogue Tree editor.

MakingOfBasicDialogue.mp4

Now, let's discuss what just happened.

  1. Lead Node was created with the title "NPC"
  2. Answer Node was created with the title "Yes"
  3. Answer Node was created with the title "No"
  4. Complete Dialogue Node was created from "No"
  5. Lead Node was created from "Yes" with the title "NPC"
  6. Complete Dialogue Node was created from "NPC"

Different Node Types are described in their own Chapter. So for this chapter let's assume the following:

  • Lead Node is NPC Node
  • Answer Node is Player Node
  • Complete Dialogue Node completes the dialogue with dialogue data

If you save your Dialogue Tree now, you will see Validation error. That's correct behaviour, don't be scared. We will get through it in a moment in the Graph Validation chapter. To skip a bit up further, we will need to Make dialogue data.

Graph Functions

There are currently two Graph functions available to buttons in the ribbon.

  1. Auto Arrange
  2. Validate Graph

Auto Arrange

Auto Arrange

Auto Arrange helps with Nodes arrangement in the Dialogue Tree, rendering all Nodes in easier to read fashion.
❗ This is currently Alpha version and may lead to crashing the Editor

AutoArrange.mp4

As you can see, all Nodes are now easier to read. This function is using settings described in Auto Arrange chapter.

Graph Validation

Graph Validation

Graph Validation is split into two parts:

  1. Asset Validation
  2. Graph Validation

Actually, both validations show the same data, those are just two ways to display whether anything is wrong with Dialogue Tree or not.

Graph Validation

GraphValidation.mp4

Asset Validation

AssetValidation.mp4

Understand Graph Validation

Understand Graph Validation

Graph Validation, either Graph or Asset Validation, have the same format:

{name}: {error message}
Attribute Explanation
name Name attribute is dynamically populated, based on which component threw the error message. It returns the displayed Name of the component (for Nodes) or a user-friendly name (for Decorators).
error message Error message attribute is populated by the component, explaining what is wrong with it

Make dialogue data

Mountea Dialogue System is a soft-reference system. What does it mean? Well, you don't type dialogue lines and data to each Node, you use centralized data source (Data Tables) in order to achieve as data-driven approach as possible.

Advantages Disadvantages
Using data-driven approach allows you to have one source truth that remains the same for everything Requires creating a lot of data
When reusing the same data for different Node, eliminates chances of human error Not as flexible as customizable containers
Add once, use everywhere -
If something changes, only one place needs to be updated -

Mountea Dialogue System is using one Data Table with two structures. The plugin comes with an empty Data Table, so an easier way to start making your data is to copy that Data Table and use that copy. But let me explain how this works before we add some data.

Data Table

Data Table

Dialogue Data Table is located here: /Plugins/MounteaDialogueSystem_Binaries/Content/Data/ and contains example data.
This Data Table is using FDialogueRow structure, which is C++ based. This structure consists of:

Attribue Type Comment
Row Type ID int32 Value between 0-255, defines a specific type of Row, eg. Open shop or Close dialogue row.
Row Optional Icon Texture Optional texture which can be associated with Dialogue Row.
Dialogue Participant Text Override name of Participant. Currently has no logic applied to it.
Row Title Text This value is displayed for the player to choose from. Short title describing the underlying dialogue.
Dialogue Row Data Set of FDialogueRowData FDialogueRowData contains the actual dialogue sounds and texts. Each FDialogueRow can have multiple of those.
Dialogue Row Additional Data DataAsset Optional Data Asset which can contain more data. This is a way to easily extend C++ based structures in Blueprints.
Row GUID GUID Unique Dialogue Row GUID. Read-only.

To make a new data table right click, select Miscellaneous and select Data Table. Then select the DialogueRow option. You can follow the video below.

MakeDialogueRowDT.mp4

Fill Data Table

Data Table

Once you have your Data Table created, you can start filling in the data.

❗ If you plan to localize your Game, use String Tables to hold your texts

If you don't understand how to fill Data Table, you can take a look at Examples project, which contains playable Dialogue. Or you can take a look at how DT_TestDialogue is filled.

Use Dialogue Data

Data Table

Previous chapters explained how to make and fill Dialogue Data, now it's time to use that data in the Dialogue Tree.

You can simply follow the video. Only the following Node Types require Dialogue Data:

  • Answer Node
  • Lead Node
  • Complete Dialogue

Select the Node and in the Details, select Data Table and find your Dialogue Data Table.
❗ In 5.1 and newer versions there is an Engine bug which breaks filtration, so you have to choose the correct Data Table

Once you have selected the Data Table, Row Name become editable and shows a list of Rows in the selected Data Table. This list shows names as they are set in the Data Table.
❗ If you change the name of the Row, it will break all Dialogues, so be careful with renaming Rows after they are used

FillDialogueData.mp4

As you can see, once Row is selected the Preview is updated. Not all Node Types have this Preview feature, but those who do will always show localized content of the selected Row. This is to make your life easier, as you don't need to open the Data Table and search for the row just to see what is inside.

Intro to Decorators

This will be the most abstract and toughest part of the meal to digest. I will try my best to explain how Decorators work and what they are used for, however, chances are I will fail. Don't feel bad if you don't get it on the first try, this is an intermediate concept. And if you feel OK with this, you are amazing!

Before we start, if you feel lost, just jump into our Support Discord Channel where I will help you with anything as best as I can.

Now, let's start with Decorators.

What are Decorators

What are Decorators

Decorators are an abstract concept, additional functionality and/or added logic to existing fundamentals. Those base building blocks are in this case the Dialogue Nodes.

Decorators are, in this scope, triggerable objects, which can implement all kinds of logic. Decorators come with a specific set of functions, which are expanded below.

Function Description
InitializeDecorator Sets World context and context which IMounteaDialogueParticipantInterface requests this Decorator
CleanupDecorator This function is called once Dialogue has finished and is responsible for undoing/cleaning up dialogue-only logic (enabling input, switching back to player camera etc.)
ValidateDecorator Works as a safety measure to avoid calling broken Decorators with invalid references. If returns false, the provides an error message to Graph Validation. Invalid decorators disabled the whole Dialogue Tree!
EvaluateDecorator Blocks CanStartNode function of its Node. Provides a way to hide/show options dynamically to the player or progress unique dialogue paths.
ExecuteDecorator This function actually does the stuff, switching cameras, requestion animations to play etc.

Those functions provide a way to make Decorators to basically anything you like.

How to add Decorators

How to add Decorators

Adding decorators is super easy, but before we cover how to do it, let me explain how they behave, so you know how and in which order to add them. You can add Decorators to:

  1. Dialogue Tree
  2. Dialogue Node

Decorators are executed in the order as the list shows, starting from Dialogue Tree Decorators first, then going to Dialogue Node Decorators. Decorators are loaded in the order they are added to the list of Decorators.

And now how to add them.
The system is actually the same for both Dialogue Tree Decorators and Dialogue Node Decorators.

  1. Select either Graph or a Node
  2. In Details, open the Mountea|Dialogue category
  3. Click on + icon in GraphDecorators field
  4. Select the Decorator type you want to add
  5. Fill dialogue data where needed
HowToAddDecorator.mp4

As you can see in the video above, adding Decorators cannot be easier. The same logic applies to changing Decorator Type or adding some more.
❗ Save the Dialogue Tree or Validate Graph after you add Decorators to see if they require any data that you missed to fill out.

Stock Decorators

Stock Decorators

As you can see, there are some pre-made Decorators that come with the Mountea Dialogue System out of the box. Here is a simple list explaining what those are and what they do.

Decorator Type Description Allowed for Graph Allowed for Node
BPD_AllowOnlyFirstTime Blueprint This Decorator does nothing else but enables the selected Dialogue Node to be executable for the first time, therefore making that Node executable only once. 🟥 🟩
BPD_Debug_SwitchColour Blueprint Debug only Decorator, updates UE Mannequin Albedo Colour to see who is currently an Active Participant. 🟩 🟩
BPD_SwitchCameras Blueprint Switches between the Player's and NPC's camera according to who is the Active Participant at the moment. 🟩 🟩
Override Dialogue Participants C++ Allows to specify what Actors should replace current Dialogue Participants. This allows adding another party to the Dialogue, for example, switch from NPC 1 to NPC 2. 🟩 🟩
Override Dialogue Row Data C++ Allows to specify different Dialogue Row Data for selected Node. Useful for switching dialogue lines for very unique situations. 🟩 🟩
Override Only First Time C++ Allows new Dialogue Data, but only for the first time Node is being executed. 🟩 🟩
Save Node as Stat Node C++ Saves Active Node as Start Node, so next time Dialogue starts, this Node will be where it will start from. 🟥 🟩
Swap Participants C++ Sets the Active Participant to be the one who is not Active. 🟩 🟩
Use Random Dialogue Row Data C++ Uses random Dialogue Row Data with optional Range. Useful for repeated actions, like greetings or farewells. 🟩 🟩

Decorator Controls

Decorators Controls

Decorator controls are customized buttons for the Decorator entry. There are currently up to four controls.

Control Description Visible for C++
Arrow Currently allows deletion only 🟩
Magnifying Glass Opens decorator's folder 🟥
Wrench Opens decorator for edit 🟨
Question Mark Opens decorator's documentation page 🟩

🟨 means customizable in Editor Defaults, Allow Native Decorator Edit config.. If enabled, open IDE.


9. Dialogue Flow

Dialogue Flow explains how the Dialogue works, how to Start the dialogue, and what actions are done covers briefly Node Types as well.

Flow

Create Dialogue Tree

Here is the simplified flow of the Dialogue. Keep in mind that his flowchart is meant to roughly explain what happens and when rather than give you deep understanding of the code.

flowchart TD;
    A[Initialize Dialogue]-->A1[Failed];
    A[Initialize Dialogue]-->A2[OK];
    A2[OK]-->B[ManagerVerifyData];
    B[Manager Verify Data]-->B1[OK];
    B[Manager Verify Data]-->B2[Failed];
    B1[OK]-->C1[Open Dialogue UI];
    B1[OK]-->C2[Evaluate Nodes];
    C2[Evaulate Nodes]-->C2_1[Evaluate Decorators];
    C2_1[Evaluate Decorators]-->C2_2[Filter only Available Nodes];
    C2_2[Filter only Available Nodes]-->D2[For Each];
    D2[For Each Node]-->D1[Execute Decorators];
    D1[Execute Decorators]-->E1[Finish Up Data];
    E1[Finish Up Data]-->D2_1[Execute Node];
    D2_1[Execute Node]-->I1{Requires Input?};
    I1{Requires Input?}-->I1_1[Yes];
    I1{Requires Input?}-->I1_2[No];
    I1_2[No]-->F1[Start Dialogue Row Data];
    I1_1[Yes]-->I1_2_1[Wait for Selection...];
    I1_2_1[Wait for Selection]-->I1_2_1_1[Node Selected];
    I1_2_1_1[Node Selected]-->F1[Start Dialogue Row Data];
    F1[Start Dialogue Row Data]-->F2[Complete Dialogue Row Data];
    F2[Complete Dialogue Row Data]-->F3{Is Last?};
    F3{Is Last?}-->H1[Yes];
    F3{Is Last?}-->H2[No];
    H2[No]-->H2_1[Get Next Dialogue Row Data];
    H2_1[Get Next Dialogue Row Data]-- Next Dialogue Row Data -->F1[Start Dialogue Row Data];
    H1[Yes]-->H1_1[Complete Node];
    H1_1[Complete Node]-->K1{Is Last?};
    K1{Is Last?}-->K1_1[Yes];
    K1{Is Last?}-->K1_2[No];
    K1_1[Yes]-->L1[Complete Dialogue];
    K1_2[No]-- Next Dialogue Node -->D2[For Each Node];
    L1[Complete Dialogue]-->L1_1[Close Dialogue UI];
    L1[Complete Dialogue]-->L1_2[Cleanup Decorators];
    L1[Complete Dialogue]-->L1_3[Save Traversed Path];
    L1[Complete Dialogue]-->L1_4[Reset States];

    style A1 stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
    style B2 stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
    style D2 stroke:#fff,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
    style C2 stroke:#ffff00,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
    style C2_1 stroke:#ffff00,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
    style L1_2 stroke:#ffff00,stroke-width:2px,color:#fff,stroke-dasharray: 5 5

Node Types

Node Types
Node Type Node Description Node Details
Start Node * This Node will be added to the Dialogue Graph automatically when the Graph is created.
* This Node cannot be created manually.
* This Node cannot be deleted from Graph.
* Does not implement any logic, works as an Anchor starting point.
* Documentation
Answer Node * This Node represents the Player's answers.
* This Node requires the Player's input to be started.
* Requires Dialogue Data Table to work properly.
* Documentation
* Dialogue Data
* Data Preview
Complete Dialogue Node * This Node will complete Dialogue after the Player's input.
* Indicates that Dialogue can be manually closed.
* Requires Dialogue Data Table to work properly.
* Documentation
* Dialogue Data
* Data Preview
Lead Node * This Node represents NPC lines.
* This Node starts automatically upon reaching the Dialogue Tree.
* Requires Dialogue Data Table to work properly.
* Documentation
* Dialogue Data
* Data Preview
Return To Node * Provides the ability to return from Dialogue Node to a different one.
* Useful when dialogue branching disallows pin connections.
* Documentation
* Return Node Preview
Clone this wiki locally