Sub topic 2
Covering States and Edge Cases
This chapter assumes you know how design, engineering, art, and QA divide work on a game team, and that you have written at least one rule list for a feature. It continues the dash example from earlier in the plan.
Listing states and edge cases
A state is a condition a feature can be in at a given moment, such as dashing or cooling down. An edge case is a situation where two rules collide or a rule is pushed past its normal use. List every state once, then list the transitions between them. Check each transition against the edge cases.
Writing testable acceptance criteria
An acceptance criterion describes one observable behavior that QA can confirm or reject. Write it as Given, When, Then.
Scenario: Damage cancels a dash
Given the player is dashing
When the player takes damage
Then the dash ends immediatelySpecifying UI, controls, and player flow
Map each input to its result under every condition. A table makes gaps easy to see.
| Input | Condition | Result |
|---|---|---|
| Dash button | Grounded, no cooldown | Dash starts in the movement direction |
| Dash button | No movement input | Dash starts in the facing direction |
| Dash button | Cooldown active | Nothing happens |
> Warning text goes here.
Separating tuning values from rules
Keep numbers out of the rule text. Put them in a separate file so designers can change them without editing the rules.
# dash_tuning.yaml
dash:
speed: 18.0 # units per second
duration: 0.2 # seconds
cooldown: 0.8 # seconds
air_dashes_per_jump: 1The rule then reads "A dash lasts dash.duration seconds," not "A dash lasts 0.2 seconds."
Exercise
Exercise
A player dashes into a wall 0.1 seconds after starting. Which state comes next, and which tuning value controls how long the player waits before dashing again?
Show answer
The dash ends and the player enters Cooldown. The wait is controlled by dash.cooldown (0.8 seconds).