StorylineSystem Storyline & Dialogue

## :clapper_board: KEY FEATURES

### 1. Visual Graph Editor

- Full EdGraph-based node editor with drag-and-drop workflow

- 8 built-in node types: `Dialogue`, `Choice`, `Branch`, `Sequence`, `Subplot`, `Action`, `Wait`, `Random`

- Connection validation, auto-layout, zoom-level configuration

- Right-click context menus, box selection, search & diff tools

**How to Use:**

1. Create a **Storyline Asset** via `Content Browser β†’ Miscellaneous β†’ Storyline Asset`

2. Double-click to open the **Graph Editor**

3. Right-click on the canvas to add nodes

4. Drag pins to connect nodes β€” the system validates compatible connections automatically

5. Use **Ctrl+F** for search, **Ctrl+D** for asset diff comparison

-–

### 2. AI-Assisted Content Generation

- **Polish** dialogue lines with style hints and temperature control

- **Auto-generate** choice options with fill / replace / append strategies

- **Complete dialogue chains** from subgraph topology β€” AI fills all empty nodes

- Editable prompts, retry with exponential backoff, cancel in-flight requests

- Compatible with any **OpenAI-compatible API provider** (OpenAI, Azure, local LLM, etc.)

**How to Use:**

1. Select a Dialogue or Choice node in the graph

2. Open the **AI Assistant panel** (Window β†’ Storyline AI)

3. Choose a mode: `Polish` / `Options` / `Linked` / `Fill`

4. Configure style hints, temperature, and output language

5. Click **Generate** β€” results appear in the preview panel

6. Review and **Apply** or **Discard** the AI suggestions

-–

### 3. Condition & Event System

- **Strategy + Composite** pattern: `AND`, `OR`, `NOT` combinators

- **Blueprint-extensible** β€” create custom conditions and events without writing C++

- Built-in: variable conditions, gameplay tag checks, actor state queries

- Every node type supports conditions (entry gate) and events (on-enter trigger)

**How to Use:**

1. Select a node β†’ open the **Details** panel

2. Under **Conditions**, add condition entries and choose a combinator (AND/OR/NOT)

3. Create custom conditions by subclassing `UStorylineCondition` in Blueprint

4. Under **Events**, add event entries β€” these fire when the node becomes active

-–

### 4. Runtime-Ready Execution Engine

- **Zero editor dependency** at runtime β€” ships clean in packaged builds

- Full lifecycle: `Start β†’ Pause β†’ Resume β†’ Stop β†’ Interrupt`

- Async action support with completion callbacks

- **Subplot call stack** for nested storylines (plays a sub-story and returns)

- **Save/Load** snapshot support for full persistence

**How to Use:**

- Attach `UStorylineComponent` to any Actor

- Call `StartDialogue(StorylineAsset)` to begin execution

- The component fires delegates (`OnDialogueLine`, `OnChoicePresented`, etc.) β€” bind your UI to them

- Use `Pause()` / `Resume()` for gameplay interruptions

- Call `SaveState()` / `LoadState()` for save game integration

-–

### 5. Type-Safe Variable System

- Types: `Bool`, `Int`, `Float`, `String`, `Name`, `Object`, `Vector`, `Rotator`, `Color`, `Tag`

- `{VariableName}` text substitution in dialogue lines

- **β€œValue or Variable Reference”** pattern β€” author either a literal value or a variable lookup

- Variables persist across save/restore cycles

**How to Use:**

1. Open the **Storyline Asset** β†’ **Variables** tab

2. Add variables with names, types, and default values

3. In dialogue text, write `{PlayerName}` to substitute at runtime

4. In conditions, use variable references to compare against thresholds

-–

### 6. Blueprint-Friendly Component

- `UStorylineComponent`: drop on any Actor, bind a Widget, call `StartDialogue`

- **16+ delegates** exposed as `BlueprintAssignable`

- Built-in `UDialogueWidget` base class for rapid UI creation

- Helpers for: portrait loading, voice playback, montage animation

**How to Use:**

1. Add `UStorylineComponent` to your character or dialogue manager Actor

2. Create a Widget Blueprint deriving from `UDialogueWidget`

3. Bind the widget to the component

4. Call `StartDialogue(YourStorylineAsset)` β€” the widget automatically responds to dialogue events

-–

### 7. Full Debugger

- **Breakpoints** on any node

- **Step Into / Step Over / Step Out** execution control

- **Live variable inspection** during PIE (Play In Editor)

- See state transitions in real-time as the game runs

**How to Use:**

1. Right-click any node β†’ **Toggle Breakpoint**

2. Enter PIE (Play In Editor)

3. Open **Window β†’ Storyline Debugger**

4. Use the debug toolbar to step through execution

5. Hover over variables to inspect current values

-–

### 8. Cinematic Integration

- **Level Sequence Player** for cutscenes

- Camera shot tags, montage triggers, voice-over support

- `Cinema` node type with completion notifications

**How to Use:**

1. Add a `Cinema` node to your storyline

2. Assign a **Level Sequence** asset

3. Optionally add camera shot tags and montage triggers

4. The storyline pauses during the cinematic and resumes on completion

-–

### 9. Production Features

- **Data-driven node registration** via JSON config (no 450+ empty C++ classes)

- Built-in **version migration** for assets

- **Find-in-Storyline** search across all assets

- Side-by-side **asset diff** comparison

- **Undo/Redo** throughout the editor

-–

## IDEAL FOR

- βœ“ Visual Novels & Dialogue-Heavy Games

- βœ“ RPG Quest Systems

- βœ“ Branching Narrative Experiences

- βœ“ Interactive Cinematics

- βœ“ Any project needing structured dialogue trees

-–

## 5.8 MCP (Model Context Protocol) Support

Narrative Forge exposes its full editing capabilities via the **MCP (Model Context Protocol)** β€” enabling AI coding assistants and external tools to interact with your storylines programmatically.

**Capabilities:**

- **Graph Operations**: create, delete, connect, and rearrange nodes remotely

- **Content Editing**: read and write dialogue text, speaker names, emotions, choice options

- **AI Context Gathering**: extract upstream/downstream context for any node

- **Batch Operations**: fill empty nodes, auto-generate dialogue chains

- **Asset Management**: search, duplicate, and migrate storyline assets

- **Localization**: trigger localization collection for all text fields

- **Debugging**: set breakpoints, inspect runtime state, capture screenshots

**How to Use:**

1. StorylineToolset auto-registers with the MCP server β€” no manual setup required

2. Connect your MCP client to the UE5 editor’s MCP server

3. Use tools like `storyline_generate_dialogue`, `storyline_edit_node`, `storyline_get_context`

4. All operations are reflected in real-time in the open graph editor

> See the `storyline-mcp` skill documentation for the full API reference.