Movement collision response (executable, 0x140255020)

How a character’s move is resolved against the stage collision set, decoded from the floor routine 0x140255020 and the routines it calls (docs 11-10). It replaces the earlier “Wall pass” notes: the pass is not a swept cast of the move; it is a depenetration of the body at its new position, with two guards against tunnelling before it. Units: u = 0.1 m, per tick.

Body. A vertical capsule made of three spheres: radius r = w / 2, centres at the body centre c = feet + h / 2 and at c ± d, d = h / 2 − w / 2 (h = body height +0x12EA0, w = body width +0x12EA4, “Character table” 0x0C / 0x0E; the routine passes h / 2 and h / w). The mover object is the character’s member at +0x12EB0 (its +0x08 = “touched a floor” flag, +0x10 = ground attribute, +0x18 = the character, +0x28 = the probe’s world object, +0x38/+0x3C = blocking wall flag and normal).

Order per tick (after gravity and the stick/skill move have set the new position; old = last tick’s position +0x12E4C, both raised by the body centre height +0x12E98 for steps 1–2):

  1. Long move (length > 12.5 u): one segment cast old → new through the shared segment probe (0x140163950, world query, attribute 31 skipped). A hit replaces the new position by the hit point plus the hit triangle’s normal: a 1 u back-off (movepar 11-14, “Movement parity” section 6; the helper skips attribute 31 only). No sub-steps on this path.
  2. Normal move (≤ 12.5 u) (0x140255e00): the probe sphere (radius h / 2 + 7.5 + move length) collects the nearby triangles once, then
    • a segment guard old → new over those contacts (0x140255b70, same attribute skips as below); a hit cuts the move at the face;
    • sub-steps: n = int(length / 2.5) + 1; when n > 1 the move is walked in n equal steps, and after each step a small sphere of radius = the step length at the body centre is pushed out of every mesh triangle it overlaps (0x140195f30: face first when the centre’s projection is inside the triangle and the centre is in front, push = normal × (radius − distance); else the three edges, away from the nearest edge point). This loop has no attribute filter. A move shorter than 2.5 u has no sub-steps.
  3. Probe refresh: the probe sphere is set to the capsule centre c with radius h / 2 + 7.5 + 15 (long move) or reused from step 2, and queried again (0x1401d5860).
  4. Round arena limit (0x1402559f0, only when the stage number mod 10 = 1): when the horizontal distance of c from the stage origin plus w is over 150 u, the body is put back on the circle of radius 150 − w around the origin (and the inward direction is recorded as a blocking wall when the move ran into it).
  5. Face pass (0x1401959c0, once per contact triangle, in contact-list order; each run sees the position the previous ones left):
    • skipped contacts: not a mesh triangle; attribute 31; attribute 20 while the reaction state is 5 or 7 (“Collision attributes” below); the body centre behind the face (one-sided); a wall face (normal y ≤ 0.643) whose three corners are all lower than feet + 7.5 u while the floor flag is set;
    • for each of the three spheres (centre, lower, upper, in that order): the segment sphere centre → centre − normal × r is tested against the triangle (0x140194210: endpoints on opposite sides of the plane and the crossing inside the three edges). On a hit the penetration is p = r − distance of the sphere centre to the plane;
    • floor face (normal y > 0.643): the body is lifted straight up by p (no sideways move) and the floor flag is set for the rest of the tick;
    • wall face: when the contact point (the sphere centre’s projection on the plane) is lower than feet + 7.5 u, a second probe is made at height feet + 7.5 u from the body axis toward the face along the face’s horizontal normal, length r; if it misses, the triangle is dropped at once (the step-over: anything that ends lower than 0.75 m over the feet does not block). Otherwise the body moves by normal × p (the full 3-D normal, so a leaning wall also lifts or presses the body). Sliding is only this projection: the move’s component into the wall is removed, the rest stays.
    • blocking wall: after a wall push, when normal · (horizontal move direction) < −0.643 the triangle is a head-on wall; the most head-on one of the tick is stored (mover +0x3C) and the character’s flag +0x12E8C is set (its readers were not followed: lead for “run into a wall” behaviour).
  6. Edge pass (0x140195580, a second loop over the same contacts and skips): wall faces only (normal y ≤ 0.643), front side, same 7.5 u low-face skip. For each sphere whose face test misses, each of the three edges: nearest point on the edge (0x140193fd0); when it is closer than r (and not lower than feet + 7.5 u while the floor flag is set) the sphere is pushed away from that point to distance r. Same blocking-wall record.
  7. Floor pick (“Floor test” above) over the same contacts; it also copies the taken floor contact’s attribute to the ground attribute (below) and writes the position back.

There is one pass of each loop per tick: no iteration to convergence and no velocity change (the horizontal speed is whatever the stick/skill code sets next tick; only the position is corrected). Order dependence between triangles is real (list order of the world query).

Confidence: M throughout (every rule and constant was read in the code; none has been checked against footage or a run yet), except the capsule sizes’ source and the 7.5 u / 0.643 constants, which the floor test already uses (H).

Step-up. There is no separate step-up: wall faces and edges lower than 0.75 m over the feet are ignored and the floor pick then lifts the body onto the higher floor (its window is h / 2 + 9 u above the feet). Operands checked (playfix 11-15, H): the face pass computes its gate as the passed position’s y − the passed half height + 7.5 (constant 0x1402f7f58); the caller (0x1402554cc in 0x140255e00) passes the feet + h / 2 (character +0x12E44 plus +0x12EA0 × 0.5) and h / 2, so the gate is feet + 7.5 u exactly. The Palace ground-floor low boxes (attribute 8, 4.2 u tall, st03 meshes 382 / 677) are under it: the game’s rules step onto them (played: our Player rises 0.39 m onto the east one); the central 12 u attribute-18 ring blocks on all four sides.

Body push between characters (player class virtual method 0x140250780; formula M: read in the code; place in the tick H for the order, read in the code (docs 11-12, doc-body)).

Where it runs. The character tick 0x14024ecf0 splits on C + 0x34 (≠ 0: simulated on this machine, a local human or a CPU; 0: driven by the network):

Order inside the movement step 0x140254590:

  1. body push (virtual slot 0x70 of the player class table 0x14048e3b0), always first;
  2. virtual slot 0x80 (0x140250cd0), only while the match phase global 0x1404bc950 ≠ 0: for a locally simulated character, the test against category 0x400 attack bodies (flying pieces, the break sphere). Decoded in “Stage attack bodies and landings”; no position change;
  3. gravity, skipped in action state 0xB (C + 0x12F04): fall speed C + 0x12E84 −= C + 0x12E80, floored at the constant 0x1402f8330 (set to −7.5 u/tick when lower), added to the position’s y (the existing “Player movement” notes);
  4. the collision response 0x140255020 above (on stage 0x7777: a flat floor at y = 0), after clearing the blocking-wall flag C + 0x12E8C;
  5. landing / leaving-ground bookkeeping.

So the push displaces the wanted position before gravity and the wall / floor response of the same tick: a body pushed into a wall is put back by the face and edge passes at once and is never left inside geometry; the push itself never changes heights.

Rule. For the own character s (must be active C + 0x20 ≠ 0 and alive C + 0x24 ≠ 0, else nothing) and each of the four player slots o other than its own (o exists, active, alive, o’s + 0x10 = 0):

Implementation notes for the rebuild