Movement parity: the per-tick walk, turn starts, air, roll, landing; collision details; the Palace benches; a parity test
What a 1:1 movement needs beyond the sections above, read in PDUWP.exe (the movement state machine 0x140256e80 and its handlers) and checked against our converted Palace data. “M” is the movement controller, the character’s member at C + 0x12F00 (so M + 0x04 is the action state C + 0x12F04); “T” is the wanted heading. Angles are integers, 0x8000 a turn. Confidence per block; none of it has been compared with a recorded run yet (section 8 is the plan).
1. Inputs to the tick (M code)
- Stick length L = sqrt(x² + y²) of the two dead-zoned axes (“Sticks”: each axis 0..1), in float32; not clamped, so a full diagonal gives up to 1.414. Stick angle A = trunc(atan2(x, y) × 5215.189) (= 32768 / 2π as float32), stored at C + 0x14270; 0 with L = 0 (input fill 0x140256580 / 0x140256710).
- M + 0x20 = L each tick, or 0 while the player’s move lock (table 0x1404bbd80, 9 words per player slot) is set. M + 0x24 = the speed scale 1.0 + status(1) / 100.
- Run flag M + 0x18: set when L > 0.7, cleared when L < 0.4 (float32 constants 0.699999988 and 0.400000006; strict comparisons).
- Wanted heading T = camera yaw (C + 0x12E5C) + A, plus 0x4000 while status 0x23 is on (reversed controls). C + 0x12E5C is the yaw the play camera keeps for the character (it points at the target while the lock tracks); for a CPU it is the base its own input writer (0x140178b80 area) adds the heading to its destination to.
- Sine table. Every direction comes from one float32 table at 0x14054ca90 indexed by the 15-bit angle (cosine = index + 0x2000): forward(a) = (sin[a], 0, cos[a]). There is no sin / cos evaluation per tick, so a rebuild that uses the same 32768-entry float32 table (sin(2π i / 32768) rounded to float32) reproduces the directions bit for bit.
- The body matrix (C + 0x12E00, forward vector at + 0x12E20) is rebuilt from the facing C + 0x12E68 once per tick, after the movement step (0x1402512c0, run from the character tick behind the camera object’s tick). The state handlers run before it, so a move “along the facing” uses the facing as it was at the end of the previous tick.
2. Action states of the movement machine (H for the table, M for the names)
Dispatch on M + 0x04 (jump table 0x140257290, 32 entries). Those that matter for movement:
| State | Handler | What it is |
|---|---|---|
| 0, 0x15, 0x16, 0x1D | 0x14025b5e0 | standing (0x15 / 0x16 the stances, 0x1D a timed stand) |
| 1 | 0x14025ad50 | walk / run forward |
| 2 | 0x14025af60 | a timed slide along the heading at 2.5926 u / tick (= 28 / 10.8), then state 9 for 20 ticks (not followed further) |
| 3 | 0x14025afe0 | the dash (roll evade, special dash) |
| 4 | countdown, then 0x14025a0b0 | jump windup, then the rise entry |
| 5 | 0x14025b0f0 | in the air |
| 6, 0x14, 0x17 | countdown only | landing and two other timed holds |
| 7 | 0x14025b170 | the float |
| 8 | 0x14025b270 | turn start (section 4) |
The setter 0x140259d10(state, counter) stores the previous state and counter and zeroes the tick count M + 0x0C. So the camera’s yaw-follow “action state 1” is exactly the forward walk / run (both speeds), not the turn start and not the air.
3. Walk / run forward, state 1 (M code)
Per tick, in this order:
- L = 0 → state 0 (the stand; nothing else this tick: no slow-down phase).
- The animation is the mode table’s walk or run slot by the run flag (switch keeps the phase, “Movement animations”).
- Turn step (0x14024f8f0 → 0x140193b50): d = T − facing wrapped to ±0x4000; when |d| ≤ R the facing becomes T (masked to 15 bits), else facing = (facing ± R) & 0x7FFF. R is the character table’s turn rate: 20° × 91.0222 = 1820.44 before the integer store (1820 units if truncated as every other angle conversion read here is; M, the store itself was not found).
- Slow-down factor f = max(0, (8192 − |facing − T|) × (1 / 8192)) with the facing after step 3: the remaining angle, not the angle before the turn. f = 1 as soon as the stick is within one turn step of the facing; f = 0 while more than 90° remain. (This corrects “Player movement”, which read Δ as the angle between facing and stick.) The handler overwrites M + 0x20 with f × speed scale.
- Move: position += forward vector (previous tick’s facing, section 1) × f × speed scale × (7.5 / 10.8 = 0.69444442 walking, 20 / 10.8 = 1.85185182 running; float32, multiplied in that order). Skipped while status 4 is on.
Worked example, standing about-face without the lock (R = 1820): the stand tick only starts the walk (no move, no turn). Then the remaining angle after each turn step is 14564, 12744, 10924, 9104, 7284, 5464, 3644, 1824, 4, 0: f = 0 for four ticks, then 0.111, 0.333, 0.555, 0.777, 0.9995, 1; each of those moves goes along the facing of the tick before. The body reaches full speed on the 10th tick after the start tick.
From the stand (0x14025b5e0 with L > 0): status 4 gives a stagger state; otherwise the turn-start test of section 4, else the walk / run slot is started and the state becomes 1. The first move is made on the next tick.
Standing with the lock (L = 0, the lock object’s “tracked this tick” word C + 0x13F24 ≠ 0 and C + 0x30 ≠ 0): the facing steps toward the camera yaw C + 0x12E5C by R per tick. Without the lock a standing body never turns.
4. Turn starts: mode-table fields 3–10 are not “turn in place” slots (M code, H table)
The mode table’s fields 3–10 (“Movement animations”: 21, 17, 22, 18, 23, 19, 24, 20 for the normal mode; index = direction × 2 + run flag) are one-shot turn starts, played only from the stand, only when all of these hold: the lock tracks (C + 0x13F24 ≠ 0), C + 0x30 ≠ 0 (a flag of the character we did not follow; taken as “has a camera”), the mode is not 3, and the camera yaw is within ±0x38D (9.99°) of the facing (the body already faces its target). Then, with D = T − facing wrapped to ±0x4000:
| D (angle units) | Direction index | Facing offset (C + 0x12E70) |
|---|---|---|
| 0x1001 .. 0x2FFF (45°–135° one way) | 0 | −0x2000 |
| −0x2FFF .. −0x1001 | 1 | +0x2000 |
| ≥ 0x3000 | 2 | 0x4000 |
| ≤ −0x3000 | 3 | 0x4000 |
| exactly −0x4000 | 2 or 3 by a random draw (C runtime rand) | 0x4000 |
| otherwise (within ±45°) | none: the plain start of section 3 | 0 |
For indexes 0–3: heading C + 0x12E6C = T, facing = heading + offset, the slot is started and the state becomes 8 with counter = slot length − 1. State 8 per tick (0x14025b270):
- position += forward(heading before this tick’s turn) × speed scale × walk or run speed (0x14024fa50: an own Y rotation from the sine table, not the body matrix). Full speed, no slow-down factor.
- L = 0 → facing = heading, the stand slot, state 0.
- Status 4 → the stagger. Current slot not one of 17..32 (the one-shot ended and its queued walk / run slot took over) → state 1.
- Otherwise the heading steps toward T by R (same rule as the turn step), facing = heading + offset, and the slot is re-picked by direction and run flag with the phase kept; the mode’s walk / run slot is queued behind it. When the queued slot takes over, the animation player sets facing = heading once (0x140257694, flag M + 0xE8). An evade pressed in state 8 also sets facing = heading first (0x140251aa3).
So with the lock held, a push sideways or backwards from the stand makes the body move at full speed in the stick direction from the first tick while the one-shot turns the drawn body round; without the lock the same push turns at 20° a tick with the slow-down of section 3. Esper-RE’s animation enum names these slots “turn walk / turn run, right / left / back-right / back-left” (17–20 and 21–24; the table pairs them the other way round from the names: run flag 0 takes 21–24). Not decoded: which way each one-shot rotates the drawn model (it must cancel the offset by its end; compare with footage), the status modes’ slots 25–32, the C + 0x30 flag.
5. Air, landing, roll (M code)
- Air (state 5, 0x14025b0f0), every jump and every fall: with L > 0 the turn step and the factor f of section 3, then position += forward (previous tick’s facing) × f × 1.85185182. The speed scale M + 0x24 is not applied in the air, and there is one speed whatever the run flag. With L = 0 nothing moves horizontally and the facing stays. Then, when the vertical speed is negative and the slot is not a down / landing slot, the fall entry.
- Windup (state 4): a countdown, no handler: no move, no turn.
- Landing (state 6): a countdown, no handler: no move, no turn, the stick is not read. From the landing tick t0 (counter = slot length n − 1): ticks t0 + 1 .. t0 + n − 1 count down, tick t0 + n switches to state 0 and starts the stand slot, tick t0 + n + 1 is the first stand tick that reads the stick (it only starts the walk), tick t0 + n + 2 is the first move.
- Roll / dash (state 3, 0x14025afe0): while its counter runs, and while the move counter M + 0x9C > 0: position += forward vector × M + 0xA8 (the per-tick distance of “The evade”, at most 10 u). It reads no stick and changes no angle: the roll goes along the body’s facing as it stood at the end of the tick before the press (after a turn start: the heading), in a straight line, and cannot be steered. The dash start (0x140270690 area) sets only the distance, the two counters and the state; it writes no angle. (M that nothing on the cast path between the press and that start turns the body: the path’s two ends were read, not its middle.) At the end: state 0 and the stand slot.
6. Collision response: the three open details (M code)
Long move (> 12.5 u) hit response. The shared segment probe helper 0x140163950 returns the nearest front-facing mesh-triangle contact along old → new (attribute 31 skipped; attribute 20 is not skipped here, whatever the state) as its contact point P and the triangle’s normal N. The floor routine then sets the position to P + N (one vector add; the normal as stored in the contact, unit length), minus the centre height on y. So the back-off is 1 u (0.1 m) along the hit normal, not the body radius.
Contact list order. The world query 0x1401d5860 walks the dynamic object list, then the static list, each in list order; an object is put at the head of the static list when added (0x1401d4e90), and every new contact is put at the head of the probe’s contact list (mesh pair routine 0x1401d7c80, triangles visited in file order). The passes therefore see: the static objects in the order they were added, each shape’s triangles in reverse file order, then the dynamic objects. (M: that the stage loader adds the arena shapes in file record order, and where the placed objects’ shapes fall in it, was not stepped through.) Lists rebuilt every tick (playfix r3, M): the two lists the query walks (heads at 0x1405302f8 and 0x140530298, two slots each) are double-buffered on a flag at 0x1405301e4; 0x1401d5838 flips it and clears the new slots, and 0x1401d4e90 is “link this body into the current slot of the 0x140530298 list if it is not there yet” (head insert, then its shapes’ contact heads cleared). Bodies re-register each tick from their updates: characters (a tail jump at 0x1401b8f89), stage objects through 0x1401fda60 by their mode word +0x134 (1: the 0x140530298 list through 0x1401d4e90; 2: the 0x1405302f8 list; skipped under flag 0x80000), and 0x1401f7250 / 0x1401f9f45 after moving a body’s shapes. So “the order they were added” is the order of this tick’s registrations. Where the arena’s shapes register against the placed objects was not followed (the 0x1401d5cd0 path, list by byte +0x40, is a lead). The rebuild walks shapes in its own add order (stage objects before the arena) with each shape’s triangles reversed (ledger “Contact order: stage objects against the arena”).
The floor flag (mover + 0x08) is not the ground flag. It is written in three places: 0 by every launch (the rise entry 0x14025a0b0 and the two knockback launches 0x140258d93.. / 0x140258f12.., each next to the ground flag C + 0x12E74); 1 inside the floor routine as soon as a face pass lifts the body on a floor face; and at the routine’s end to whether the floor pick grounded the body this tick. It is read by the face and edge passes (the 7.5 u low-face skip) and by the floor pick (its window starts 7.5 u + the move below the feet when set, at the feet when clear). The ground flag C + 0x12E74 differs in one case: after the floor is lost it stays set until the feet are 5 u under the remembered floor, while the floor flag is already 0. In those ticks low faces block and the floor pick takes only floors the feet pass through.
Built (playfix r3):
player.gdkeeps the floor flag apart from the ground flag (_floor_flag: 0 on a launch and a teleport, the floor pick’s result after each response).
Step-up while falling: unchanged from “Movement collision response”: no fall-time cut-off exists; with the floor flag clear (any fall, any jump) the low-face skip is off, so a ledge’s face blocks at any height and the body lands only on floors its feet pass.
7. The Palace benches (H data, M for what the response does with them)
- The benches between the two escalator pairs (st03) are placed stage objects, not arena mesh: object kind 9 of the stage’s object list (class table 2, class 3: a breakable structure, 1 hit), four placements in two back-to-back pairs on the ground floor (floor height 50 u, midway between the escalators), plus seven more elsewhere in the active list.
- Its collision shape (state 0 of the kind’s per-state lists, 14 triangles, attribute 10, one-sided): a seat front 5.3 u high, a seat top sloping from 5.3 to 6.0 u (a floor face), a backrest face leaning back from 6.0 to 10.9 u (a wall face), a 10.9 u back face and two end faces; no top face on the backrest. Footprint 7.1 × 26.5 u.
- Structures sit in group 0x100, which the
character probe’s hit mask 0x1900 includes; the
floor loop treats an owned contact specially
only when its owner is the jump-pad kind
(callback kind byte 6,
pdStageColPtr_StObjJump: a trigger, never a floor). A bench triangle is an ordinary contact in every pass. - What the decoded passes do
(worked by hand on these numbers, body h = 18, w
= 10):
- from the front, on the ground with the floor flag set: the seat front (all corners under feet + 7.5 u) is skipped, the floor pick lifts the feet onto the seat (5.3–6.0 u); from there the backrest and the back face top out 4.9–5.6 u over the feet, under 7.5 u, so both are skipped too and the body walks through the backrest and drops behind it;
- from the back, on the ground: the back face reaches 10.9 u, the step-over probe at feet + 7.5 u hits it, the body is pushed out along the face normal: blocked, sliding along it;
- in the air (floor flag clear): every face blocks.
- So the rebuild’s “runs over the bench from the seat side” is what the decoded response gives; it is not a rebuild-only fault. Observed in the game (playtester playtest in Rebirth, PC build, 11-15; it corrects the 11-14 note “the game blocks”): you can walk over the benches between the escalators. So the climb-over from the seat side is game behaviour. Not yet checked by the playtester: the stop at a bench’s back. Footage: the 1 fps sheets of the playtester’s Rebirth Palace match show no run into a bench that can be judged.
- Rebuild check (playfix
r2 11-15,
test_palace_bench.gd): the four placements are 57 / 60 and 58 / 59 of the active list (0.71 m deep, 1.09 m high, 2.65 m long); each pair stands back to back with the back faces 0.07–0.09 m inside each other. The real Player on one bench alone (partner’s collision off): from the front it climbs to 0.59–0.84 m (seat, then the backrest slope as a floor) and passes the back; from the back it stops 0.86 m from the centre with no climb. That is the decoded result above, on base as well (no change was needed). On the pair as placed the outcome depends on the path: most runs climb over both, some stall on the seat (the floor pick drops the body to the ground just behind the near back, inside the far bench’s back face, and the next tick’s response puts it back onto the near seat, 0.66 m), so the pair can stop a run, but not reliably. Round 3: that drop came from two rebuild differences, both decoded in section 6 and now built: the floor flag was our ground flag (so it stayed set for 0.5 m of drop and the pick’s 0.75 m + move window reached the floor between the backs) and the contact order was Godot’s (so whether the pick took the backrest slope over the floor changed with the broadphase). With the separate floor flag and the add order, a run from each seat side (57, 60, 58, 59; three start distances each) climbs over both benches, feet never on the floor between the backs, at most one 0.18–0.28 m push back (60’s seat against 57’s back face). The order of the placed objects against the arena is not decoded: with the objects after the arena, 59+58 and 60+57 loop (drop, put back 0.37–0.45 m, 15–17 times in 60 ticks). The climb-over observed in the game (Rebirth 11-15) matches the order built (objects first); the registration order itself is still undecoded. Round 4: a stage object keeps its place in that order when a state change re-adds its bodies (keyed by its active-list index, not by a fresh add stamp, which would have put it after the arena), as the game re-registers each object from its own update every tick.
8. Parity test: the game’s own position stream against the rebuild
What exists. The versus
position message (message 0, “Versus network
messages”) leaves each machine every second tick
(the game header’s “elapsed tick / 2”) with the
position, the facing (u16), the action id and
the animation frame of the sender’s own body; it
carries no input and no velocity.
converter/netmsg.py decodes the
captures.
What to record (one session per case, Rebirth on the Deck, Palace, a 1v1 with an idle second body so no hit moves the test body):
- the loopback capture as on 11-14 (needs the playtester’s sudo on the Deck for the capture only; ask through the orchestrator, never store the password);
- the pad, raw: a logger on the Deck’s event device writing {monotonic time, axis / button, raw value} for the left stick, the evade and the lock buttons (the unattended input daemon can log what it sends; for hand play read the same device);
- the screen (rec2.sh) only as a cross-check of what the case was.
Cases (each 10–20 s, scripted through the input daemon so they repeat): stand → full stick in 8 directions, unlocked and locked (turn starts); about-face while running; a slow stick circle at full deflection and one inside the 0.4–0.7 band; run, release, run; stick flick during the jump evade; roll evade with the stick held another way; run off a 1 m ledge with and without the stick; run into a wall head-on and at 30°; run at a Palace bench from the front, the back and an end; run up and down an escalator.
Replay. The rebuild gets a
test that loads {start position, start facing,
camera yaw per tick, the dead-zoned stick per
tick, buttons per tick} and steps
Player.simulate at 30 Hz with no
rendering, writing position / facing / action
per tick.
- Inputs per tick: take the last pad sample at or before each tick time; apply the game’s dead zone (13000, / 19767) and section 1’s length and angle maths in float32.
- Camera yaw: not on the wire. For unlocked cases keep the right stick untouched and the walk short, or better, use cases where the yaw is known: locked (yaw = bearing to the target, itself in message 0) or CPU-style straight lines. Yaw-follow while walking sideways must be modelled from “Play camera” for the long unlocked cases; treat those as second tier.
- Tick alignment: the capture gives the sender’s tick / 2 per sample; the pad log has wall time. Align by the first position change after a stand: per section 3 the first move is the second tick after the stick leaves the dead zone, so the offset is fixed by that event to ± 1 tick; then search offsets −2..+2 ticks and keep the one with the smallest position error over the case. Report the offset; it must be the same for every case of a session.
- Comparison: at every sampled tick (15 Hz) compare x, z, y, the facing and the action id.
- Tolerances: facing exact in angle units once the alignment is fixed (integer maths; allow the u16 wire format’s scale); position within 0.01 u per sample on flat ground and no drift (the error must not grow with time: a constant offset means alignment, a growing one means a wrong rule); action id exact; landing and state-change ticks exact. Wall slides and steps: within 0.05 u, and list each sample over it with the contact triangles, since the contact order (section 6) decides them.
- Float32: the game adds float32 products in the order of section 3 step 5. GDScript floats are 64-bit; to make “no drift” a fair test the replay rounds each product and each sum to float32 (a PackedFloat32Array store) in the same order. Without that, expect differences of about 1e-5 u per tick, which the tolerance above still passes over 20 s.
Implementation notes for the rebuild
- Angles: keep facing, heading, camera yaw and the stick angle as 15-bit integers and take every direction from the 32768-entry float32 sine table; R = 1820 for the playable cast.
- State 1: turn step, then f from the remaining angle, then the move along the previous tick’s facing; no move on the start tick; no slow-down on release. Replace the face-the-stick-at-once body and the Δ-before-turn factor.
- Turn starts (state 8) from a locked stand: the table of section 4, full speed along the heading, the heading following the stick at R, facing = heading + offset, slots 17–24 from the mode table, facing = heading when the one-shot ends or on release.
- Air: the same turn step and factor at 20 / 10.8 u per tick for every jump and fall, no speed scale; landing: rooted for the slot’s length, first move two ticks after it ends.
- Roll: along the facing at the press, never the stick, no steering.
- Collision: back a long-move hit off by 1 u along the normal and stop skipping attribute 20 in that cast; walk contacts as shapes in load order with each shape’s triangles reversed; keep a separate floor flag (cleared by launches, set by a floor-face lift, else last tick’s floor-pick result) for the low-face skip and the floor pick’s window.
- Benches: no special rule; build the replay test first and record the bench cases before changing anything.