This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

GS_DialogueSystem

Overview of the incredibly powerful Dialogue System and all of it’s contributing parts.

Dialogue Data Structure

Sequences

Clusters of dialogue meant to represent a single dialogue encounter. Used for Dialogue Selection, as well as sorting/organizing in the Editor.

Dialogue

The core of the system. The actual dialogue that will be presented within the game runtime.

Selectors

A system to allow branching out from a starting point into many destinations. Defined by the unique selectors processing of those branches.

Selector paths are affected by the preceding conditions, culling options that are invalid.

Option Selector & Options

The standard “Dialogue Option” method of allowing a player to select their responses.

Random Selector

A randomizer selector. This selector does not pause for input, it simply randomly selects where the branch will lead.

Pure Random & Weighted variants.

Events

Triggered functionality that encompasses many systemic outcomes, used intertwined with the dialogue paths being navigated.

Records

Integrated with the GS_Save record keeper system. This event type allows for changing records that affect the rest of gameplay, as well as dialogue conditions.

Actions

A broad reaching type. Using GS_Actions and likely more. Actions can drive unique behaviour in and outside of the Dialogue Sequence.

Things like activating and deactivating things, spawning, character moving and pathfinding.

Additionally allowing the use of custom actions, like RPGStats changing stat, or vitality. Inventory giving/taking an item, or affecting currency.

Posing

A targeted event type that supports the many data points used for shifting and changing an actors state.

Pointed at actors it affects:

Poses, Emotional state, Profile Images, and the blending of all these things.

Conditions

A very critical system. Conditions are meant to evaluate MANY possible data points as a means to filter possible outcomes of navigating dialogue.

As a standard, uses Records to determine if a dialogue path is available to the navigation system. Greater than, Less than, equal, not equal evaluations used with the Records integer format.

Additionally allowing the use custom conditional evaluators, like RPGStats enabling stat or vitality checks. Inventory enabling “hasItem”, and “hasCurrency” checks.


Dialogue Editor

The in O3DE Editor GUI for authoring dynamic and complex branching dialogue.

It includes interfaces for editing settings, as well as defining actors and many meta-data points around presenting the actors in dialogue sequences.


Dialogue Sequencer

The actual system that pressents the dialogue at runtime, using the dialogue data to properly deliver the dialogue experience.


Built in Dialogue UI

Overlay UI

In-world UI

Subtitle UI


Dialogue Predefined Actors

Actors Outline

Actors Names, Profile images, pose animations, pose images

Pose groupings based on emotion category.

1 - Data Structure

Meta Structure

DialogueDatabase{
  "settings":
  {
    "ui":{
      #IF USING_GS_UI
      "windowOpenUiProfile": "../DisplayProfiles/SoftFade.uianimprofile",
      "profileImageUiProfile": "../DisplayProfiles/AvatarChange.uianimprofile"
      #ENDIF
    },
    "sequencing":{
      "defaultDelay": "0.5",
      "defaultContinue": "instant",
      "defaultTypewriterSpeed": "6"
    }
  },
  
  "actors":
  {[
    {
      "actorName": "perry",
      "actorDisplayName": "Perry",
      "profileImages":{[
        {
          "profileAttitude": "default",
          "imagePath": "../image/path/i.png"
        }
      ]},
      "poses":{[
        {
          "poseAttitude": "default",
          "poseName": "idleStand"
        }
      ]}
    }
  ]},

  "sequences":
  {[
    {
      "sequenceId": "0001",
      "sequenceName": "FirstSequence",
      "nodes":{[...]}
    }
  ]}
}

Sequences

Outline

You’ve upset Perry so they’ve confronted you.

You can antagonize Perry further, driving them to be angry with you.

Or you can apologize. They’ll brush you off normally, but if your charisma is high enough, you’ll leave on good favour.

Delays in the conversation pace between nodes.

Text can remain open, or close, then reopen at next text.

