A Prompt for a Branching Visual Novel
A visual novel is a script engine with good manners. This brief asks for the script as data, choices that remember, and the reading comforts players expect, from backlog to skip-read.

Key takeaways
- Ask for the story as a data file, separate from the engine. You will edit the words far more often than the code.
- Track choices with named flags and one or two counters. Endings read them; scenes can react to them.
- Backlog, skip-read, auto mode and save slots are not extras in this genre. Players expect them from the first build.
This prompt builds a branching visual novel in the browser: a short three-chapter story with two characters, choices that set flags and an affection score, three endings decided by what you chose, and the reading comforts players expect (save slots, a backlog, skipping text you have already read, auto mode and text speed). Most importantly, it asks for the script as a separate data file, so after the first build you can rewrite scenes yourself or ask the agent for one scene at a time without touching the engine.
The brief
Make a branching visual novel web game for desktop and phones (landscape, also readable in portrait with the text box filling the lower half). Story: an original short mystery set in a seaside town during one rainy week. The player is a new assistant at the town's tiny lighthouse museum. Two main characters: Mira, the museum's sharp, guarded curator, and Theo, a cheerful fisherman who knows every rumor. Three chapters of about 10 minutes of reading each. Script: stored in a separate script file, written in a simple readable format with scene labels, lines as 'Speaker: text', character expression changes, background changes, music cues, choices with up to 3 options that jump to labels, flags set by choices (for example, told_mira_the_truth), and a trust counter for each character that choices raise or lower. Endings: three, chosen at the end of chapter 3 by flags and counters: the Keeper ending (high trust with Mira and the truth told), the Tide ending (high trust with Theo and the map found), and the Fog ending (anything else). At least two earlier scenes change lines depending on flags, so choices feel remembered. Write the full script for all three chapters and endings. Presentation: background art for 5 places (the museum, the harbor, the lighthouse stairs, a cafe, the cliffs at night), each character in 4 expressions (neutral, happy, worried, angry) with the same outfit and colors in every expression, drawn in a soft painted style. Text box at the bottom with the speaker's name, text appearing letter by letter at the chosen speed; tap, click, Space or Enter shows the full line, then advances. Choices appear as large buttons in the middle. Reading comforts: a backlog of the last 200 lines (swipe down or scroll up, or press L), skip that only skips lines already read in any playthrough (hold Ctrl or a Skip button), auto mode with a delay based on line length, text speed and auto delay in settings, hide the text box to see the art (press H or tap a button). Saves: 6 manual save slots with a thumbnail, chapter name and date, plus an autosave at every choice; quick save and quick load buttons. Music: a gentle piano theme, a tense theme for the cliffs, and rain ambience; sound effects for doors and waves. Screens: title (New game, Continue, Load, Settings, Gallery of endings seen), the reading view, choice buttons, backlog, save and load, settings, ending screen with its name. All buttons at least 44 px on phones.
Why each part is there
- Script as data. Most of the work on a visual novel is writing and rewriting. If the story lives inside the code, every word change is an engineering change. A readable script file means you can edit lines directly in the code editor and ask the agent for changes by scene label. The visual novel guide explains branching structures in detail.
- Flags and two trust counters. Named flags (did this happen?) and counters (how much does this person trust you?) are enough for almost any first story. More systems than that and you will lose track of which ending is reachable.
- Three endings with a fallback. Two earned endings and one for everything else guarantees every playthrough ends somewhere meaningful, and the Gallery of endings gives a reason to replay.
- Remembered choices. Changing a few lines based on earlier choices is what makes players feel their decisions mattered, even when the main path is shared.
- Consistent character art. Generated expressions drift easily: a different outfit or hair color in the angry pose breaks the spell. Stating the same outfit and colors across expressions avoids that. For more on generating consistent art, see generating images for your app.
- Skip only read text. Skipping unread lines by accident ruins a story. Skipping read lines makes replays for other endings painless.
- Six slots plus autosave at choices. Players save before big decisions to try both paths. An autosave at every choice means nobody loses progress to a closed tab.
Three follow-ups to send next
- 01Map the branches. Write me a short map of the script: each scene label, which choices lead out of it, which flags and counters each choice changes, and which ending each path can reach. Point out any ending that cannot be reached and any flag that is set but never read.
- 02Polish the screens. Make the text box, name plate, choice buttons and title menu screens I can edit in the UI Editor, with the colors and fonts in the theme, so I can restyle them myself.
- 03Add voices to key moments. Generate spoken voice lines for Mira and Theo for the first line of each chapter and for each ending's last scene only, with a setting to turn voices off.
The branch map in the first follow-up is how you catch the classic visual novel bug: an ending nobody can reach. Ask for it again after every large script change. The UI Editor docs describe what you can change by hand once screens are files, and the game UI and HUD guide covers readability for text-heavy screens.
Two variations
Dating sim structure
Keep the engine and change the story frame: a two-week calendar where each day the player chooses one of three places to visit, meeting different characters, with each character's trust counter deciding their ending. It adds a free-choice layer on top of the branching script and multiplies the writing, so keep the cast to three.
Mystery with an evidence board
Add a notebook that collects clues as flags when they are found in scenes, and an accusation scene where the player must present two clues that prove who did it. Wrong picks lead to the Fog ending. It adds a puzzle without changing the engine much.
What usually goes wrong, and how to ask for the fix
- Loading a save shows the wrong art or music. The save only stored the line, not the scene state. Ask: "Saves must store the current background, characters on screen with expressions, music, flags, counters and the read-lines list, and loading restores all of them."
- Skip skips everything. Read lines are tracked per session instead of across playthroughs. Ask for the read-lines list to be saved in the browser and shared by all saves.
- Text overflows the box on phones. Ask for the text box to wrap and, if a line is still too long, to split it across two clicks, never shrinking the font below 16 px.
- Characters change look between expressions. Ask to regenerate the expressions from the neutral image, keeping outfit, hair and colors, and to show all four side by side before using them.
- The story is too long for the first build. If the agent writes a short version, ask for one chapter at a time, by scene labels, so each turn stays focused.
Your words matter most
The agent will write a solid first draft of the story, but a visual novel is only as good as its writing. Treat the generated script as a draft: rewrite the lines that matter in your own voice, keep the structure, and use the branch map to check nothing broke. When it reads well from start to all three endings, publish it in one click and share the link.
Frequently asked questions
Can I write the story myself instead of the agent?
Yes. Because the brief asks for the script as a separate readable file, you can write or paste your own script in the same format and the engine plays it. Ask the agent to check it for broken labels and unreachable endings.
How many endings should a first visual novel have?
Two or three. This brief uses two earned endings and a fallback, which keeps every path meaningful and the branch logic easy to check.
Can characters have voices?
Yes. The agent can generate spoken voice lines. The third follow-up adds voices to key moments only, with a setting to turn them off, which keeps the cost and the size of the game down.

