Skip to content

Visual novels

How Patter slots into a visual novel.

A visual novel is almost all dialogue, so Patter carries most of the writing: every line, every choice, and the flags that decide which route the player is on. Your game draws the text box, the characters, and the backgrounds, and keeps the save slots.

Write a scene per chapter, and let choices set the flags that decide the route. Route flags and affection are @patter properties: they belong to the story, last the whole game, and save with it. A branch at the end of a chapter sends the player down the route their flags point to, with an unconditional last child as the default.

MIO: So, are you coming to the festival?
> I wouldn't miss it.
(effect: @route = "festival")
MIO: Then I'll save you a spot.
> I've got work, sorry.
(effect: @route = "work")
MIO: Oh. Another time, then.

A visual novel shows a portrait, an expression, and a background for each line. Declare those as Game Data fields once, such as an expression pick-list on line beats and a background on scenes, and writers set them in the inspector as they write. Your game reads them off each step and swaps the art. Music and sound cues can ride on wordless game events.

(scene Game Data: background = "rooftop")
MIO: You came!
(expression: happy)
MIO: I wasn't sure you would.
(expression: shy)

An option is once-only by default, so a question the player has asked disappears. Mark it sticky to keep it. A fallback option is taken when nothing else is left, which is how a run of questions ends with “That’s all for now”. Options gated on a condition reach your game as unavailable rather than hidden, so you can show a locked choice if your design wants one.

Prose with no speaker is a text beat. A thought is a line with a speaker qualifier, such as MIO (V.O.), so it’s still Mio speaking and your game can style it differently. Values drop into text and choices with {@name} (Embedding property values).

Every beat has a stable id that never changes when the writing moves. Keep a set of the ids your game has shown, and you have “skip read text” and a backlog that knows what’s new.

One call saves the whole story, mid-scene and mid-choice, and one call restores it. Your game decides when to save and how many slots there are, and stores the save with its own.

Many visual novels are about relationships: what the player says to someone moves how they feel, and new scenes open as it grows. Each relationship is a @patter property, in whichever type fits it:

  • A number for affection that goes up and down.
  • A quality for a stage that only moves forward, such as strangers, friends, and close.
  • Flags for facts that build up, such as met, owes you a favour, and saw you lie.

Effects on options move them, and conditions gate the scenes and options that need a closer relationship.

JUN: Do you ever think about leaving this town?
> Every day.
(effect: @jun_affection = @jun_affection + 2)
JUN: Me too. I've never told anyone that.
> Not really. I like it here.
JUN: Huh. I suppose someone has to.

An ending scene follows the values the story has built up: a branch, most specific first, with a default ending last. Coverage testing plays every route and shows any ending nobody can reach.

  • The text box, portraits, backgrounds, and transitions, driven by Game Data.
  • The backlog, skip, and auto-advance.
  • Save slots, and when the game saves.
  • The calendar and time of day, if the story has them.

You won’t need it for fixed routes. It earns its place when the story has free time: the player picks who to spend an afternoon with, and which scenes are on offer depends on the day, who they’ve grown close to, and what’s happened so far. That’s a pool of scenes with conditions, dealt as the story moves, which is what Storylet Studio is for. Its Story acts kit gives you an arc in acts, with beats that wait for their act. Storylet Studio picks the scene, your game plays the Patter scene of the same name, and both read the same values (Running it with Patter).

Open source under the MIT licence, made by .