← Module 03

/

Make the first ten minutes testable

Lesson 03.2

States, transitions and exceptions

7 min

English captions

Objective

Model the relay's states and exceptions, decide who owns the source of truth, and make sure both players learn when a state changes.

Knowledge check
Rin cancels in the same frame Kai signals. What should decide the result?

Take into your capstone

Add one state diagram to your capstone, with invalid, timeout and reconnect branches.

Open the cheat sheet →

Descriptive transcript

What’s on screen, then what’s said, scene by scene.

On screen: Title card. Lesson 03.2: States, transitions and exceptions. Objective: Model the relay's states and exceptions, and decide who owns the source of truth.

In this lesson we take the relay apart. Not the art. The states. Every interactive thing in a game is a small machine that moves between states, and most UX bugs live in the states nobody drew. By the end, you'll have a state diagram for the relay that includes the unhappy paths, and you'll know who decides what's true when two players disagree.

On screen: THE HAPPY PATH. Flow, What everyone designs first: Idle: Nobody has acted → Waiting: Teammate diverting power → Ready: Power in, signal now → Online: Both confirm success

Here's the version everyone designs first. Idle, nobody has acted. Waiting, Rin is diverting power. Ready, power's in, signal now. And online. Four states, three arrows, everything goes right. It's a good start, and it's about a third of the job. Real players, real networks and real storms will push the relay into states that aren't on this line.

On screen: THE STATES NOBODY DREW. Table, Exceptions and what each player sees. Columns: State, Trigger, Kai sees, Rin sees. Rows: Invalid, Signal while waiting, TOO EARLY, retry stays, Kai tried too early | Timeout, 45 s without action, POWER LOST, try again, Divert again | Cancel, Rin releases the lever, Back to amber, Power stopped | Reconnecting, Connection drops, RECONNECTING, last confirmed state, Kai: connection lost

Here are the states nobody drew. For each one, write the trigger, and what each player sees. Both players, every time. Invalid: Kai signals while the relay is still waiting. Kai sees why, too early, and keeps the retry. Rin sees that Kai tried. Timeout: forty-five seconds pass with no action, and the storm drains the relay. Both players are told what happened and how to restart. Cancel: Rin lets go of the lever. The relay drops back to amber for Kai, and Rin sees that the power stopped. And reconnecting: Kai's connection drops. This is the one that bites, so let's look at it closely.

On screen: Lantern Relay gameplay mockup, labeled “RECONNECT // WHAT'S TRUE?”. Top-down greybox: Kai (the player) and teammate Rin, a power junction linked to relay 1, the beacon above, teammate status card top right. Then the relay turns green: power is in, Rin's card reads POWER READY, a prompt above the relay reads “SIGNAL READY” with the E key. Then Rin's card reads STATUS UNKNOWN, a banner reads RECONNECTING, magenta brackets frame the relay. Then the frame freezes.

Kai is at the relay. Power is in. The relay is ready. Kai signals, and in the same moment, Kai's connection drops. Kai's game has a choice to make. It doesn't know whether the server received the signal. A tempting choice is to guess, and show success. It feels kind. But if the signal never arrived, Kai sees the relay come online and then fall back to waiting. Taking back a success is worse than waiting for one.

