Tree-Level
Dialogue System

Game MechanicNarrative SystemsBranching LogicUnreal Engine 5

A branching dialogue system built on a tree-level architecture — supporting dynamic NPC conversations with multi-path narrative outcomes for the Sunflower game jam.

Add dialogue node graph screenshot here

Blueprint node graph for tree-level dialogue — Sunflower, P1 Games 2024

Making conversations feel like choices

Sunflower required NPCs that could respond differently based on player actions and prior dialogue. A linear system wouldn't support the narrative depth the team wanted. I designed and built a tree-based system that could branch, track state, and resolve back to shared narrative paths without duplicating content.

Technical breakdown

  • Tree-level architecture — dialogue modelled as a graph of nodes, each containing text, speaker, and a list of response options branching to child nodes
  • State tracking — visited node IDs stored in a game instance variable so dialogue history persists across scenes
  • Convergence paths — multiple branches designed to merge back to shared story beats, reducing content duplication
  • Blueprint integration — dialogue triggered via NPC interaction component; UMG widget reads node data and populates response buttons dynamically

What this taught me

Building this system made me think about dialogue not as writing but as data structure design. The hardest part wasn't the code — it was deciding how to model narrative branches so a non-programmer writer on the team could maintain it.

Research Question

How can dialogue system architecture be designed to be simultaneously expressive for writers and efficient for real-time engines — and where does graph theory meet narrative design?