"nodes":{[
  {
    "id": "0001",
    "type": "start",
    "connections": 
    {
      {
        "to":"0002",
        "conditions":{}
      }
    }
  },
  {
    "id": "0002",
    "type": "text",
    "actor": "perry",
    "actorTargetId": "perryStandingOnTheBalcony",
    "text": "How dare you!?",
    "closeText": "false",
    "continue": {
      "type": "displayAndDelay",
      "delay": "default"
      },
    "connections": 
    {
      {
        "to":"0003",
        "conditions":{}
      }
    }
  },
  {
    "id": "0003",
    "type": "options",
    "options": 
    {[
      {
        "optionNumber": "0001",
        "text":"Because I can!",
        "connections": {[
            {
              "to":"0004",
              "conditions":{}
            }
        ]}
      },
      {
        "optionNumber": "0002",
        "text":"I'm so sorry!",
        "connections": {[
            {
              "to":"0005",
              "conditions":{}
            },
            {
              "to":"0006",
              "weight", "10",
              "conditions":{[
                "greaterThan":{
                  "checkValue": "charisma"
                  "evaluationValue": "10"
                }
              ]}
            }
        ]}
      }
    ]}
  },
  {
    "id": "0004",
    "type": "SetRecord",
    "recordName": "PerryAngry",
    "recordValue": "1",
    "connections": 
    {
      {
        "to":"etc..",
        "conditions":{}
      }
    }
  },
  {
    "id": "0005",
    "type": "text",
    "actor": "perry"
    "text": "How can I forgive you after that?",
    "closeText": "true",
    "continue": {
      "type": "waitForInput",
      },
    "connections": 
    {
      {
        "to":"etc...",
        "conditions":{}
      }
    }
  },
  {
    "id": "0006",
    "type": "text",
    "actor": "perry"
    "text": "Charisma Success: Oh, that's okay, you were doing your best.",
    "closeText": "true",
    "continue": {
      "type": "afterSeconds",
      "time": "3.5"
    "connections": 
    {
      {
        "to":"etc...",
        "conditions":{}
      }
    }
  }
]}

Types

  • Systemic

  • Start

  • Restart

  • Jump to New Sequence = “name/id“

  • Jump to Specific Node = “name/id“

  • Random

  • Dialogue

  • Text

  • Performance

  • Sound

  • Options

  • Actions

  • SetRecord

  • Trigger Something…

Sequence 2

Outline

You return to Perry. They greet you based on their disposition.

The delay in image/pose change makes a painful gap between when they talk to you.

"nodes":{[
  {
    "id": "0001",
    "type": "start",
    "connections": 
    {
      {
        "to":"0002",
        "conditions":{}
      },
      {
        "to":"0003",
        "conditions":{[
          "checkRecord":{
            "recordName":"PerryAngry",
            "evaluation":"equalTo",
            "recordValue":"1"
          }
        ]}
      }
    }
  },
  {
    "id": "0002",
    "type": "text",
    "actor": "perry",
    "targetActorId": "perryInTheWorkshop",
    "text": "What do you need?",
    "closeText": "false",
    "continue": {
      "type": "displayAndDelay",
      "delay": "default"
      },
    "connections": 
    {
      {
        "to":"0005",
        "conditions":{}
      }
    }
  },
  {
    "id": "0003",
    "type": "performance",
    "actor": "perry",
    "pose": "aggravated",
    "profileImage": "aggravated",
    "continue": {
      "type": "displayAndDelay",
      "delay": "0.1"
      }
    "connections": 
    {
      {
        "to":"0004",
        "conditions":{}
      }
    }
  },
  {
    "id": "0004",
    "type": "text",
    "actor": "perry",
    "targetActorId": "perryInTheWorkshop",
    "text": "Oh, it's you again...",
    "closeText": "false",
    "continue": {
      "type": "displayAndDelay",
      "delay": "default"
      },
    "connections": 
    {
      {
        "to":"0005",
        "conditions":{}
      }
    }
  }
]}

Notes

Whenever a sequence hits a dead end, it closes the dialogue.

Maybe we add an “onEnd” possible processing.

Condition branches will select the most elaborate first, stepping down until no condition. Connection “Weight“ will manually set prio.

I have gone for categorical “types”, but we may want to just go hyper granular and do one type per node.

So “Performance” would become:

  • ProfileImage

  • Pose (body idle anim)

  • Expression (facial idle anim)

  • Emote (one and done full animation)

  • PathTo

Actions would become:

  • SetRecord

  • AffectStats

  • AffectCurrency

  • Affect Inventory/Equipment

  • Enable/Disable Entity

  • Start/Stop Animation

  • Start/Stop Timeline

  • Change PhantomPriority, Enable/Disable Cam

  • etc.


Options can have conditions, and if they are not met, they will not be available. Options Nodes will require at least ONE non-conditional.

(Or we just exit with no options, like no continuation to a chain.)


actorTargetId is to allow for multiple performers of the same name in a level, but target the particular sequence to THAT particular version of the actor. This is for performance commands, and for inworld speech bubble tracking.


Conditions

Any node can have any number of conditions.

Has can always be !Has.

Numerical conditions always have the operators: greater, less, equal, not-equal

  • Record

  • HasItem

  • StatsValue

  • HasCurrency

  • HasEquipped

  • HasStatusEffect

2 - Editor

Information on the in engine GUI.

Performer

Performer Targeting

Sequences

Localization

Nodes

Start / End

End

Restart

New Sequence

Specific Node

Dialogue

Text

Animated/Stylized Text

Performance

Posing

Pathing

Portrait

Trigger Timeline

Sound

2D

3D

Option Menu + Choices

Actions + Set Record

Conditions

How to use conditions to determine path.

Not always related to player choice.

Timeline Integration

Start Sequence

Continue Dialogue

UI

O3DE Editor Menu

Editor GUI

Adding icon to editor is a complex problem, outlined by Nick.

Sequence Window

The Inspector Window can have any number of sub-tabs. Which might be valuable for adding unique settings, or multiple Conditions, for example. Basically component-ize different node types.

System Window

Actors Window

Ingame UI

3 - Sequencer

The runtime system that presents the dialogue in gameplay.

Sequences

4 - Built-in UI

UI

4.1 - Typewriter

5 - Actors

Meta Info

Emotion Categories

Profile Image Sets

Animated Posing Sets