Yarn Spinner – try a narrative game tool in your browser
Yarn Spinner is an open-source dialogue system for game developers. Try writing and running branching conversations right in your browser.
TL;DR
TL;DR: Yarn Spinner is an open-source dialogue engine for games. Its new web demo lets you write and preview branching Yarn scripts entirely in the browser — no Unity, Godot, or engine install required.
Source and Accuracy Notes
- Project page: yarnspinner.dev
- Source repository: github.com/YarnSpinnerTool/YarnSpinner
- License: MIT (verified via GitHub API
license.spdx_id) - HN launch thread: news.ycombinator.com/item?id=30816832
What Is Yarn Spinner?
Yarn Spinner is a dialogue system that lets writers and developers create interactive, branching conversations in a simple, screenplay-like format. You write dialogue in .yarn files using its own domain-specific language, then load them into your game engine. Yarn Spinner sends your game lines (dialogue to display), options (player choices), and commands (engine instructions like playing a sound or moving a character).
The core repo is engine-agnostic. Official packages exist for Unity (2021.3 or later), Godot (GDScript and C#), and Unreal Engine. Yarn Spinner has shipped in critically acclaimed games including Night in the Woods, A Short Hike, DREDGE, Venba, and Lost in Random.
The new try.yarnspinner.dev web demo lets you write Yarn scripts and see them execute in a live preview — no account, no install, no engine.
Setup Workflow
Step 1: Try It in the Browser
Open try.yarnspinner.dev in any modern browser. The editor loads with a sample Yarn script you can edit immediately.
The web demo is useful for:
- Testing dialogue logic before wiring it into an engine
- Sharing dialogue drafts with writers or designers who do not have a dev environment
- Learning the Yarn language without committing to an engine integration
Step 2: Install the VS Code Extension
For local development, install the Yarn Spinner VS Code extension:
code --install-extension YarnSpinner.yarn-spinner
The extension provides syntax highlighting, autocomplete, and live validation for .yarn files. It is the recommended authoring environment for Yarn Spinner projects.
Step 3: Clone the Core Repo
The core compiler is open source and available on GitHub:
git clone https://github.com/YarnSpinnerTool/YarnSpinner.git
cd YarnSpinner
The repo contains the Yarn.Compiler library and command-line tools. Game engine integrations live in separate repos under the YarnSpinnerTool organization.
Step 4: Add to Your Game Engine
Unity (requires 2021.3 or later):
# Via Unity Package Manager — add from git URL
https://github.com/YarnSpinnerTool/YarnSpinner-Unity.git
Godot (GDScript):
# Asset Library or GDNative
# See: https://docs.yarnspinner.dev/getting-started/installation/godot
Unreal Engine — see the official Yarn Spinner docs for the current Unreal integration steps.
The Yarn Language
A Yarn script looks like this:
title: Start
---
Narator: Welcome to the village.
NPC: How can I help you?
-> Ask about the sword
-> Great, thanks!
Narrator: You head north.
-> Goodbye
@end
-> Ask about the river
Narrator: The river runs cold this time of year.
-> I see
@return
===
Key concepts:
title:declares a node (a discrete chunk of dialogue)---and===delimit node content->denotes a player choice option@end,@return, and@stopare built-in commands- Variables, functions, and conditional logic are supported
Deeper Analysis
Strengths
Frictionless for writers. The Yarn language is plain-text readable. Writers do not need to know programming to write branching dialogue. The VS Code extension lowers the bar further with autocomplete and inline validation.
Engine-agnostic core. The compiler is shared across Unity, Godot, and Unreal integrations. The dialogue logic does not need rewriting when switching engines.
Active development. The project is maintained by Yarn Spinner Pty. Ltd., a spinoff of Secret Lab. Recent updates include Godot support (C# and GDScript), incremental source generators for Unity, and ongoing work on a v3 beta.
Localization support. Yarn Spinner has built-in localization features — export strings, translate, import back. Useful for games targeting multiple language markets.
Limitations
No built-in audio or lip-sync. Yarn Spinner handles dialogue flow and text; how text is presented (speech bubbles, subtitles, VO cues) is your responsibility. Unity add-ons exist for this.
Engine integrations vary in maturity. Unity has the most mature integration. Godot support is actively developed. Unreal support exists but may lag behind.
The web demo is a preview, not a full IDE. It is useful for testing logic and sharing scripts, but full authoring workflow still runs in VS Code locally.
Practical Evaluation Checklist
- Write a simple two-node dialogue in try.yarnspinner.dev
- Open the VS Code extension and validate a Yarn file with syntax errors
- Verify the Unity package installs without conflicts in a clean project (2021.3+)
- Check the docs for your engine’s current integration status before committing
Security Notes
Yarn Spinner scripts are developer-authored .yarn files loaded at runtime. The compiler does not execute arbitrary code from untrusted sources — but you should treat dialogue files as data, not code. If your game loads Yarn scripts from user-generated content directories, validate the file format before compilation.
FAQ
Q: Can I use Yarn Spinner commercially? A: Yes. Yarn Spinner is MIT-licensed. Use it in commercial and non-commercial games without restriction. Paid engine packages (Unity Asset Store, Itch.io) fund ongoing development but are not required.
Q: Do I need to use the web demo before committing to Yarn Spinner? A: No, but it is the fastest way to evaluate whether the Yarn language fits your workflow. Open try.yarnspinner.dev and edit the sample script for five minutes.
Q: Does Yarn Spinner work for non-game applications? A: Technically yes — it is a branching dialogue engine. However, it is designed for game contexts (line/option/command model, engine integration patterns). For non-game interactive fiction, Twine or Ink may be more appropriate.
Q: How is Yarn Spinner different from Twine or Ink? A: Twine is a WYSIWYG hypertext tool. Ink is a JSON-exporting narrative scripting language with stronger programming features. Yarn Spinner occupies a middle ground: plain-text source files, a language designed for writers, and first-class game engine integrations rather than JSON export.
Conclusion
Yarn Spinner fills the specific gap between “spreadsheet dialogue” and “full narrative scripting.” Its engine-agnostic compiler means you are not locked into one platform, and the new web demo lets anyone kick the tires without installing Visual Studio, Unity, or Godot. If your game has dialogue — especially branching, player-choice dialogue — it is worth 30 minutes with try.yarnspinner.dev.
For full authoring, install the VS Code extension and read the official documentation.
Related Posts
ai-setup
Recall – Persistent Memory for Claude Code via MCP Hooks
Recall gives Claude Code a permanent memory store that survives session restarts and context compaction. Four hooks capture and restore context automatically — with cloud SaaS or self-hosted options.
2/28/2026
dev-tools
Automotive Skills Suite for AI Engineering
Evaluate Automotive Skills Suite for APQP, ASPICE, HARA, safety-plan, and DIA workflows with setup notes, governance risks, and SME review guidance.
5/28/2026
dev-tools
awesome-agentic-ai-zh Roadmap Guide
Explore awesome-agentic-ai-zh as a Chinese agentic AI learning roadmap, with setup notes, track selection, study workflow, and evaluation guidance.
5/28/2026