AST and Flow System

AST (Abstract Syntax Tree)

AST (Abstract Syntax Tree) is the core intermediate representation in DSL Forge.

Key features:

  • Intermediate Representation AST is not directly executable. Instead, it represents the logic and structure of scripts, including commands, arguments, nested calls, and conditional branches. It’s a clear, structured way to express your game's logic.

  • Can Be Saved as Text Files or ScriptableObject Assets AST can be serialized as plain text or Unity Assets. This makes it easy to manage in version control systems, compare changes, and roll back edits. It’s perfect for team collaboration.

  • Supports Version Control and Visual Editing AST’s structured format is ideal for visual editors. Node-based editors can load, edit, and save AST structures seamlessly. Designers and non-programmers can modify logic visually without touching code.


Example Uses

  • Teams can edit AST using text or the visual editor

  • Asset files can be versioned for team workflows

  • Automated tools can analyze and validate AST correctness


Flow

Flow is the final runtime-executable format.

Key features:

  • AST → Flow Transformation At runtime, the interpreter converts AST into Flow objects. Flows are effectively "compiled" versions of AST, retaining commands and parameters but stripping editor-only metadata.

  • Designed for Efficient Runtime Execution Flows are lightweight, with no unnecessary data. They’re optimized for fast in-game execution, making them ideal for dialogues, quest systems, and event triggers.

  • Supports Serialization and Network Transmission Flows can be saved locally or packaged and delivered over the network. This enables hot updates, DLC content, and robust modding systems. It truly supports content extensibility.


Workflow in the Unity Editor

Within Unity, DSL Forge’s editor workflow looks like this:

1️⃣ Text Mode or Visual Mode → generates AST 2️⃣ AST can be saved as files or Assets 3️⃣ AST is converted into Flow for runtime execution

This enables designers and programmers to collaborate efficiently in a data-driven content production pipeline.

Last updated