Loading...
Loading...
Build a visual novel: a branching script, character and background display, a text box with choices, save/load, backlog, and skip/auto. Use for a VN, dating sim, or branching story game.
npx skill4agent add gamedev-skills/awesome-gamedev-agent-skills visual-novelrpgdialogue-systemsdialogue-systems| Knob | Effect | Notes |
|---|---|---|
| Text speed / instant | reading comfort | Always allow instant + a skip. |
| Auto-advance delay | hands-free reading | Tunable; pause on choices. |
| Skip scope | re-reading | Skip read text only by default. |
| Branch breadth/depth | replay value vs. cost | Branches multiply writing/art work. |
| Flag-gated content | reactivity | Lines/choices that check past decisions. |
| Route structure | story shape | Branch-and-merge vs. distinct routes (refs). |
| Choice visibility | fairness | Show locked choices vs. hide them. |
| Backlog length | convenience | Keep enough to re-read recent context. |
# Pseudocode. Lines, choices, and jumps as data — usually authored in Ink/Yarn and stepped
# through by that runtime. The engine asks the script for "the next thing to show".
node = script.current()
if node.kind == "line":
show_text(node.speaker, node.text) # wait for advance input
elif node.kind == "choice":
options = [o for o in node.options if condition_met(o.condition, flags)] # gate by flags
show_choices(options) # wait for selection
elif node.kind == "set":
flags[node.var] = eval_expr(node.expr, flags)
script.advance(selected_option_or_none)# Pseudocode. Reveal characters over time; a click first completes the line, then advances.
def show_text(speaker, text):
name_label.text = speaker
revealed = 0
while revealed < len(text):
if advance_pressed(): # first press: reveal the whole line instantly
revealed = len(text); break
revealed += chars_per_second * dt
body_label.text = text[:int(revealed)]
push_to_backlog_when_complete(speaker, text)
wait_for_advance() # second press: go to the next line# Pseudocode. Choices write flags; later conditions read them — that is "reactivity".
def on_choice(option):
if option.set: flags[option.set] = True # e.g. flags["helped_npc"] = True
script.jump(option.target) # follow the branch
# Elsewhere, a line/choice/ending checks the flag:
if flags.get("helped_npc"): play_route("good_ending") else: play_route("neutral_ending")dialogue-systemsgame-ui-uxgodot-ui-controlsave-systemsaudio-designTweenshader-programmingprototype-fastreferences/script-and-flow.md