Story-driven visual novels and interactive fiction for the browser. Script structure (scenes, branches, flags, endings), the dialogue runner, backgrounds, character sprites with expressions and positions, text box with typewriter, auto and skip modes, backlog, choices, save / load slots, music and sound cues, routes and endings tracking, accessibility (text speed, size, contrast), writing tools...
Download skill (.zip) Files on GitHubVisual novel development
Core: reading a story with characters, art and music, and making choices that matter.
Starter template
A playable starter for the game-scaffolding template is in assets/starter/. A story file (story.js) with backgrounds, characters with poses and positions, a typewriter, choices with conditions, variables, auto and skip (read text only), a backlog, quick save/load, autosave, an endings gallery, and a story check for missing or unreachable nodes.
python3 <game-scaffolding>/scripts/scaffold.py my-game --title "My Game" --starter <this skill>/assets/starter
Controls: Tap, Space or Enter advances; 1-3 choose. Keys: A auto, S skip, B log, Q save, E load. Esc pauses. All numbers to tune are in src/config.js; the gameplay is in src/scenes/play.js.
Advancing, choices, save/load, auto mode and a full playthrough were tested; the story checker catches broken links.
Architecture
The story is data (dialogue-system nodes) plus stage commands. One runner advances lines and executes commands:
const SCRIPT = {
start: { bg: "park-day", music: "calm", show: [{ who: "mia", pose: "smile", at: "left" }],
speaker: "Mia", text: "You came! I wasn't sure you would.", choices: [
{ text: "Of course.", effects: { add: { mia: 1 } }, next: "walk" },
{ text: "I almost didn't.", next: "honest" } ] },
walk: { show: [{ who: "mia", pose: "laugh" }], speaker: "Mia", text: "Come on, the lake is this way.", next: "lake" },
// …
};
// on each node: apply bg / music / show / hide / sfx, then display speaker + text (runDialogue gives text, choices, effects)
Use dialogue-system runDialogue for flow, variables and validation; add a stage layer for bg, show, hide, music,
sfx, shake, fade. Big projects: write in Ink (inkjs runtime) or Yarn Spinner and map their tags to stage commands.
Must-have features
- Text box with typewriter (tap/Space: finish line, then advance), Auto and Skip (seen text only) modes, a Backlog.
- Save / load slots (store node id + variables + seen set; screenshot thumbnail optional) and autosave at each choice.
- Settings: text speed, text size, music/voice/sfx volume, box opacity.
- Endings gallery / flowchart of reached endings (persist separately from save slots).
- Characters: sprites per expression (
mia-smile.png), positions left/center/right, short fades between expressions.
Writing
Short lines, distinct voices, choices that change relationships or plot (track with variables), and at least one meaningful branch early so players feel agency. Validate the graph in tests (no dead ends, every ending reachable).
Layout
Phone portrait works well for VNs: background crop centered on characters, text box at the bottom with large text. Desktop: 16:9 with the box over the bottom third. Keyboard, mouse and touch all advance and choose.
Pitfalls
No skip or backlog, saves that break when the script changes (save by node id; keep old ids or migrate), walls of text, choices that don’t matter, and huge uncompressed images (WebP, sized to the screen).