Match flow (executable)
Decoded from the battle-flow module of
PDUWP.exe (addresses in SYSTEMS.md
§2). Ticks are 1/30 s. One phase global; each
phase has one counter that its handler counts
down. The per-tick handler dispatches phases
1–12 through a jump table (13 is handled
elsewhere).
| phase | what it does | ends |
|---|---|---|
| 1 | load the stage | when loading is done → 2 |
| 2 | wait until every player’s character is loaded and every peer is ready (online: a counter goes up and is sent) | → set up the players (elapsed battle ticks = 0), start the stage intro → 3 |
| 3 | intro: waits for the intro/menu object to finish | battle setup → 6 directly (the first round has no “ready” phase) |
| 4 | restart, 10 ticks | → 5 |
| 5 | ready, 90 ticks | the clock is (re)loaded with the time limit → 6 |
| 6 | battle | the end check below |
| 7 | next round / retry, 90 ticks (also set by the pause menu’s retry entries) | → 8 |
| 8 | 20 ticks, then waits for all players | players set up again → 4 |
| 9 | results: waits for the players’ choice | → 10 |
| 10 | 20 ticks | → 11 (10 ticks) → back to the menus |
| 12 | online: 60 ticks after the end | → 9 |
At the first battle start two effects spawn (effect files 700 and 701 through the effect spawner 0x14018d280; an earlier version of this section called them sound cues). The ready phase’s countdown cues are in “Match, menu and footstep sounds”.
Battle (6), every tick: the elapsed-ticks counter goes up; when the time limit is on, the clock goes down (it starts at minutes × 1800 from the mode table, 10 minutes in the 20-health rows; 0 = no limit). Then the end check:
- Each team is standing when one of its players has a status record that is alive (its knockout tick is −1), or was knocked out at a tick later than t − 60, where t is the smallest of the players’ current tick values (in a local game: now). So a knocked-out player keeps the team standing for 60 ticks (2 s). (The health routine stores the elapsed tick in the record when the health reaches 0.) A player that left the session counts as knocked out at tick 0.
- The match ends when one team or none is standing (all modes except one special mode), or when the clock is on and has run out.
Result: if exactly one team is standing it wins. If none is standing, the team with the latest knockout wins (the scan keeps the first maximum, so a tie goes to the lower team number). If two or more are standing (the time ran out with both sides up) no one wins: health and knockout tallies are not compared. With the team flag on, every player gets place 0 when on the winning team and 1 otherwise; else a player’s place counts the others standing (or, both being down, knocked out later).
After the end: a custom match with rounds left goes to 7 (90 ticks) → 8 → 4 → 5 → 6 (round counter +1). Otherwise: the online versus types go to 12 (60 ticks) and then the results (9); story-type games go to 10.
Modes: the mode table (gsdata 0x33040, see “Combat rules”) has 12 rows; 8 of them have 20 health, aura start 0 and 10 minutes, the others are special rows (one has 3 minutes). Row 4 is the only one with 40 health and aura start 5 (the heavy variant). The online lobby copies its session’s game rule straight into the match mode; the rated rules are 0–2 (all 20-health rows; the rating table is indexed by team flag × 3 + rule). Row 4 is picked by stepping the host’s game rule to 4 (docs 11-10, “Versus options, stage list, teams and start spots”).