On screen: WHO OWNS THE TRUTH. Comparison, Client guess vs. confirmed state: CLIENT GUESSES: Feels fast, can lie (Shows success before the server agrees; Players can see different things; Success can be taken back) versus SERVER CONFIRMS: One truth for both (Shows only confirmed states; Says plainly when it's unsure; Both players learn every change)

So decide, out loud, who owns the source of truth. A client that guesses feels fast, but it can lie, and the two players can end up looking at different relays. A server that confirms gives both players one truth. While it's unsure, the screen says so: reconnecting, teammate status unknown, here's the last state we both agreed on. And when anything changes, both players find out.

On screen: WORKED EXAMPLE. Table, The relay as a transition table. Columns: From, Event, To, Both players see. Rows: Waiting, Power arrives, Ready, Shape, label, card | Ready, Kai signals, Online, Beam, caption, card | Ready, 40 s pass, Timeout, Power drains, retry | Any, Connection drops, Reconnecting, Last confirmed state

A diagram is great for talking. A transition table is what engineering and QA can actually build and test from. Each row is one arrow: where you start, the event, where you end up, and what both players see. Waiting, power arrives, ready. Both players see the shape change, the label, and the teammate card. Ready, Kai signals, online: a beam, a caption and the card. Ready, and forty seconds pass with no signal: timeout. Power drains, and both players are told they can retry. Notice that timeout isn't a failure screen. It's a state with a way back. And the row teams forget. From any state, the connection drops: reconnecting. Both players keep seeing the last confirmed state, labelled as reconnecting, until the server answers. One row like this prevents a whole class of bugs where two players see two different relays.

On screen: COMMON MISTAKE. Comparison, Designing one screen instead of two: WHAT TEAMS DO: Review the host's screen only (Host sees success; Client stays on 'waiting'; Found by players at launch) versus WHAT WORKS: Review both screens side by side (Same moment, two views; Every state on both; Found in the review)

Here's the common mistake in co-op design. The team reviews one screen, usually the host's, because that's the build on the big monitor. The host sees success. The other player is still looking at 'waiting', and nobody notices until players do. What works is a two-screen review. Put both players' views side by side, on the same timeline, and step through every row of the transition table. For each state, ask: what does Kai see? What does Rin see? Do they agree? Studios that do this once per feature catch most sync problems before a single playtest.

On screen: HAND-OFF CHECK. Heading: A state is ready to build when it has. List: Entry (The exact event that starts it); Exit (Every way out, including failure); Both views (What each player sees and hears); Timing (Timeouts and durations as numbers); Owner (Who decides the truth, client or server)

Before you hand the relay to engineering, check every state against this list. Entry: the exact event that starts it. Exit: every way out, including failure. If a state has no exit, a player can get stuck in it forever. Both views: what each player sees and hears. Timing: timeouts and durations written as numbers, not 'a while'. Forty seconds is testable. 'A bit' isn't. And owner: who decides the truth for this state. If you can't fill in every line, the state isn't designed yet, it's just named. QA will thank you, because every line becomes a test case.

On screen: IN THE TOOL. Greyscale wireframe, Draw the states with both players' views. Shows: WAITING; READY; ONLINE; TIMEOUT; Kai: ring pulses, 'Waiting for Rin'; Kai: new shape, 'SIGNAL READY'; Kai: beam and caption; Kai: power drains, 'Retry'; Rin: 'Divert power' prompt; Rin: card says 'Kai can signal'; Rin: beam and caption; Rin: 'Divert again'; Exit: power confirmed; Exit: signal, 40 s, drop; Exit: none; Exit: Rin diverts; RECONNECTING · from any state; Both keep the last confirmed state, labelled 'reconnecting', until the server answers. Notes: One frame per state (Named as players see it); Two views per state (Kai's screen and Rin's); Write every exit (Including the timeout); Plan the drop (It can happen anywhere).

In a design tool, I give every state its own frame, side by side: waiting, ready, online, and timeout. Name each one the way a player would describe it, not the way the code does. Under each frame, two lines: what Kai sees, and what Rin sees. Waiting: Kai's ring pulses with 'Waiting for Rin', and Rin gets the divert prompt. Ready: Kai sees the new shape, and Rin's card says Kai can signal. If you can't fill in Rin's line, you've found a hole. Next, the exits. Ready has three: the signal, the forty-second timeout, and a dropped connection. Online has none, and that's fine, it's the end. But any state with no exit, other than the end, is a place a player can get stuck forever. Last, one frame sitting under everything: reconnecting. It can start from any state. Both players keep the last confirmed state, clearly labelled, until the server answers. This one frame is what engineering and QA will thank you for.

On screen: BEYOND LANTERN RELAY. Table, States in a matchmaking lobby. Columns: State, Exception, Every player sees. Rows: Searching, Takes too long, Time so far, option to widen | Match found, Someone declines, Back in queue, keeps priority | Ready check, Nobody answers, Timer, then clear reason | Joining, Server fails, Retry, never a frozen screen

The same state thinking applies to menus, not just gameplay. Take matchmaking. Searching is the state everyone designs. The exception is that it takes too long. Players need to see how long it's been, and an option to widen the search. Match found, and someone declines. What do the other players see? The good answer is: back in the queue, keeping their place, with a short message saying a player declined. The bad answer is being dumped to the main menu with no explanation. The ready check, and someone doesn't answer. A visible timer, then a clear reason when it closes. And joining, when the server fails: a retry, with a message. Never a frozen loading screen, because players can't tell a slow load from a broken one. Notice the pattern from the relay. Every state needs an exit, every exception needs words, and every player in the match needs to see the same truth. Matchmaking screens are where many players first decide whether a game feels trustworthy.

On screen: PAUSE AND PREDICT. Question: Rin cancels in the same frame Kai signals. What should decide the result? Options: A) Whichever client sent it first, by its own clock; B) The order the server received them, shown to both players; C) Kai's input always wins. After a pause, answer B is highlighted.

Here's a race. Rin cancels in exactly the same frame that Kai signals. What decides the result? Each client's own clock? The order the server received them? Or does Kai always win? The server's order, and both players see the outcome. Clocks disagree, and 'Kai always wins' is a rule nobody can see. Write the race down in your state diagram, so engineering doesn't have to guess.

On screen: Recap checklist: Draw the happy path, then every exception.; Invalid, timeout, cancel and reconnect, minimum.; Write what both players see in every state.; The server owns the truth; never take back a success.. Capstone box: Add one state diagram to your capstone, with invalid, timeout and reconnect branches.

Let's recap. Draw the happy path, then every exception. At minimum: invalid, timeout, cancel and reconnect. For each one, write what both players see. And decide who owns the truth, so the game never celebrates something it has to take back. For your capstone, add a state diagram with those branches. Next lesson, we turn it into a prototype you can put in front of players, even without a stable build.

Copyright 2026