Skip to reading
Error Handling & Debugging

Choose how the game should recover

Edition 0.86.4.4 Hotfix 2

Updated through 0.86.4.4 Hotfix 2, with cinematic property, recorded-pose or voice-timing lessons as described in this guide. Earlier examples, screenshots and complete registry figures retain their stated edition context.

Download PDFView PDF page

ERROR HANDLING

A player typing the wrong word is a normal part of an adventure. A missing destination room is an authoring mistake. Players should get a sensible response in either case, but your code should handle them differently.

Source table from Choose how the game should recover, page 14
Expected inputAn empty name, a wrong answer or too few tickets calls for an ordinary condition. Explain what the player can do next. Leave the puzzle in a playable state.
An optional resourceIf a hint preference is missing, start with a documented default. If a voice clip is optional, keep the subtitle available. Record the missing ID if it is something the author needs to fix.
An impossible internal valueA ticket balance of −1 violates the rules. Use an assertion while diagnosing where the bad value came from. Before changing inventory or opening the gate, stop that action and log the record and value.
An operation that can failIf a save or write reports failure, preserve the player’s current state. Show a retry or a return path. Display “Saved” only after the operation reports success.

Read the answer a helper actually returns#

An empty string can be a valid player answer. Zero can be a valid fare. FALSE can be a perfectly good preference value. When failure and success can both look like zero or false, return a separate status such as {"ok": false, "value": 0}. Let the caller decide what to show.

Validate the prerequisites before charging the player. If an action can run twice, check the completion flag on entry, and decide how to restore input on both success and failure.

Page 14 of 37Permalink
Go to page