Sub topic 8
Specifying UI, controls, and player flow
This chapter assumes you can already write a rule and an edge case for a mechanic, as covered in the earlier chapters on rules and states. It also assumes you have used a game menu and a controller. Here you will add the part of a spec that describes how the player talks to the game: inputs, screens, and the path between them.
Why this section needs its own treatment
A mechanic rule such as "pressing Dash starts a dash" hides several decisions. Which button is it? Does it fire on press or on release? What happens if the player presses it 100 ms before the cooldown ends? What does the player see and hear when it is blocked?
If the spec does not answer these questions, engineers will pick answers in code, and designers will find them in playtests. UI and controls are also where disciplines overlap most. Engineering builds the input handling, UI artists build the screens, audio builds the feedback, and QA tests all of it on several devices. A spec that states the decisions once lets all of them work from the same page.
Keep the rules in the Rules section. Put input bindings, screens, and flow in their own sections, and refer to the rules by number rather than restating them.
Specifying controls
Start with a table of actions. An action is something the player intends, such as "Dash". A binding is the physical input that triggers it. The spec should name actions first and bindings second, because bindings change with platform and remapping.
| Action | Keyboard and mouse | Gamepad | Trigger | Notes |
|---|---|---|---|---|
| Dash | Left Shift | East face button | On press | Rule 1. Ignored during cooldown. |
| Move | W, A, S, D | Left stick | Held, analog | Dead zone 0.2 (see tuning file). |
| Pause | Esc | Start | On press | Works in all gameplay states. |
Then state the input behaviors that the table cannot show.
- Trigger type. Say whether the action fires on press, on release, on hold for a duration, or on repeat. "Hold to confirm" actions need a hold time and a description of what happens if the player lets go early.
- Input buffering. A buffer stores a press that arrives slightly too early and runs it when the action becomes allowed. State the buffer window and which actions use it. For dash, "a press up to 0.1 s before cooldown ends starts a dash" is testable. "Dash feels responsive" is not.
- Analog versus digital. If a stick controls direction, say whether the direction is snapped to eight directions or used as-is.
- Conflicts and priority. If two actions are pressed on the same frame, name which wins.
- Remapping. State which actions can be rebound, which cannot (often Pause), and what happens when the player binds one input to two actions.
- Device switching. Say what happens when the player touches a keyboard while using a gamepad: do on-screen prompts change, and how quickly?
- Context. List the states in which each action is read. Input during a cutscene, a menu, or a loading screen should be defined, not left to chance.
Tuning numbers such as buffer windows and dead zones belong in the tuning file. The spec should name the value and point to it.
Specifying player flow
Player flow is the sequence of screens and states a player passes through to use a feature. A diagram makes the paths clear much faster than a paragraph. Draw states as boxes and transitions as labeled arrows, and label each arrow with the event that causes it.
A diagram is not a full specification. For each box, add a short description covering the following points.
- Entry conditions. When is this screen reachable? Can the player pause during a boss intro?
- What the player can do. List the actions available, and which element has focus when the screen opens. Focus matters for gamepad and keyboard navigation, because there is no cursor to click.
- Exits. Every screen needs a way out. Define what Back, Cancel, and Pause do on each one.
- What happens to the game. Does the world pause, slow down, or keep running? Do timers and audio continue?
- What persists. Are changed settings applied immediately, or only after the player confirms?
Check the flow for dead ends (a screen with no exit), unreachable screens, and loops where Back goes somewhere surprising.
Screens and their states
For each screen or HUD element, list its content and its states. A wireframe is useful, but it only shows one state. Add a short table of the others.
| State | Condition | What the player sees |
|---|---|---|
| Default | Dash available | Dash icon filled |
| Cooling down | Cooldown active | Icon grayed, radial fill shows time left |
| Blocked | Pressed during cooldown | Icon shakes, short error sound |
| Unavailable | Ability not unlocked | Icon hidden |
The states people forget most often are empty (no items to show), loading, error, disabled, and "too much content" (a name or number that overflows its space). Leave the final layout to the UI designer, but state any limits that affect the design, such as maximum character counts or the number of items a list must hold.
Feedback
Feedback is how the game confirms the player's input. For each action, say what the player gets on success and on failure, in the visual, audio, and haptic channels. You do not need to design the assets here. Name the moments, such as "dash start", "dash blocked", and "dash ready again", so that the content section can turn them into asset requests.
Also state timing where it matters. A press that produces feedback 200 ms late feels broken even if the rule is correct. A line such as "visual and audio feedback begin on the same frame as the dash" gives engineering a clear target.
Accessibility and platform notes
Add the requirements that change the design, not a generic promise. Examples: no information conveyed by color alone, hold actions have a toggle alternative, text scales to a stated minimum size, and prompts match the active device. If the feature ships on several platforms, state which differences are intended (for example, touch has no hover state) so QA does not file them as bugs.
Example: a controls section
This is a section you could add to the Dash spec. It refers to rules by number and to values by file.
## Controls and feedback
| Action | Keyboard | Gamepad | Trigger |
| --- | --- | --- | --- |
| Dash | Left Shift | East face button | On press |
- Input buffer: a Dash press within `dash.input_buffer` seconds before the
cooldown ends starts a dash when the cooldown ends (Rule 3).
- Dash is read during Gameplay only. It is ignored in menus and cutscenes.
- Dash can be rebound. Binding it to a key already in use swaps the two actions.
## HUD
| State | Condition | Presentation |
| --- | --- | --- |
| Ready | Cooldown inactive | Icon filled |
| Cooling down | Cooldown active | Icon grayed, radial fill |
| Blocked | Press during cooldown | Icon shake, error sound |Common errors
- Describing bindings but not triggers, so press versus release is left open.
- Writing "the menu opens" without saying where focus lands.
- Drawing only the happy path in the flow and skipping Back, Cancel, and error exits.
- Copying numbers like buffer windows into the text, where they drift away from the tuning file.
- Specifying only one device, then discovering that gamepad navigation is undefined.
Exercise
A spec says "Press Interact to open the chest. A prompt appears when the player is near." List three missing details about controls or flow that an engineer would need before building this.
Show answer
Any three of the following. The trigger type, such as press or hold, and the binding on each device. The distance and facing conditions that show the prompt. Which prompt icon appears for the active device. What happens if the player moves away while the chest is opening. How the player closes the loot screen, and where focus starts on it. What the chest looks like and sounds like when it is already empty or locked.