Godot genre visual novel

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot genre visual novel is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert blueprint for visual novels (Doki Doki Literature Club, Phoenix Wright, Steins;Gate) focusing on branching narratives, dialogue systems, choice consequences, rollback mechanics, and persistent flags. Use when building story-driven, choice-based, or dating sim games. Keywords visual novel, dia

How to use this skill

Skill file

Genre: Visual Novel

Branching narratives, meaningful choices, and quality-of-life features define visual novels.

Core Loop

  1. Read → dialogue / narration
  2. Decide → choice moment
  3. Branch → flag or path change
  4. Consequence → immediate line variation and/or lasting flag
  5. Conclude → one of multiple endings

NEVER Do (Expert Anti-Patterns)

Narrative & Flow

Technical & UI


🛠 Expert Components (scripts/)

MANDATORY before implementing undo / branching / presentation:

1. vn_rollback_manager.gd — history stack (flags/backgrounds/index)

2. story_manager.gd — flag-aware dialog orchestration

3. dialogue_ui.gd — typewriter + choice UI

4. visual_novel_patterns.gd — BBCode, choice filtering, sprite layering

Catalog (deduped)


Decision Tree: Script Storage vs Plugin

| Approach | When to choose | Notes |

|----------|----------------|-------|

| JSON / CSV scripts | Writers edit outside Godot; rapid iteration | Load via FileAccess or threaded ResourceLoader; validate schema in StoryManager |

| Custom Resource dialogue trees | Designer Inspector editing, typed fields | Peer godot-resource-data-patterns; MANDATORY story_manager.gd |

| Dialogic (plugin) | Full VN suite (timelines, characters, themes) with editor tooling | Prefer when shipping a large route graph fast; still keep rollback + flag discipline. Skip building a second StoryManager if Dialogic already owns timelines |

| Build lightweight custom | Tiny kinetic novel / learning project | Use scripts in this skill; do not re-stub StoryManager inline |

Do not paste incomplete JSON StoryManager demos — implement from MANDATORY story_manager.gd.


Golden Path (order matters)

  1. Snapshot before mutate — On every advance/choice, MANDATORY vn_rollback_manager.gd pushes {line_index, flags, background, music} before flag writes.
  2. Typewriter + skip — dialogue_ui.gd: Tween visible_ratio 0→1; on skip/advance input set visible_ratio = 1.0 and kill the tween.
  3. Choice filter by flags — Present only options whose requires StringName flags pass; apply choice → mutate flags → jump label (visual_novel_patterns.gd + story_manager.gd).
  4. Speaker focus — move_to_front() on Control actors (not z_index alone) + dim inactive.
  5. Heavy CG/BG — ResourceLoader.load_threaded_request for backgrounds; never sync-parse huge scripts on the main thread.
# Choice handler shape (flags after snapshot)
func make_choice(choice_id: StringName) -> void:
    rollback_manager.push_snapshot()  # BEFORE mutate
    match choice_id:
        &"be_nice":
            flags[&"relationship_alice"] = int(flags.get(&"relationship_alice", 0)) + 1
            story_manager.jump_to_label(&"alice_happy")
        &"be_mean":
            flags[&"relationship_alice"] = int(flags.get(&"relationship_alice", 0)) - 1
            story_manager.jump_to_label(&"alice_sad")

Common Pitfalls

  1. Walls of text — Cap dialogue to 3–4 lines.
  2. Illusion of choice — Always vary lines or flags even on converging plots.
  3. Missing QoL — Auto / Skip / Backlog / Save are mandatory genre features.
  4. Broken rollback — Mutating flags before snapshot makes undo lie.

Deep recipes (on demand)

| Topic | Reference / script |

|-------|-------------------|

| Story driver & typewriter UI | architecture-overview.md |

| Branching / rollback / focus | key-mechanics.md |

| RichText / async loads | godot-tips.md |

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.