Skip to main content

What is Dialogue Engine?

Dialogue Engine is a powerful yet minimalistic dialogue system for the Godot Game Engine, designed for creating branching narratives with player choices, conditions, dynamic text formatting, and metadata support. Unlike traditional visual node-based dialogue editors, Dialogue Engine allows you to write your entire dialogue tree directly in GDScript, giving you the full power of code while maintaining simplicity and flexibility.
Dialogue Engine is designed to be GUI-agnostic. It manages the dialogue logic and flow, while you provide the visual presentation using your own GUI nodes.

Why Use Dialogue Engine?

Code-First Approach

Write dialogue directly in GDScript - no need for external editors or visual node graphs. Perfect for developers who prefer code over visual tools.

Highly Flexible

Bring your own GUI implementation. The engine handles the dialogue logic while you control the presentation layer completely.

Powerful Features

Support for branching, conditions, player choices, dynamic text formatting, metadata, and more - all in a clean, minimal API.

Debugging Support

Automated dialogue graphing and integration with Godot’s debugger helps you visualize and debug complex dialogue trees.

Key Features

  • Complex Dialogue Trees: Create branching narratives with multiple choices, conditions, and paths using branch IDs
  • Conditional Branching: Support for dynamic decision-making with user-defined callables
  • Player Choices: Add multiple options for players, each linked to specific dialogue entries
  • Dynamic Text Formatting: Use callables, arrays, and dictionaries for personalized dialogue
  • Named Entries: Reference dialogue entries by name for easy lookup
  • Metadata Support: Attach custom data like actor names, emotions, or events to dialogue entries
  • Signal System: Comprehensive events for dialogue lifecycle (started, continued, finished, canceled)
  • Simple to Use: Just write the dialogue in GDScript
  • Easy to Customize: Bring your own GUI nodes for presentation
  • Visual Debugging: Automated dialogue graphing integrated with Godot’s debugger

How It Works

The dialogue engine consists of two main classes:

DialogueEngine

The main class that manages the dialogue tree. It provides methods to:
  • Add text and conditional entries
  • Advance through the dialogue
  • Handle branching logic
  • Emit signals for dialogue events
Key Signals:
  • dialogue_started - Emitted when the first entry is read
  • dialogue_continued(DialogueEntry) - Emitted when a text entry is reached
  • entry_visited(DialogueEntry) - Emitted for all visited entries
  • dialogue_finished - Emitted when the dialogue completes
  • dialogue_canceled - Emitted when the dialogue is canceled

DialogueEntry

Represents a single node in the dialogue tree. Each entry can contain:
  • Text: The dialogue content to display
  • Options: Player choices with goto IDs
  • Conditions: Boolean callables for branching
  • Goto IDs: Jump to specific entries
  • Metadata: Custom data (actor names, emotions, etc.)
  • Format Data: Dynamic text formatting with callables

Requirements

Dialogue Engine requires Godot 4.2.1 or higher.

Simple Example

Here’s a minimal example to get a taste of how Dialogue Engine works:
var dialogue_engine : DialogueEngine = DialogueEngine.new()
dialogue_engine.add_text_entry("Hello")

var print_dialogue : Callable = func (dialogue_entry : DialogueEntry) -> void:
    print(dialogue_entry.get_text())

dialogue_engine.dialogue_continued.connect(print_dialogue)

dialogue_engine.advance() # prints "Hello"
dialogue_engine.advance() # Nothing prints -- the dialogue finished.
dialogue_engine.advance() # prints "Hello" again -- the dialogue restarted
dialogue_engine.advance() # Nothing prints -- the dialogue finished.

Next Steps

Installation

Learn how to install the Dialogue Engine plugin in your Godot project

Quickstart

Create your first dialogue in minutes with our step-by-step guide

Build docs developers (and LLMs) love