Yarn Spinner icon

Yarn Spinner

Standard softwareFOSS · MIT

MIT screenplay-style NPC dialogue engine for Unity & Godot

Free (MIT) · Secret Lab · Standard software workflow; Steam AI disclosure does not apply.

AI
Standard
IP
Commercial-Safe IP
Engines
Unity, Godot, Unreal
Platforms
Windows · macOS · Linux · Web · CLI
Version
2.4
Technical Summary

Yarn Spinner is a free, MIT open-source screenplay-style NPC dialogue engine by Secret Lab for Windows, macOS, Linux, Web, and CLI. Powering Night in the Woods, Dredge, and Cult of the Lamb, it pairs clean .yarn scripts and a VS Code node graph with automatic CSV/XLIFF localization and Unity, Godot, and Unreal runtimes.

Technical Overview

Architecture and Production Workflow

Developed by Secret Lab (v2.4), Yarn Spinner is engineered around how narrative designers, gameplay programmers, translators, and voice actors actually collaborate during production. Writers author plain-text .yarn scripts using an intuitive screenplay syntax (Character: Dialogue line), branching -> shortcut options, <<if $visited_dock>> state checks, and custom engine commands like <<camera_shake 0.4>> or <<give_item "Lantern">>. Simultaneously, Yarn Spinner's official VS Code Extension renders an interactive side-by-side visual node graph so writers can organize scene topology spatially while keeping every change as clean, Git-mergeable plain text.

Where Yarn Spinner shines brightest in shipping pipelines is localization and voice-over (VO) management:

  • Stable Line IDs: The ysc CLI compiler automatically injects persistent #line:0a4f9c tags onto every spoken line without manual bookkeeping.
  • Turnkey String & Audio Tables: Exports translator-ready .csv and .xliff spreadsheets plus voice-recording scripts; at runtime, localized translations and matching 0a4f9c.ogg audio clips bind automatically by line ID even if writers reorder scenes.
  • Compiled Bytecode Runtimes: Compiles .yarn scripts into fast Protobuf .yarnc bytecode executed by official Unity, Godot 4 (.NET C#), Unreal Engine, and JavaScript (yarn-bound) runtimes.

Pricing, Licensing, and Commercial Rights

The entire Yarn Spinner compiler, language runtime, VS Code visual editor, web playground, and GitHub integrations for Unity, Godot, and Unreal are 100% free under the MIT License (0% royalties, zero line caps). Secret Lab offers optional paid convenience packages and add-ons on the Unity Asset Store and itch.io to fund open-source maintenance, while building directly from GitHub/OpenUPM remains completely free for commercial releases.

Strengths and Tradeoffs in Studio Pipelines

Pipeline DimensionYarn Spinner AdvantageLimitation / When to Swap
Localization & Voice ActingAutomatic #line: tagging, CSV/XLIFF extraction, and VO clip mapping save weeks of pre-launch localization engineeringDeep literary weaves with dense mid-sentence conditional prose variations are cleaner in Inkle's ink
Hybrid AuthoringCombines Git-friendly plain-text screenplay files with a live visual node map inside VS CodeOfficial YarnSpinner-Godot package requires the C# (.NET) edition of Godot 4
Proven Indie PedigreeShipped on PC and all major consoles in Dredge, Cult of the Lamb, A Short Hike, and Night in the WoodsLacks built-in typed item/faction RPG entity spreadsheets (use articy:draft X if you want an all-in-one CRPG database)

AI Transparency & Steam Disclosure

Standard Software

Procedural math, physics, or manual authoring software.

Steamworks guidance: Standard software workflow; Steam AI disclosure does not apply.

Technical FAQ about Yarn Spinner

Is Yarn Spinner free for commercial games, or do I have to buy the Unity Asset Store package?
Yarn Spinner is 100% MIT open source and completely free for commercial games regardless of studio revenue. Installing via Git URL / OpenUPM or GitHub releases costs $0; purchasing the official Unity Asset Store or itch.io bundle is purely an optional convenience to support Secret Lab.
How does Yarn Spinner handle multi-language localization and voice-over audio?
Running the Yarn compiler stamps a permanent #line: ID onto every dialogue line and generates CSV/XLIFF tables for translators. Dropping translated CSVs and voice files named after each #line: ID into Unity or Godot automatically swaps text and plays synchronized VO per locale.
Does Yarn Spinner work with Godot 4?
Yes. YarnSpinner-Godot is maintained as an official MIT-licensed integration targeting Godot 4 .NET (C#), providing ready-to-use DialogueRunner scene nodes, custom [YarnCommand] C# method attributes, variable storage, and full support for compiled .yarnc bytecode and localized CSV string tables.

More tools like Yarn Spinner