godot-narrative
Skill54 starsChanged 14 days agoMITView on GitHub
Dialogue, quests and story state in Godot 4.7 - choosing Dialogue Manager, Dialogic, Yarn Spinner or Ink versus custom Resource dialogue, typewriter RichTextLabel boxes, choices with gamepad focus, portraits and voice blips, conditions and flags, quest logs, barks, cutscenes with Tween.tween_await, localized and accessible dialogue. Use for NPC conversations, branching stories or visual novels.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- godot-2dSkill
- godot-3d-gameplaySkill
- godot-3d-renderingSkill
- godot-addonsSkill
- godot-animationSkill
- godot-architectureSkill
- godot-audioSkill
- godot-coreSkill
- godot-csharpSkill
- godot-editor-toolingSkill
- godot-export-ciSkill
- godot-game-feelSkill
- godot-gdscriptSkill
- godot-inputSkill
- godot-migrationSkill
- godot-mobile-webSkill
- godot-modding-dlcSkill
- godot-navigation-aiSkill
- godot-networkingSkill
- godot-performanceSkill
- godot-physicsSkill
- godot-proceduralSkill
- godot-shaders-vfxSkill
- godot-testing-debugSkill
- godot-uiSkill
- godot-xrSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Before installing, check that the addon release targets your Godot version (godot-addons).
- Very specific: line 32
Keep story state in one place (GameState) and save it with the save system.
- Very specific: line 36
Never evaluate expressions from untrusted sources (mods, downloads) without const_calls_only.
- Distinctive: line 48
Every line needs a stable key, not the English text as the key, so rewriting English doesn't break translations.
- Very specific: line 50
Test with pseudolocalization (TranslationServer.pseudolocalization_enabled) for 30–40 % longer text, and size boxes with fit_content …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Narrative: Dialogue, Quests, Story State (4.7)
Pick the dialogue format
| Option | When | Notes |
| Dialogue Manager (Nathan Hoad) | most games; writers like a screenplay-style text file | .dialogue files, branching, conditions, mutations that call your code, example balloons, CSV/PO translation export. v4 needs Godot 4.6+, v3 for older 4.x. GDScript and C# |
| Yarn Spinner for Godot | teams that already use Yarn, or that ship on several engines | the C# version is the stable one. The pure GDScript port (4.6+) was still beta/alpha in 2026, so don't ship on it without testing |
| Ink (GodotInk, C#) | heavy branching prose, writers using Inky | needs the .NET build |
| Dialogic 2 | visual-novel style with an editor of characters, portraits and timelines | still alpha (4.5+), and the API changes between alphas. Pin the version |
| Custom Resources (reference) | small games, full control, no addon risk | DialogueLineData Resources edited in the inspector, or JSON/CSV exported from a spreadsheet |
Before installing, check that the addon release targets your Godot version (godot-addons). Look up an addon's API in its own docs, not from memory: the names change between majors. |
Architecture (any format)
GameState (autoload) flags/variables Dictionary, saved with the game
DialogueRunner walks the dialogue data, evaluates conditions, emits line/choices/ended
DialogueBox (CanvasLayer UI) shows a line, typewriter, choices; knows nothing about story logic
QuestLog (autoload) quests as Resources, progress via signals- The runner emits
line_shown(speaker, text),choices_shown(options),dialogue_ended. The box callsrunner.advance()/runner.choose(index). This split lets you reuse the box for barks, tutorials and cutscenes. - Conversations pause gameplay through a state flag or
get_tree().paused. Set the dialogue UI toPROCESS_MODE_ALWAYS(godot-architecture). - Keep story state in one place (
GameState) and save it with the save system. Use flags likemet_blacksmith, counters likegold, and enums for quest stages.
Conditions and effects in data
- In custom formats, conditions are strings (
"gold >= 10 and not met_king"). Evaluate them withExpression.parse(text, var_names)thenexecute(values, GameState, true, true).const_calls_only = trueblocks calls with side effects. Parse once and cache. - Never evaluate expressions from untrusted sources (mods, downloads) without
const_calls_only. - Effects (
set gold -= 10,give_item("key")) are better as a small list of commands that your runner understands than as free code.
Dialogue box essentials
RichTextLabelwithbbcode_enabled,fit_content,visible_characters_behavior = TextServer.VC_CHARS_AFTER_SHAPING(no jumping when words wrap). Typewriter: tweenvisible_ratio0 → 1, or stepvisible_characterson a timer for per-character sounds and punctuation pauses.- First press: finish the line (
visible_ratio = 1). Second press: advance. Acceptui_acceptand mouse/touch. Ignore input for ~0.1 s after a line appears so a held button doesn't skip text. - Choices: build
Buttons in aVBoxContainer, callgrab_focus()on the first one (gamepad), and add number keys for PC. Disable instead of hiding locked options when the player should see what they missed. - Voice blips: an
AudioStreamRandomizerwithrandom_pitch~1.1, played every 2–3 characters, with a different pitch per speaker. - Portraits: a
TextureRectper side, swapped by speaker and emotion keys ("ana_happy"), from aDictionary[StringName, Texture2D]Resource. - Name plate and color per speaker; text speed, auto-advance and font size in the settings.
Localization
- Every line needs a stable key, not the English text as the key, so rewriting English doesn't break translations. Addons generate the keys and export CSV/PO.
- Custom data: store keys and call
tr(key). Plurals:tr_n(singular, plural, n). Context:tr(key, &"menu"). Insert names withformat()after translating. - Test with pseudolocalization (
TranslationServer.pseudolocalization_enabled) for 30–40 % longer text, and size boxes withfit_content(godot-ui).
Quests
QuestDataResource:id,title,description,objectives: Array[ObjectiveData](id,text,required),rewards. Runtime progress lives inQuestLog(Dictionary id → progress), not in the Resource, which is shared.- Gameplay emits generic events (
enemy_killed(kind),item_collected(id),talked_to(npc)) on an event bus. The quest log listens and updates objectives, so gameplay code never knows about quests. - Signals
quest_started,objective_updated,quest_completeddrive the HUD tracker and the journal UI.
Barks and cutscenes
- Barks (short lines in the world): a
Label3D/Labelover the NPC, a pool of lines with a cooldown, never blocking input. - Cutscenes: an
AnimationPlayerwith camera and character tracks plus method call tracks that start dialogue. Pause the animation until the dialogue ends:await runner.dialogue_endedin code, or in a Tween usetween_await(runner.dialogue_ended)(4.7) between steps. - Skippable:
AnimationPlayer.advance()to the end orseek(length, true), then apply the final state (flags) the same way as when it plays out.
Accessibility
Text speed options and instant text, auto-advance, high-contrast box, no information only in color, and screen-reader support: set accessibility_live on the line label (4.5+, AccessKit, experimental; godot-ui).
Dialogue Resources, runner with conditions, typewriter box, choices, GameState, quest log and cutscene await (compiled by the tests): references/patterns.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

