Skip to main content

Introduction to the Dialogue System

DIALOGUE-SYSTEM is a conversation-focused module for building interactive dialogue in Unity projects.

It handles everything from player-to-NPC conversations and branching dialogue trees through to mood-driven presentation, cinematic camera framing, and agent-to-agent background chatter.

info

DIALOGUE-SYSTEM is a separate module from CIVIL-AI-SYSTEM. It can run standalone with the Shared layer, or integrate with CIVIL-AI-SYSTEM for behaviour tree pausing, world time, and shared item catalogues.

What the module owns

  • player-to-agent conversation flow
  • agent-to-agent headless conversations
  • dialogue tree data and two authoring editors (flowchart and script)
  • response and option presentation
  • beat-based content playback (text, audio, animation, mood, camera)
  • token system for dynamic text variables
  • typewriter text reveal and character portraits
  • mood and non-verbal presentation (including lip sync)
  • cinematic dialogue camera with automatic shot selection
  • overhead world-space dialogue text
  • per-agent blackboard state
  • conversation policies (end conditions, world pausing, player control, cursor)
  • conversation triggers for autonomous agent-to-agent chatter
  • input handling for dialogue interactions
  • localisation of dialogue text and audio
  • debug tools for runtime diagnosis

How it fits into the architecture

The Dialogue module uses the same shared bootstrap and service registry model as CIVIL-AI-SYSTEM.

At startup:

  1. BardTreeModuleBootstrap creates the shared service registry
  2. DialogueModuleRegistrar registers at Order 200
  3. the registrar wires all dialogue services into the registry
  4. initialization resolves shared services and adds runtime components

The module is identified as bardtre.dialogue and declared through DialogueModule.

Valid install combinations

The architecture supports three configurations:

  • Shared + CivilAI -- simulation only, no dialogue
  • Shared + Dialogue -- conversations only, no simulation
  • Shared + CivilAI + Dialogue -- full experience with both systems

For most users building a medieval town with interactive NPCs, the third option is the most practical setup.

How to think about the two modules

A useful mental model:

  • CIVIL-AI-SYSTEM drives what agents do in the world (work, needs, movement, ownership)
  • DIALOGUE-SYSTEM drives what agents say and how conversations flow

They are independent systems that share a common foundation. When installed together, the integration layer handles coordination automatically.

Reading tip

Menu paths in this wiki are written the way Unity shows them, starting from the top menu bar. So BardTreeLtd/Dialogue/Module Settings means: click BardTreeLtd in the menu bar at the top of the editor, then Dialogue, then Module Settings.

Asset creation paths start with Assets > Create, which is the same menu you get by right-clicking in the Project window.

Next step

Continue to Chat Trees, then Authoring Editors to learn how to create content.