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

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:

  1. 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).
  2. Rule ≠ 2: the local arsenal is loaded and the aura factor set from its capacity.
  3. Rated game and rule ≤ 2: the rating stake is taken up front (0x1401880f0).
  4. 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).

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