dialogue-systems
What it does
This skill guides the design and wiring of game dialogue with branches, choices, and remembered state. It is for game writers and developers making NPC conversations or story branches.
When to use it
- βWhen you are designing a conversation with branches and player choices.
- βWhen an earlier choice should change what a character says later.
- βWhen you need to pick between Ink, Yarn Spinner, or a custom dialogue format.
Skill link
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/dialogue-systems/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI want an NPC conversation with three choices where one choice changes how the NPC talks later. Which dialogue tool should I use?β
5 new skills a week. 1 minute to read.
How it works
The agent models the conversation as a graph of lines and choices, adds conditions and variables, and suggests Ink or Yarn Spinner or a simple custom runner depending on your needs. It then wires the script into your game loop.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Dialogue systems
Model conversations as a graph: nodes hold lines, choices branch the flow,
conditions gate options, and variables remember what the player did. The first
real decision is build vs. buy β adopt a proven authoring tool (Ink or
Yarn Spinner) or write a small data-driven runner. This skill owns both Ink
and Yarn; the visual-novel and rpg genres consume it.
When to use
- Use to design branching conversations, choice menus, or narrative state (flags, relationship values) that affect later dialogue.
- Use to decide between Ink, Yarn Spinner, and a custom JSON/resource format.
- Use to wire a dialogue script into your game loop (advance line, present choices, run commands, resolve variables).
When not to use: for engine UI (text boxes, portraits, choice buttons), use
godot-ui-control or the engine's UI skill. For persisting narrative variables
across sessions, use save-systems. For data-as-resources in Godot/Unity, see
godot-resources / unity-scriptableobjects.
Core workflow
- Choose the authoring approach.
- Ink β prose-first, writer-friendly, weave/gather flow; great for dialogue-heavy or CYOA narrative. Integrate via ink runtime / inkle plugins.
- Yarn Spinner β node-based, explicit
<<commands>>, strong for game-driven dialogue with lots of engine hooks. - Custom runner β a JSON/resource graph + a small interpreter when you need full control or minimal dependencies. Don't build a language; build a graph.
- Define the node contract. A node yields one of: a line (speaker + text), a set of choices, a command/side-effect, or an end/jump. The runner advances through nodes and hands lines/choices to the UI.
- Separate variables from flow. Keep a variable store (booleans, numbers, strings) the dialogue reads/writes; gate choices with conditions over it.
- Localize from the start. Author with line IDs, not raw strings, so the displayed text comes from a string table keyed by locale.
- Drive it from the game loop. The runner is a state machine:
currentnode β emit content β wait for input (continue or choice) β advance. - Verify by walking branches. Exercise each choice path; confirm conditions, variable writes, and that every branch reaches an end or a valid jump.
Patterns
1. Engine-neutral dialogue graph (data, not code)
{
"start": "guard_intro",
"nodes": {
"guard_intro": {
"speaker": "Guard", "line": "DLG_GUARD_001",
"choices": [
{ "text": "DLG_OPT_BRIBE", "to": "bribe", "if": "gold >= 50",
"set": { "gold": "gold - 50" } },
{ "text": "DLG_OPT_LEAVE", "to": "end" }
]
},
"bribe": {
"speaker": "Guard", "line": "DLG_GUARD_BRIBED",
"set": { "gate_open": true },
"next": "end"
},
"end": { "end": true }
}
}
line/text are string-table IDs (localization), not literal text. if
gates a choice; set mutates the variable store. The gold cost sits on the
choice, so it is paid once per pick even if the bribe node is revisited; the
idempotent gate_open write can live on the node. A string set value is an
expression, so a literal string needs inner quotes: "mood": "'angry'". The full
interpreter that walks this graph is in references/runner.md.
2. Runner step (a state machine over the graph)
# Godot 4.7. The runner holds the current node and a variable store. Every line
# waits for the player: the UI calls choose() or the continue callback.
func goto(id: String) -> void:
current = graph.nodes[id]
apply_set(current.get("set", {}))
if current.get("end", false):
ui.close()
return
if current.has("line"):
ui.show_line(current.get("speaker", ""), localize(current.line))
if current.has("choices"):
var shown = current.choices.filter(func(c): return eval_cond(c.get("if", "")))
ui.show_choices(shown) # only choices whose condition passes
elif current.has("next"):
var next_id: String = current.next
ui.show_continue(func(): goto(next_id)) # advance when the player continues
func choose(choice: Dictionary) -> void: # called when the player picks a choice
apply_set(choice.get("set", {})) # write on the transition (revisit-safe)
goto(choice.to)
3. Ink β branching with knots, choices, and variables (inkle)
// Ink: '*' = once-only
FAQ
Should I build my own dialogue system?
The skill says the first decision is build versus buy, and it describes proven tools as a common choice.
Does it cover dialogue boxes and buttons?
No. The engine UI skill covers those, while this skill covers the conversation logic.
Does it save narrative flags?
Saving those flags across sessions belongs to the save systems skill.
Details
Original description by the author
Build branching dialogue and narrative β a node/choice graph with conditions, variables, and localization hooks β and choose between authoring tools Ink and Yarn Spinner or a custom data-driven runner. Engine-neutral. Use when the user mentions dialogue system, branching dialogue, conversation tree, choices, Ink (.ink), Yarn Spinner (.yarn), or NPC dialogue.
Popularity
- GitHub stars
- 6.6k
- Ranking position
- #13795
- License
- Apache-2.0
- Updated
- 10/28/2026
Comments
- β¦
More skills from this repository
router
6.6kHelps your agent pick the right game development skill for a request by detecting your engine and the kind of task you need.
ai-behavior-trees-utility-ai
6.6kHelps your agent build a behavior tree and utility AI system for game enemies and characters that choose actions by priority and score.
audio-design
6.6kTeaches your agent game audio mixing: buses, decibel volume, ducking under dialogue, adaptive music and sound effect variation.
camera-systems
6.6kHelps your agent build game cameras that follow smoothly, stay inside the level, and orbit or look around in 3D.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.