Architecture

The project is organized around a clear editor/runtime split, with graph assets and runtime playback as the core architectural boundary.

Assemblies: DialogSystem.Runtime and DialogSystem.Editor AI Providers is only required for AI features

Repository structure

PathResponsibility
Assets/DialogGraphSystem/Scripts/RuntimePlayback, UI, settings, history, transcripts, utilities.
Assets/DialogGraphSystem/Scripts/EditorGraph authoring, import/export, settings editor, GraphView tooling.

Runtime data flow

Game code or UI event
    -> DialogManager.PlayDialogByID / StartDialog
    -> DialogGraph lookup
    -> Graph traversal
       -> Dialog / choice node -> DialogUIController
       -> Action node -> DialogActionRunner -> configured handler or UnityEvent
    -> DialogManager line / choice events -> DialogueHistory
    -> branch path recorded as choices are resolved

GetLastPlayedDialogTranscript
    -> current graph + recorded branch path -> DialogGraphTranscriptBuilder

The transcript builder reconstructs authored text from the current graph and recorded path. It does not preserve the exact localized or interpolated text that a player saw.

Editor authoring flow

DialogSystemMainWindow (active entry point)
    -> GraphTabController
    -> DialogGraphView
    -> Node views and edges
    -> DialogGraph asset plus node sub-assets
    -> Save / Load / Undo

Main extension points

  • IActionHandler implementations for custom gameplay actions
  • DialogActionRunner conversation and global action sets
  • replacement or extended UI around DialogUIController
  • new reveal effects implementing ITextRevealEffect
  • new transcript build modes in DialogGraphTranscriptBuilder

Coupling and technical debt notes

  • The runtime relies on specific Resources paths for settings and demo assets.
  • The graph authoring flow depends on UnityEditor.Experimental.GraphView, which works but is not future-proof long term.
  • Several systems assume the included prefab structures or field wiring patterns, so prefab replacement should be done carefully.

Suggested visuals

Graph editor overview

MarketFriend graph overview in the Graphs workspace, with its node canvas, sidebar, and minimap.

Best visual anchor for the editor/runtime split.