Skip to main content

Node-Based Dialogue System

A custom Unity editor tool for branching dialogue with a visual node system. Built to empower writers and designers to create scalable, gameplay-connected conversations without coding.

January 15, 2024
UnityC#Dialogue SystemGame DevelopmentTools
Node-Based Dialogue System Unity editor interface showing branching conversation nodes

Node-Based Dialogue System

This is a Unity tool I built when I realised that writing dialogue with "if" statements was… well, awful.
What started as “I’ll just hack something together” grew into a fully-fledged, visual node editor that lets writers and designers build branching conversations without touching a line of code.


Why This Exists

The project grew out of a cosy little space game prototype. I didn’t have much mapped out, but I knew talking to characters was going to matter, so I figured I’d start there while the rest of the game was still a sketch. Pretty quickly it became obvious that a node-based system was the only sane way forward if I wanted scale, flexibility, and a tool others could actually use without swearing at me.


Core Features

Visual Node Editor

  • Drag & Drop workflow connect nodes like you’re sketching on a whiteboard
  • GraphView-based editor with zoom, pan, and minimap
  • Choice, condition, and event nodes to handle branching logic
  • Real-time flow previews so you can see conversations unfold as you build them

Dialogue Logic That Plays Nice

  • Branching conversations that don’t collapse under complexity
  • Variables and conditions to unlock or hide choices depending on state
  • Integrated action system (open shop, give item, trigger quest, swap scenes)
  • Localization-ready so conversations aren’t locked to one language

Performance That Holds Up

Stress-tested up to 1,000+ nodes and connections in a single graph without turning Unity into molasses. ScriptableObjects keep everything light, references intact, and updates easy to manage.


Under the Hood

Here’s a peek at the backbone. These ScriptableObjects store the dialogue graphs and individual nodes.

Dialogue Container

// DSDialogueContainerSO.cs using System.Collections.Generic; using DialogueSystem.Utilities; using UnityEngine; namespace DialogueSystem.ScriptableObjects { public class DSDialogueContainerSO : ScriptableObject { [field: SerializeField] public string FileName { get; set; } [field: SerializeField] public SerializableDictionary<DSDialogueGroupSO, List<DSDialogueSO>> DialogueGroups { get; set; } [field: SerializeField] public List<DSDialogueSO> UngroupedDialogues { get; set; } } }
// DSDialogueSO.cs using System.Collections.Generic; using DialogueSystem.Data; using DialogueSystem.Enums; using UnityEngine; namespace DialogueSystem.ScriptableObjects { public class DSDialogueSO : ScriptableObject { [field: SerializeField] public string DialogueName { get; set; } [field: SerializeField][field: TextArea] public string DialogueSpeaker { get; set; } [field: SerializeField][field: TextArea] public string Text { get; set; } [field: SerializeField] public List<DSDialogueChoiceData> Choices { get; set; } [field: SerializeField] public DSDialogueType DialogueType { get; set; } [field: SerializeField] public bool IsStartingDialogue { get; set; } } }

Highlights

Visual Node Editor

Drag-and-drop interface with real-time previews and multiple node types for intuitive authoring.

Advanced Dialogue Logic

Dynamic branching, variables, and conditions that allow writers to create deeply reactive narratives.

Scalable Performance

Efficient data structures, memory management, and streaming support to handle large-scale dialogue trees.

Technology Stack

Unity
C#
UI Toolkit
Scriptable Objects
Unity Graph View
Custom Event System

Inspired by This Project?

Let's work together to create something equally amazing for your next Unity project. Whether it's VR, EEG visualization, or game development, I'm here to help.