Introduction

plotknot is a minimal, extensible narrative scripting tool for game developers. It provides a clean, Markdown-like language for writing branching stories, dialogue trees, and interactive narratives — then compiles them to engine-ready data files.

Why plotknot?

Existing narrative tools (Yarn Spinner, Ink, Loreline) each make strong choices about syntax, runtime coupling, and extensibility. plotknot takes a different approach:

How it works

.plotknot source  →  Compiler (Nim)  →  .lua data file  →  Runtime (Lua)  →  Your game
  1. You write narrative content in .plotknot files
  2. The compiler lexes, parses, validates, and generates output
  3. The runtime loads the data and drives the story at game time
  4. Your game code calls the runtime API to advance dialogue and respond to choices

Philosophy

Feature overview

Feature Description
Sections Organize narrative into named nodes with headings
Choices Branching with optional conditions
Variables Set and use variables with expressions
Conditions if/else blocks for dynamic content
Game interop Call game functions, receive results
Localization Tag lines with localization keys
Extensibility Runtime hooks: on_call, register_function, on_line_type
LSP Language server for editor integration
CLI Compile, validate, and watch commands

Next steps