Versus options, stage list, teams and start spots
Decoded from the Store build 1.3.25854.2
executable and the user’s own
setup/stageset/stageset.dat
(numbers only, no names). Rule and type
numbers are given; which menu
name belongs to which number was deliberately
not copied.
Host options (create-game screen; stepper 0x140183010, reset by lobby native 0x140213f00):
| Global | Option | Range and rules |
|---|---|---|
| 0x14050d2d8 | game type | 0..2, steps mod 3; a change resets the rule to 0 |
| 0x140518cf0 | game rule | 0..11, steps mod 12, skipping what the type does not allow (below) |
| 0x14051775c | stage | index into the stage list (below) |
| 0x14051c0e0 | rating limit | 0 / 1 |
| 0x140519ab8 | private slots | places kept for invited players |
| 0x14050d2c0 | session type | 1 = a skill-trade session, not a match |
- Game type: 0 = up to 4 players, every player a team of their own; 1 = team battle (4 players, two teams); 2 = one against one. Player limit (0x140181ba0): 2 for type 2 and for trade sessions, else 4 (M: the meaning is read from how the type is used below).
- Rules allowed per type: type 0: all but 11; type 1: all but 1 and 10; type 2: 0..9. Rule 1 is also skipped while a flag (0x14051c938) is set.
- What a rule is in the code: the match mode (the row of the mode table, “Combat rules”: health, aura start / max, minutes) and the arsenal requirement (“Arsenal rules”). Rule 1 additionally stakes a card from the arsenal (0x14015ada0); rule 2 plays with pre-made decks; rules 6..9 restrict the arsenal; rule 4 is mode row 4, the 40-health “heavy” row: it is an ordinary game rule the host steps to (M). There is no handicap option and no separate health / time setting in the lobby: all of that comes from the rule’s mode row.
- Search filters (stepper 0x140183100): type 0..3 (3 = any), rule 0..12 (12 = any), two three-way filters.
- Session attributes (built by 0x140182b60 as 18 × {id, type, value}, published by 0x140281f40, read back by 0x1402822a0): name, version, game type, game rule, stage, rating max and min (own rating ± 8 × the rating step gsdata 0x3300c; unlimited when the rating limit is off), language, state, rating, rating limit, session type, three skill-trade values (trade sessions only: they are not match rules), platform, cross-play.
In the session: the host’s values are copied to game type 0x1405277b4, game rule 0x1405277fc, stage 0x140527bc8, stage variant 0x140527c54, rated bit 0x1405277cc, and travel to the clients in the start message (unpack 0x140191a60: +0x28 stage, +0x2c variant, +0x30 type, +0x34 rule; per-slot arrays 0x140191b40: start codes, characters, team sides).
Match set-up for an online game (0x140187710), in order:
- Four player records (0x48 bytes each from 0x140527800): present (from the session member table), team, character, local / remote, start code. Team: game type 1 → team = 1 when the slot’s side byte (0x140527980[slot]) is 0, else 0; every other type → team = slot index (everyone alone).
- Rule ≠ 2: the local arsenal is loaded and the aura factor set from its capacity.
- Rated game and rule ≤ 2: the rating stake is taken up front (0x1401880f0).
- Match mode (0x1404bc5dc) = game rule; 0x1404bc8b8 = game type; the battle starts (0x140128990) with game mode 5 for a team battle, 4 otherwise (global 0x1404bc9d4), the stage and the variant.
Rating change after the match (0x140188290, 0x1401881d0): only rated games with rule ≤ 2; the factor is gsdata[0x33010 + 4 × (type × 3 + rule)], the step gsdata 0x3300c (M, the team averaging was not followed).
Stage list
(setup/stageset/stageset.dat, and
one per language; loader 0x14017d830 → runtime
table 0x140509ba0, count 0x14050a5d0). Our
struct:
converter/stageset_dump.py.
| Part | Layout |
|---|---|
| header, 16 bytes | u32 file size, u32 record count (30), u32 string pool offset, u32 0 |
| record, 0x14 bytes | u32 × 3 string offsets into the pool; s16
stage number (NN of
stNN); s16 variant
count; s16 selectable
flag; s16 0 |
Values in the 2017 build (index: stage, variants, flag): 0: 1, 0, 0 · 1: 1, 1, 0 · 2–6: own index, 2, 1 · 7: 7, 1, 1 · 8: 8, 2, 1 · 12–16: own index, 2, 1 · 17: 17, 1, 1 · 22, 23, 25, 26: own index, 2, 1 · 24: 24, 3, 0 · 9–11, 18–21, 27–29: unused fillers (flag 0). So 17 stages are selectable in versus: 2–8, 12–17, 22, 23, 25, 26 (H: read from the file and from the loader).
- Variant: the lobby’s stage native (0x140213c00) stores the stage and draws the variant at random: variant = (rand15 × variant count) >> 15, i.e. 0 or 1 for most arenas. It goes into the stage variant byte (0x140531dcf, applied by 0x140187680): the byte that picks the stage’s object list and look (“Stage layout sections”). The host draws it; clients get it in the start message.
- The second s16 is the variant
count, not a “kind”:
converter/stageset.pywrites it askindinto stages.json (a note for the next converter change).
Start spots (0x1401d1da0; corrects “Start positions”): each player has a start code. set = code >> 2 picks the CP00 chunk at stage header word 0xA4 + 4 × set; code & 3 (mod the chunk’s player count) picks the player record in it. The online host deals the codes (0x1401907a0): set 5 or 6 at random (header 0xB8 or 0xBC), codes 4 × set + {0, 1, 2, 3}, then 100 random swaps among the four slots. So the versus start spots are one of two four-player sets, shuffled, decided by the host and sent to everyone (H for the routine, M that no later step overrides it in team battles: teammates are not placed together by this code).
Teams in the battle. Team = character + 0x1c (player index + 0x14, start code + 0x18). The battle code compares teams only in: the end check and placing (“Match flow”), the ally search (0x1402516a0), the lock’s valid-target test (with its teammate option), the knockout routine (0x14024e000), one all-enemies effect (0x14026fd8c), the HUD and the net code. The hit code has no team test: skills hit teammates (M: no compare was found in the shot / blast hit path; “every object can hit any character” in “Skill kinds” agrees).
Not decoded: the lobby’s team-side choice (who writes the side bytes, and whether sides can be uneven); respawn rules, if any mode has them (three status records per slot hint at lives; not followed); the two three-way search filters; rules 3, 5, 10 and 11 beyond their mode row and arsenal requirement; the team rating average.
Implementation notes for the rebuild
- Lobby options are just: game type (free-for-all 4 / team 2v2 / 1v1), game rule 0..11 (type-dependent subset), stage (17 choices), rated, private slots. Health, aura and minutes come from the rule’s mode row; heavy = rule 4.
- The host draws the stage variant (uniform over the variant count) and the start codes (set 5 or 6, shuffled) and sends both; clients must not draw their own.
- Team battle: team from the side byte; other types: team = slot. Friendly fire is on.
- Game mode 4 / 5 (versus / team versus) is what the camera and HUD code test.