Stage objects: classes, hits and breaking

Read from the executable (class tables, the object base class and the crumble / roll class families) and checked against all stage files with a struct reader (StageHeader, Placement, ObjectDef, Esper-RE’s armature chunk and joint_t). What is only skimmed is marked.

Loading (0x140203720) and spawning (0x140203dc0).

Object parameters live in the model. Each state’s model has a skeleton chunk (type 3); the 16 bytes Esper-RE’s joint_t calls pad2 are four floats per joint. The definition builder (0x1401e24d0) scans every joint of each state model and keeps, per state, the last non-zero value of each float as a byte, plus a flag byte (bit 0–3: that float is non-zero somewhere, bit 4: a joint with name code 0x4F588000 exists).

float on the state 0 model on the pieces model (state 1) on the wreck model (state 2)
0 (one stage only) attack value of that piece (2, 3 or 4): when non-zero the flying piece carries an attack body (category 0x400, pdStageColPtr_StObjAtck) while it moves faster than 1 unit per tick; what that body does to a character is not traced 2 or 3
1 sets a flag bit on the object (value 2 or 3 where set; effect not followed) (rare) 2 or 3
2 hits to break (0 counts as 1) — —
3 sets object flag 0x2000000 (effect not followed) — —

In every stage file the hit count is 1, 2 or 3. On the Palace (179 placements in list 0): 30 pieces of one class (table 2 class 8) take 2 hits, four pieces of class 23 take 2 or 3, everything else breaks on the first hit.

What hits an object (base class, 0x1401fd6e0, every tick).

Breaking (crumble family 0x1401e85b0, roll family 0x1401ec350). Runs once per object:

  1. every effect record of the current state with kind 2 and id 0xFF is spawned at the contact point (92-byte records, as in EF00);

  2. the object’s collision bodies are removed, so shots and bodies pass from this tick on;

  3. the break sound is played at the contact point. Sounds come from the object sound table (header 0x0F8, one s16[8] row per definition; 0x1401fc750): word 0 = hit sound, word 1 = break sound (the Palace rows have no hit sound and a break sound on every breakable definition);

  4. if the object has a pieces state, the object switches to it and every joint of the pieces model that has a mesh becomes its own flying piece (0x1401e8960; corrected 11-13: only the joints whose parent is joint 0, see “Broken pieces: the start pose”):

    • joints named 0x4B085FC0 stay where they are (the stump that remains); name 0xC3500000 marks another special piece;
    • velocity (game units per tick) = ½ · (impulse + d̂ · L) · F, where d̂ is the unit vector from the contact point to the piece, dist that distance, impulse the reversed contact direction, L its length, and F = √(1300 / dist) for dist > 200, else 2.54951 (= √(1300 / 200)); when the impulse is nearly zero (L² < 0.1) each component gets a pseudo-random −0.1..+0.1 (byte hash of the object’s serial plus a running counter that starts at 0 per break and advances only for pieces that take the jitter: h = low byte of s·33 + 33 + (s >> 1), value h · 0.2 / 256 − 0.1); the result is scaled by a per-model factor and, if longer than 1.5, set to length 1.5;
    • gravity is (0, −0.5, 0) (vector at 0x140461660) times a per-model factor, applied as acceleration / 30 per step (11-13, climb: the factor and the launch factor are the floats +0x38 and +0x34 of an effect record of type 31 in the object’s own state-0 effect list; without that record both are 1; see “The launch / gravity factor record” below. Gravity is 1.0 in every record of the game);
    • only when the global at 0x1403e0304 ends in 5 (value mod 10; corrected 11-13, climb 3: this is not a tick counter but a value set per battle that the stage setup also tests by its last digit, a stage number by its use (M); the piece routine’s test is for 5, so not on the Palace, st03) the piece also gets a second acceleration vector (random direction, length 0.5) that replaces gravity once the piece is older than 30 ticks;
    • the piece’s attack value is its joint’s float 0 (see the table above); object flag bit 2 delays the piece’s stage collision by 8 ticks.
  5. Crumble family (Palace classes 3, 8, 18, 23, 28 of table 2): without a pieces state the object is deleted (flag 0x80000). Roll family (classes 1, 2, 4, 17): corrected 11-14 (playfix): not this path at all; the state-2 model flies as one box and the object switches to state 1 or is deleted, see “The roll break: one flying box”.

Sound row value → cue (stageobj, 11-10). 0x1401fc750 reads word k of the object’s row (0 = hit, 1 = break); a negative value plays nothing. Otherwise the value and the contact point go into a stage-wide queue (0x140201ce0: at most 64 entries of value + position). The queue pass (0x140201d30) does nothing but count down while a cooldown runs (entries queued meanwhile are dropped); with entries and no cooldown it sets the cooldown to 30 passes, plays the first entry and then every later one that is at least 500 units (float at 0x1402f81b8) from all already played, at most 5, and empties the queue. The played cue is table[2·value + r] of the u32 table at 0x1402dc640, r = one random bit (rand15·2 >> 15), on sound slot 0 = the common bank (same call as the aura point sound), at the queued position with volume / pitch 0x1000. Table by value: 1–6 → cues 8–13; 8 → 14; 9 → 16; 17–23 → cue = value or 155 + value; 24–29 → the pairs 179/180 … 189/190; (stagefx 11-15) 36–39 → the pairs 191/192 … 197/198 (used by row word 2, the piece impact sound); every other entry −1. The Palace’s rows (17, 19, 20, 21, 22, 26) all have both cues in the common bank.

Pieces model per joint (stageobj). Each index buffer of the pieces model names its joint (transform_idx, as in Esper-RE’s idxbuf_header); its vertices are in that joint’s space and the bind matrix puts them in model space. pdconv --split-joints <models> writes such a model as one node model_<m>_j<k> per joint (geometry still baked in model space, node extras pd_joint and pd_bind, the joint’s bind matrix in glTF space); everything else of the glTF (the .bin, accessors, materials, shadow volumes) stays byte-identical (checked on st03: same .bin, same primitives per model). On st03 the 22 pieces models have 2–11 joints with a mesh. A pieces model at its bind pose does not always match the intact model: the definition 0 pieces model of the Palace is modelled already cracked (bounds y 83.6–115.2 vs 97.7–110.9 intact) and most bridge pieces are 1–2 units taller; 1 of 22 matches the intact bounds within 5 %.

Lifetime of the objects. Objects are spawned only by the stage setup (callers 0x1401d1870 and 0x140204e60) and removed with the stage (0x140203d20 ← 0x1402045d0 ← 0x1401d1b90). No respawn path during a battle was seen: a broken piece stays broken until the stage is loaded again.

Broken pieces: an 8-point box (class pdStageObjRollBase, tick 0x1401f9900). A piece is not a rigid body with a spin; it is eight points (the corners of the piece’s box, set from its matrix by 0x1401f8440) moved by position-based steps, and the drawn matrix is rebuilt from the points each tick (edges from point 0 to points 1, 2 and 3).

The box is the stored bounds of the joint’s first index buffer chunk (corrected 11-13, “Broken pieces: the start pose”), changed per axis: an axis longer than 5 units is inset by 15 % of its length on both sides; one shorter than 1 unit becomes −0.5..+0.5. The piece also keeps the volume of the unchanged box (its “size”). Point numbering: 0 the low corner, 1–3 its three neighbours, 7 the far corner; the 12 edges are the byte pairs at 0x1403e1178, the 6 faces the byte quads at 0x1403e0f48.

Per tick, two sub-steps of:

  1. per point: velocity = current − previous position; a point whose velocity² is below 0.005 adds one to its slow counter (a byte that is never reset), and counts as resting once the counter is above 16; then velocity += acceleration / 30;
  2. when all eight points rest, the piece goes inactive (nothing below runs any more);
  3. new position = current + velocity; the piece is deleted when point 0 is at or below y = −100 or 800 units or more from the origin;
  4. once the piece is older than its collision delay (0, or 8 ticks): stage collision (0x1401f8cd0). Each corner looks up its cell of the stage’s triangle grid and goes through that cell’s triangles, passing over grid records whose first byte is 0x10, 0x11, 0x12 or 0x14 (the mesh attribute; confirmed 11-13, climb: the grid’s record byte is the shape record’s attribute byte). Corrected 11-13 (climb 3): after the grid each corner is also tested against the up-facing triangles of some intact stage objects (“Broken pieces: the object pass” below); characters are not seen. The grid itself is described under “Broken pieces: the Palace climb re-check”. A corner P that is behind a triangle’s plane (n·(P − V0) < 0) by less than 2 units, and whose projection on the plane lies inside the triangle, is moved to that projection; then half of its velocity’s x and z are taken off its position (0x1401f7870). No ray and no test of the direction of motion. A piece whose size is above 2200 does the same with its 12 edge midpoints (0x1401f7570): both points of the edge move by what puts the midpoint on the plane, each then loses half its own velocity’s x and z; a size above 800 adds the 6 face centres (0x1401f7280, four points each);
  5. twice (0x1401f9590): 28 distance constraints (rest lengths from the box in the joint’s space, which is the launch pose as long as the joint chain has no scale): both points move half the length error toward the rest length. Corrected 11-14 (collapse 6): the 28 are not every pair of points; they are a fixed table (12 edges, 4 body diagonals, 6 face diagonals twice), see “Broken pieces: test order, constraint table and rest”.

A piece that starts inside the stage (checked 11-13 on the Palace bridge): the step is one-sided and has no motion test, so a corner that is already behind a face by less than 2 units at the launch pose is moved onto it at once, and the move becomes velocity on the next sub-step (velocity = current − previous). A piece wedged between faces of opposite facing is squeezed out upward: in our build Palace deck section 1, broken by losing its pillar, has a piece that starts inside the tree’s faces (attributes 10 and 31, which the pieces test) and climbs. Updated 11-14 (collapse round 5): the start pose is decoded since round 4 (“Broken pieces: the start pose”), and the footage contradicts the climb (climb 3). With every decoded rule built (collision delay, jitter, object pass, collapse 6), that piece still rises 36.6 units in our build (25.6 in round 5, 64 in round 4, 44 before the decoded pose; the collapse-6 port: 38.1). Updated 11-14 (collapse round 7): shipped as a known gap, built as decoded with a cause still missing: PLACEHOLDERS “Palace deck section 1 high throw”. See “Broken pieces: the object pass, delay and jitter”, “Measured in the rebuild”. With no impulse the launch is the jitter alone (added after the scaling, |j| ≤ 0.1·√3 ≈ 0.17 u/tick), i.e. a rise of ≤ 0.5 u under the piece gravity of 1/30 u/tick².

End of a piece. A moving piece counts its ticks and is deleted after 300. An inactive (resting) piece is deleted as soon as it is older than 32 ticks, which it almost always already is; only pieces made from a joint named 0xC3500000 stay where they came to rest. There is no fade: the alpha the draw computes for a piece that is being removed comes out as full.

Not followed: the consumer of its attack body, the two flag bits set by floats 1 and 3, the roll / touch / wall / float behaviours of the other class families, how a character uses the jump pad’s parameter, the kinesis pick-up of objects (0x140268ee0 → 0x14012e160), and which battle setting picks the placement list (11-14: the list rule itself is decoded, “test order, constraint table and rest”; what sets its selector byte is not).

Broken pieces: the start pose (docs 11-13, piecepose)

Where the eight points of a piece are when it is made. Read in the executable (make pieces 0x1401e8960, joint matrices 0x1401fe9c0, joint table 0x1401cb510, box 0x1401f7dd0, piece vtable at rva 0x48c640) and computed from the Palace’s stage file with converter/piecebox.py (structs: Esper-RE’s idxbuf_header as IndexBuffer, Joint, Armature; synthetic test converter/tests/test_piecebox.py). H = read in the code and checked on st03’s data, M = code only. Nothing here was checked against footage.

Short answer. The start pose has nothing to do with the object’s stored point. A piece starts where its joint puts it in the pieces model: the object’s matrix, times the joint’s matrix from the model’s armature records, applied to a box taken from the joint’s first index buffer. The stored point is only the centre the launch direction is measured from.

Which joints become pieces (H). Make pieces goes through the joints of the pieces model that have at least one index buffer:

Joint What happens
parent below 0 (the root) nothing: never a piece
parent = joint 0, name 0x4B085FC0 the stump: stays, its matrix is copied to the object’s second joint table
parent = joint 0, any other name a piece (name 0xC3500000: the piece that stays where it rests)
parent above 0 never a piece. Its entry gets flag bits 0x12; if the top of its parent chain (the first joint whose parent is 0 or below) is a stump or the 0xC3500000 joint, the same entry of the second joint table gets the bits too. What draws it afterwards was not read (L)

On st03 the joints of the 22 pieces models are 22 roots, 80 with parent 0 (10 of them stumps) and 44 deeper ones. Deeper joints mostly carry the shadow volume of their parent piece (model 36: one per piece); 11 carry drawn meshes (models 35, 47–52), one of them under a stump (model 35 joint 16).

The joint table (H). 0x1401cb510 builds, per model, one 0x40-byte entry per joint: byte 0 the joint index, byte 1 flags, +0x08 the joint’s armature record, +0x10 four slots for its index buffers, +0x38 a flag word; a 4×4 matrix per joint follows the entries. A chunk of type 2 (index buffer) is filed under the joint named by the low byte of its transform_idx (file offset 0x42), in file order, at most four per joint.

The box (H). 0x1401f7dd0 reads aabb_min / aabb_max (chunk offsets 0x18 / 0x24) of the joint’s first index buffer only. Not the union of the joint’s buffers, and not the vertices. These bounds are in the joint’s own space. Per axis, with L = max − min:

The piece’s size (compared with 2200 and 800 by the collision step) is the product of the three L before this change. The eight points are numbered: 0 = (min, min, min), 1 = (max, min, min), 2 = (min, max, min), 3 = (min, min, max), 4 = (min, max, max), 5 = (max, min, max), 6 = (max, max, min), 7 = (max, max, max). The 28 rest lengths are measured here, in the joint’s space, and the piece also keeps 0.3 × their mean (+0xd8, use not read). Both position buffers of every point get the corner, the per-point slow counter is cleared.

On st03 the first buffer’s stored bounds equal the vertex bounds of everything drawn for the joint on most pieces (same size on 5 of deck section 1’s 6 pieces), but not on all: a joint whose first buffer is a small part gets a small box (deck section 1 joint 11: size 1,990 instead of 15,464, so it tests no edge midpoints; deck sections 0 and 3 joint 9: 5,757 instead of 39,087, joint 11: 92 instead of 17,465; deck section 2 joints 1 and 3).

The matrix (H). 0x1401fe9c0 returns one world matrix per joint of the object’s current model, and make pieces copies joint k’s into the joint entry and hands it to the piece:

These are the model’s own armature records, with no animation and no inverse bind. So the pieces start in the pose the pieces model was built in, which is not the intact model’s pose: the Palace’s deck pieces of section 1 are stored as flat slabs and their joints turn them by 21°–45°. Corrected 11-13 (climb): the joints of sections 0, 2 and 3 are not turned, but their slabs are tilted all the same: the tilt is in the vertices (their boxes are the axis-aligned bounds of a tilted slab, 13–17 units thick against 5–7 for section 1). At the break tick every deck section is replaced by tilted slabs that fan out in a V; the reference footage shows exactly this on the first frame after the hit.

The piece’s “set from matrix” (vtable slot 9, 0x1401f8440) multiplies both position buffers of the eight points by this matrix and returns the box centre p0 + ½(p1 − p0) + ½(p2 − p0) + ½(p3 − p0).

Launch, previous position, first tick (H).

The stored point (M). The “object’s own stored point” of a support loss and of the faller crumble’s break is filled by 0x1401e81b0 → 0x1401fc4b0: the centre of the union of the stored bounds of all index buffers of the object’s current model, taken as they are (no joint matrices), put through the object’s matrix. It is not the placement origin. When it is refreshed (four places in 0x1401e5e20) was not followed, so whether a support loss measures from the intact model’s centre or the pieces model’s is open. With no impulse it only turns the ≤ 0.44 u/tick jitter launch.

Palace deck section 1 (placement 1, class 2 / 23, pieces model 36; placement at the origin, unrotated), start pose computed from the stage file:

Joint Size Box centre y of the corners Tilt Corners behind stage faces
1 7,116 (69.6, 104.5, −28.3) 94.2–114.8 33° 0
3 9,170 (36.1, 104.8, −54.2) 95.3–114.2 45° 1 (attribute 31, 1.35 deep)
5 8,926 (41.9, 104.8, −73.7) 96.8–112.8 21° 2 (attributes 10 and 31, 0.73 deep)
7 2,539 (32.6, 103.2, −22.7) 96.5–109.9 35° 0
9 4,759 (49.5, 104.1, −41.3) 94.9–113.3 39° 0
11 1,990 (93.2, 110.0, −68.6) 104.8–115.3 24° 0

“Behind” is the piece step’s own test (behind the plane by less than 2, projection inside the triangle, attribute not 16, 17, 18 or 20) against the stage collision list. So in the game’s own start pose the joint 5 piece starts with two corners inside the tree’s faces, the same two faces and depths as in the rebuild’s pose (the two poses are the same box for this joint). Running the decoded step on the game’s pose (a line-by-line port, jitter launch from the box centre) lifts that piece’s centre by 36 units (its highest corner by 43) before it falls; with the stage collision off it does not rise. The joint 3 piece rises 3 units. Railing 167 (model 56, joint 1): four corners behind attribute 8 faces, up to 1.99 deep, rise 5–8 units. The rise is the decoded behaviour for the decoded start pose (H for the pose; the height itself depends on the parts of the step that are still open: the per-model gravity factor, the sphere pass and the second acceleration). Corrected 11-13 (climb): a 36–44 unit climb is not what the game shows; see the re-check below. The pose and the push-out stand, the height does not.

Implementation notes for the rebuild

  1. Piece joints: only joints whose parent is joint 0 and that are not stumps. Do not make pieces from deeper joints (st03: model_35_j16, model_47_j4/5/6, model_48…50_j2, model_51_j2/j4, model_52_j2/j4 fly as pieces today). model_35_j16 hangs under the stump and stays with it; what the game draws for the others is not decoded (keep them with their parent piece until it is, and list that in PLACEHOLDERS.md).
  2. Box: the stored aabb_min / aabb_max of the joint’s first index buffer (file order), not the vertex bounds of the joint’s whole node. The converter has to export it per joint (objects.json or a node extra); piecebox.py shows the read.
  3. Matrix: placement × the joint chain from the armature records (what pd_bind already is); keep it. Rest lengths from the box in the joint’s space.
  4. Launch position: the box centre in the world, not the joint’s origin (xf.origin today, which for the Palace decks is far from the piece).
  5. Stored point: the centre of the model’s index buffer bounds through the placement matrix, not placement.origin.
  6. previous = current − velocity and collision from the first tick are already right. Do not add a start correction: a piece that starts inside stage faces is pushed out by the step, as in the game.

Built (collapse round 4). stageobj.py writes objects.json version 3: per joint box = [aabb_min, aabb_max] of its first index buffer (game axes, the joint’s space; null when the joint has none) and meshes = its buffer count (at most four); per state bounds = the union of all its model’s buffer bounds (model space, no joint matrices), whose centre through the placement is the stored point. Same reader as piecebox.py (IndexBuffer now lives in stageobj.py). The rebuild mirrors Z for both (game → its own axes). Checked on st03 with godot/tests/test_piece_pose.gd: deck section 1 makes the six pieces of the table above, with the sizes and box centres given there (within 0.05 u).

Broken pieces: the Palace climb re-check (docs 11-13, climb)

Why this exists: the rebuild’s deck section 1 sends one slab 36–44 units up the tree. The playtester’s Rebirth footage (private recording, all four pillars) shows no slab on or above the tree; every slab is on the floor and at rest within about 2 s of the hit. The chain of “the start pose” was read again in the executable and run again on the stage file. H = read in the code and checked on st03, M = code only, L = from footage or a guess.

What was re-checked and holds (H).

The pieces’ triangle grid (H; new). Built once per stage from the arena’s shape list (header slot 0x94) by 0x1401d2c20 (setup) and 0x1401d3040 (fill):

A port with this grid gives the same result for deck section 1 as the earlier port with a looser grid: the grid is not the cause.

Not for the deck: a start spin (M; new). Piece vtable slot 11 (0x1401f8960) stores a vector at piece + 0x78 and arms a 3-count (+0x84 / +0x85). While armed (the first four sub-steps) 0x1401f8850 adds p × w to every point, p being the point’s previous position in stage coordinates. Only the roll family’s piece routines (0x1401ec909, 0x1401ece92) and one base routine (0x1401fc95a) use it, with three pseudo-random components from the same byte hash as the jitter launch (scale not read). The crumble family (the Palace decks, class 2 / 23) never uses it: a deck slab gets no angular start, no pivot and no per-piece gravity. Its tumble is what eight free points with distance constraints do when single corners are stopped by the floor.

The support-loss launch is impulse-free (H). Class 2 / 23 (Rep23): break = 0x1401e85b0, support lost = 0x1401e83c0, make pieces = 0x1401e9440 (stored point, zero impulse), no fall slot. The V in the footage is the pieces model’s own pose, not a launch.

A different class has a two-stage fall (M; new, not on the Palace). The component ACrmFT (vtable rva 0x47e388; built by 0x1401daf10): its break (0x1401e9450) only starts a counter and spawns the state’s kind 3 effects; its fall slot 28 (0x1401e9550) then lowers the object by 5 / N units per tick for N ticks (N = the word at component − 0xe, source not read) and after that does the real break: collision off, kind 2 effects, dependants released, break sphere, sound, pieces with zero impulse. Its support lost is the plain 0x1401e83c0. Which table / class number uses it was not looked up.

What the footage shows (L). Wider frames of the pillar with the tree behind (hit 386.4 s): the slabs are in the V on the first frame after the hit, hang for about 0.3 s, and reach the floor about 1.0–1.1 s after the hit (pillar 1 the same). Several pieces are thrown up and sideways: some are a few units above deck level 0.5–0.9 s after the hit and one large piece is still in the air 1.5 s after it, leaving the frame toward the camera side. So a pop exists in the game, but a small one; nothing rises tens of units or stays on the tree. Which of the flying pieces are deck slabs and which are the pillar’s own (those take the shot’s impulse) cannot be told from this angle.

Timing (M code, L factor). Gravity 0.5 / 30 per sub-step, two sub-steps per tick, 30 ticks per second = 60 units/s². The deck (y ≈ 104) is 52 units above the floor (y ≈ 52): 1.32 s of free fall at factor 1. The footage’s 1.0–1.1 s would be a factor of about 1.5–1.9. The port run on the climbing slab (joint 5):

Gravity factor Rise of the centre Below y = 60 after Lands
1.0 31–33 5.0 s (it rides the tree) 250 units away
1.5 19 1.9 s 190 units away
2.0 14 1.5 s 150 units away
3.0 13 1.2 s at the deck

The climb comes from the first sub-step: one corner, three edge midpoints and two face centres of that slab lie 0.2–1.9 units behind faces of attributes 10 and 31 whose normals point up and toward +z; putting them on the planes moves the slab’s centre 0.7 units in one sub-step, and a Verlet point keeps that as speed (about 1 unit per sub-step, 60 units/s). The rise is then speed² / 2g, so it scales with 1 / factor.

Conclusion. No error was found in the pose, the box or the push-out; the tree faces are tested. What “the start pose” got wrong is its last step: it took the 36–44 unit height as the game’s behaviour while the gravity factor was still a placeholder 1.0. The best lead for the difference was that factor. Corrected 11-13 (climb 2): that lead is refuted. The record is decoded (“The launch / gravity factor record” below): the Palace deck sections and railings have none, so both factors are 1.0 for them, and the gravity factor is 1.0 in every record of the game. The table above for factors 1.5–3 describes nothing the game does. The difference between the port (31–33 unit rise, 5 s) and the footage (small pop, floor within ~2 s) is not explained by any decoded value. Corrected 11-13 (climb 3): the 31–33 unit figure itself came from an arbitrary launch vector and no collision delay. With the game’s own 8-tick delay and launch jitter the result for this slab ranges from 1 to 73 units depending on the object’s index; see “Broken pieces: the object pass, delay and jitter” below.

Implementation notes for the rebuild

  1. Keep the decoded pose, box and push-out. Do not add a start correction and do not filter attributes 10 / 31.
  2. Do not treat the 36–44 unit climb as verified behaviour: the test that expects it (test_collapse_rise) should expect a pop, not a height. A piece that is still above its start height 2 s after the break does not match the footage; the cause is open.
  3. Gravity and launch factors: read them per object from the type 31 effect record (next section). For the Palace decks both are 1.0, decoded. Do not tune from footage.
  4. Piece grid, if the build wants the game’s exact cells: 30 × 20 × 30 from the lowest vertex, triangles entered by the grown-box overlap, flags bits 0 and 1 both set, lookup by truncation, nothing outside the grid. On st03 it changes no result.
  5. Roll-family pieces (classes 1, 2, 4, 17) get the four-sub-step spin; crumble pieces get none. (Scale of the spin vector still to be read.)
  6. Deck sections of the other three Palace placements also start as tilted slabs; that is the model, keep it.

Broken pieces: the object pass, delay and jitter; the Palace map (docs 11-13, climb 3)

The object pass (“sphere pass”, H). Inside the corner loop of the stage collision (0x1401f8cd0), after a corner’s grid triangles, 0x1401d3a10 walks a global list (0x1405302f0) of collision groups. For every shape record of type 3 (a mesh) in a group whose bounding sphere (centre, radius of the mesh record) contains the corner, it calls the piece’s callback (0x1401f8b40, the pdStageColCallback part of the piece at +0x48). The callback runs the ordinary corner test (0x1401f7870: behind by less than 2, projection inside → onto the plane, minus half the x / z velocity) on every triangle of that mesh whose stored normal has y > 0, and sets a “touched an object” byte (+0x40d) on a hit.

Lifetime, settle, fade (H; re-read, agrees with “End of a piece” above). A point rests after more than 16 slow sub-steps (speed² < 0.005, counter never reset). When all eight rest, an ordinary piece (flag 1; every joint except the ones named 0xC3500000) is deleted at once if it is older than 32 ticks, else at tick 33. A piece that keeps moving is deleted after 300 ticks (10 s); one below the height limit or 800 units out at once. The draw’s fade byte (+0x404) is never counted up, so there is no fade. So “at rest” in footage means “gone”: a slab that settles anywhere, also on the tree, disappears.

Collision delay (H). Slot 14 sets the delay to 8 for objects with class flag bit 2 (0x1401e930a). The deck class gets that bit from its floor component’s constructor (0x1401dd4b0, called by the class 2/23 constructor 0x1401dda80). So deck slabs skip the stage collision and the object pass for their first 8 ticks (16 sub-steps, 2.3 units of free fall); constraints still run. This corrects “the start pose” and the build’s COLL_DELAY := 0 comment, which say the bit is not set on the Palace objects.

Launch jitter, exact inputs (H code, M for the index). With a near-zero impulse (support lost: always) the routine first scales the impulse (× 0.5 × F) and then adds one jitter value per component: value(a) = h(a) × 0.2 / 256 − 0.1, h(a) = low byte of a × 33 + 33 + (a >> 1), a = low byte of (object index + counter). The counter starts at 0 for each break and the three components use counter, counter + 1, counter + 2, but it advances by 2 per piece that takes the jitter (the z of one piece and the x of the next share a value; 11-14: the advance is inside the L² < 0.1 branch, and L is the break’s impulse, the same for every piece of a break, so it is all pieces or none). The object index is the word at object + 0x48, given at creation (0x14020416f): the running number of the placement in the order the setup creates objects. For the first placement list that is the placement number (deck sections 0–3, pillars 4–7). 11-14 (collapse 6): H now. Only one placement list is created per battle and the counter starts at 0 and counts every placement of it, created or not (see “test order, constraint table and rest”); the deck sections exist only in st03’s list 0, as placements 0–3.

Deck sections recomputed (port: exact grid, delay 8, the jitter above, object pass against the still-intact sections; index = placement number). “Floor” = centre below y = 60; “gone” = deleted at rest.

Section Slabs Rise Floor Gone
0 (x ≈ 147), others intact 7 0–0.1 1.07–1.30 s 1.9–2.6 s (one 3.4 s)
3 (x ≈ −147), others intact 7 0–0.2 1.07–1.37 s (one 2.7 s) 1.9–3.0 s (one 4.2 s)
1 (x ≈ 57), section 0 already broken 6 joint 5: 10.4; others 0 1.13–1.97 s; joint 5 3.5 s; joint 9 settles at y 64 1.8–6.6 s
1, section 0 still intact 6 joint 5: 31.6 (settles on section 0 at y 113); joint 11: 10.7 up to 9.4 s
2 (x ≈ −71), others intact 4 0–0.1 two slabs settle at deck height (y 105–111) inside 1 s and are deleted; the others 4 s or settle at y 64 1.1–5.2 s

The Palace deck row, top-down (H from st03). Game space, y up; looking along −z (from the open floor toward the tree) +x is on the left of the screen (left-handed space; the converter flips z for Godot).

Placement What x z y
0 deck section 0 (definition 0) centre 147, mesh radius 81 −50 100–109
1 deck section 1 (definition 1) centre 57, mesh radius 48 −50 100–109
2 deck section 2 (definition 2) centre −71, mesh radius 45 −50 100–109
3 deck section 3 (definition 0 turned half round) centre −147, mesh radius 81 −50 100–109
4 / 5 / 6 / 7 pillars under sections 0 / 1 / 2 / 3 140 / 50 / −50 / −140 −50 50–100

The tree (attributes 10 and 31) stands behind the row, on the −z side: attribute 10 spans x −112..67, z −259..−31, y up to 279 (mean x −28, z −138); above deck height its nearest faces are at z −57 to −80 for x between −80 and 80. Attribute 31 above deck height is almost all at x 0..80, z −40..−168 (up to y 235): the big limb behind section 1. Sections 0 and 3 have no tree face near them at deck height. So from the floor in front, left to right: pillar 4 (clear), pillar 5 (tree limb right behind), pillar 6 (trunk behind), pillar 7 (clear).

Footage match (M). In private recording 2 the four hits go left to right on screen with the camera looking at the tree (frames before each hit looked at, none published). With +x on the left: hit 1 (370.3 s) = pillar 4 / section 0, hit 2 (386.4 s) = pillar 5 / section 1, hit 3 (410.0 s) = pillar 6 / section 2, hit 4 (418.2 s) = pillar 7 / section 3. The left / right assignment rests on the handedness argument only; if it were mirrored, hit 2 would be section 2. Either way hits 2 and 3 are the two tree sections.

Measured in the rebuild (collapse round 5, 11-14; H for the build, L for the footage). The three causes built (delay, jitter, object pass with the mesh records’ stored bounding spheres, collision.json sphere), the Palace pillars shot by the Player in the footage’s order (each section after the previous one’s pieces are gone; test_deck_sections.gd):

Section Rise of each slab (u) On the floor (s) Gone (s) Footage
0, others intact 0–0.1 1.07–1.30 1.9–3.3 floor ~1.1 s, at rest ~2 s
1, section 0 broken one slab 25.6, others ≤ 0.03 1.13–4.53 (one stays at y 64) 1.8–5.7 small pop, at rest ~2 s
1, others intact 26.4 and 60.7 (one settles on section 0) 1.13–5.3 1.8–10.0 —
2, sections 0 and 1 broken ≤ 0.06 one at 2.6; two rest on intact section 3 at y 105–111 (deleted at 0.87 / 1.0 s since round 6; round 5: 10.0), one at y 61 0.87–5.3 side-on private recording 9: floor ~1.1 s
3, others broken 0–0.2 1.07–1.37 1.9–3.1 floor ~1.1 s, at rest ~2 s

Superseded 11-14 (collapse round 6): the tree-section numbers of this table came from the build’s flipped point numbering, all-pairs constraints and file-order cells; see “Measured in the rebuild, round 6” at the end of “test order, constraint table and rest”.

Object-pass pop of a prop (round 5 build, INFERRED / unverified). With the object pass, st03 object 170 (class 2/18, a prop lying on deck section 3) rises 14.4 units when its section breaks; with the pass off it rises 0.06. Its pieces slip under the intact section’s top within the 2 unit band and are pushed up. Built as decoded; whether the game passes class 2/18 pieces this way and whether a rise that large comes out of the 2 unit band is not decoded or checked against footage. Collapse 6: class 2/18 has no class flag, so its pieces do take the pass (H); round 6 (collapse-6 decode built) measures 14.0 units; the height is still not checked.

Implementation notes for the rebuild

  1. Collision delay: 8 ticks for pieces of objects with class flag bit 2 (classes 2/22, 2/23, 2/26), else 0. COLL_DELAY := 0 is wrong for the Palace decks.
  2. Launch jitter: add it to the scaled impulse (do not replace the impulse before scaling); advance the counter by 2 per jittered piece with components at +0, +1, +2; seed with the object’s creation index (placement number in the played list).
  3. Object pass: after a corner’s grid triangles, test it against the up-facing triangles of the state-0 collision meshes of intact objects with class flag bit 0 or 2, when the corner is inside the mesh’s bounding sphere; a hit keeps the piece active at rest, but it does not move again and is deleted by the age rule like any resting piece (round 6).
  4. Delete a resting piece at once (age > 32); no fade. Already decoded; listed here because it is what the footage’s “at rest” shows.
  5. test_collapse_rise: with 1–3 in place, expect for section 1 a pop of about 10 units for joint 5 and nothing else rising; the end sections must be on the floor inside 1.4 s and gone by about 3 s. Do not assert the old 36–44 units.
  6. The second acceleration never applies on the Palace (stage value ending in 5 only).

Broken pieces: test order, constraint table and rest (docs 11-14, collapse 6)

Why this exists: the build (collapse round 5) lifts one slab of Palace deck section 1 by 25.6 units, the port of climb 3 by 10.4, with the same index and rules. Both were run from the same start, and the tick and the routines under it were read again. H = read in the code and checked on st03 or on the build, M = code only, L = footage or a guess.

Which side was wrong: both.

The 28 constraints are a table, not all pairs (H). The box routine (0x1401f7dd0) copies 28 byte pairs from 0x1403eebd0 into the piece (+0x248, 8 bytes per entry: point a, point b, rest length at +4) and measures each rest length; +0xd8 is 0.3 × their mean. The constraint pass (0x1401f9590, piece vtable slot 7, called twice per sub-step) goes through them in this order:

Entries Pairs What
0–11 0-1, 0-2, 0-3, 7-6, 7-5, 7-4, 6-2, 6-1, 3-5, 3-4, 1-5, 2-4 the 12 edges
12–15 0-7, 1-4, 6-3, 2-5 the 4 body diagonals
16–21 2-1, 6-5, 7-3, 4-0, 4-6, 0-5 one diagonal of each face
22–27 2-1, 6-5, 7-3, 4-0, 4-6, 0-5 the same six again

The other diagonal of each face (0-6, 2-7, 1-7, 2-3, 1-3, 4-5) has no constraint. Per entry: d = a − b; when |d| < 0.00001 the points’ stored velocities are used to get a direction (a’s is added, then b’s subtracted, each only while the length is still below the limit); a −= d̂ · ½(|d| − rest), b += the same.

Order of the tests inside the collision step (H). 0x1401f8cd0 (slot 6) clears the touched byte, then:

  1. corners 0 to 7 in the game’s numbering; per corner first its grid cell, then the object pass (unless piece flag 0x8);
  2. size > 2200: the 12 edge midpoints in the order of the table at 0x1403e1178;
  3. size > 800: the 6 face centres in the order of the table at 0x1403e0f48.

Midpoints and centres: the cell is looked up once from the mean of the points, but the mean is taken again before each triangle (0x1401f7570, 0x1401f7280), so an earlier triangle’s push is seen by the next one.

Order of the triangles inside a cell (H for the lists, M for the fill order). The grid’s add routines (0x1401d29b0 for the attribute record, 0x1401d28b0 for the vertex set and the triangle) put every new entry at the head of its list. The fill (0x1401d3040) goes through the shape records, their triangles and the cells in ascending order. So a cell is read back as: attribute records in the reverse order of their first triangle in that cell; inside an attribute the vertex sets in the reverse order of their first; inside a vertex set the triangles in reverse file order. Climb’s port and the build test in file order. Run on deck section 1’s slab (index 1): file order 11.9 units, the game’s order 38.1 (grouping by attribute alone changes nothing there; the reversal does).

Rest ends a piece, touched or not (H). The rest test comes first in each sub-step, before the points move. When all eight points rest (0x1401fa567):

So a slab that comes to rest on an intact deck section is deleted like one on the floor: at once when it is older than 32 ticks, else at tick 33 or a few ticks earlier (while it is active its age counts twice per tick). It does not wait for the 300-tick limit and it does not fall when the section under it breaks. The only pieces that outlive their rest are the joints named 0xC3500000, and they stay frozen where they rested. The touched byte changes nothing that can be seen. Wrong before: climb 3’s “stays awake, so it falls when that object breaks”, and the build’s rule made from it (a touched piece is never at rest, so it lives to 300 ticks). Climb 3’s port was right here.

Class flags (H for bits 0, 2 and 0x80; table 2 is the class table at 0x1403ee870).

Bit of base + 0x50 Set by Classes Effect on pieces
0 0x1401e0cf0 2/12, 2/13 (on no versus stage) the intact object is a floor of the object pass
2 0x1401dd4b0 2/22, 2/23, 2/26, 2/42, 2/43 (the last two on no versus stage) floor of the object pass; its own pieces wait 8 ticks
0x80 0x1401dd1b0 2/17 only (st03 × 3) its own pieces skip the object pass
0x1000000 not found: no class constructor writes it as a constant floor of the object pass (L: who sets it was not followed)

A class 2/18 prop (st03 object 170, lying on deck section 3) has none of these bits: it is not a floor, its pieces have no delay, and its pieces are tested against the intact deck sections like every piece except class 2/17’s. That the build’s pass moves them is the decoded rule; the height it gives them (14.4 units) is subject to the numbering and order errors above and was not recomputed.

Which placement list, and the object index (H). The stage setup (0x140203747) takes one list only: list L + 1 of the stage file’s eleven list slots (offsets at header 0x04

The jitter counter (H). It advances by 2 only inside the L² < 0.1 branch (0x1401e8f79), L² being the break’s impulse, so within one break either every piece advances it or none does. The build’s _make_pieces is right. On stages whose stage value ends in 5 the second-acceleration block (0x1401e9145) uses the same hash and advances the same counter by 2 more per piece (M; never on the Palace).

Deck sections recomputed (port with the table, the cell order, the game’s numbering; double precision, not the build). Broken in the footage’s order.

Section Slabs Rise Floor Gone
0 (index 0, others intact) 7 0–0.1 1.07–1.30 s 1.9–2.6 s (one 3.6 s)
1 (index 1, section 0 broken) 6 joint 5: 38.1; others 0 1.13–1.77 s; joint 5 never (comes down at deck height near (165, 102, 14)); joint 9 rests at y 64; joint 7 falls out of the stage 1.7–3.4 s; joint 5 7.3 s
2 (index 2, section 3 intact) 4 0–0.1 two slabs rest on section 3 (y 105–111) inside 1 s and are deleted at rest; the others 2.1 s and 4.7 s 1.1–5.4 s
3 (index 3, others broken) 7 0–0.2 1.07–1.37 s 1.9–2.1 s (one 3.5 s)

Implementation notes for the rebuild

  1. Number the eight points in the game’s axes: the z bit of a corner is set for the game’s larger z, which is the smaller z in the mirrored space. Everything indexed by point (corner loop, the edge and face tables, the constraint table, “point 0” of the bounds test, the drawn matrix from points 0–3) uses that numbering. The drawn matrix then needs the z edge negated.
  2. Constraints: the 28-entry table above, in that order, twice per sub-step; rest lengths per entry. Not all pairs.
  3. Triangles of a cell: reverse order of insertion at all three levels (attribute, vertex set, triangle), insertion in file order. With a lookup grid that is not the game’s, at least keep the per-attribute grouping and the reverse file order; for 1:1 use the game’s grid (30 × 20 × 30 cells, “the Palace climb re-check”), since a corner only sees the triangles filed in its own cell.
  4. Rest: when all eight points rest, stop moving the piece for good, whether or not it touched an object floor; delete an ordinary piece once its age is above 32 (age + 1 per tick at rest; + 2 while touched). Remove the “touched pieces stay awake” rule.
  5. Object pass floors: classes 2/12, 2/13 (bit 0) and 2/22, 2/23, 2/26, 2/42, 2/43 (bit 2). Pieces of class 2/17 skip the pass. Every other piece takes it, also those of props without any flag (class 2/18).
  6. Jitter: keep the build’s counter (advance inside the low-impulse branch). The index is the placement number in the one list that is created: decoded, no longer a guess.
  7. Tests: do not assert a height for deck section 1’s slab from any earlier table. With 1–4 in, the build should reproduce this section’s table (38 units for joint 5 at index 1 is the port’s value, to be confirmed by the build in single precision); the end sections must not change.

Measured in the rebuild, round 6 (collapse round 6, 11-14; H for the build). Notes 1–6 above built (game point numbering, the 28-entry table, the game’s grid read back to front, rest ends a piece touched or not, the pass classes, the jitter counter) and collision.json flags / vset per mesh (collconv); single precision, Godot. Footage order, test_deck_sections.gd:

Section Rise Floor Gone Port above
0 0–0.1 1.07–1.30 s 1.9–2.57 s, one 3.57 1.9–2.6, one 3.6
1 joint 5: 36.6; others ≤ 0.03 1.13–1.77 s; joint 5 never (ends at y 111); joint 9 rests at y 64; joint 7 out of the stage 1.73–3.33 s; joint 5 6.23 s 38.1; joint 5 7.3 s
2 ≤ 0.06 two rest on section 3, deleted at 0.87 / 1.0 s; the others 2.1 s and 4.7 s 0.87–5.4 s the same
3 0–0.2 1.07–1.37 s 1.9–2.13 s, one 3.57 1.9–2.1, one 3.5

The build reproduces the port’s table; joint 5 differs by 1.5 units and 1.1 s (single against double precision, and the object pass list’s order after breaks, neither ported exactly). Collapse r7 (playtester 11-14): shipped as a known gap. The full private recording 2 note says the pieces are thrown “a few units above deck level”, one large piece is still in the air 1.5 s after the hit, and “nothing rises tens of units or stays on the tree” (slabs and pillar pieces cannot be told apart from that angle; that the pillar is section 1 is likely, not proven). Joint 5’s 36.6 unit throw and the slab left at deck height contradict that note, so the decode is still missing a cause. Built as decoded, nothing tuned (PLACEHOLDERS “Palace deck section 1 high throw”, INFERRED / gap).

The launch / gravity factor record (docs 11-13, climb 2)

What it is (H). The two factors of the piece launch are an effect record of type 31 (0x1F) in the object definition’s own effect list for state 0 (OB00 effects[0], an EF00 list of 92-byte records). The stage setup hands each object its three effect lists (0x140204230: virtual slot 37 with the state number and the list). The break component’s version of that slot (pdStageObjABrk, 0x1401da160; the component is the second virtual base of every crumble / roll class) does one extra thing for state 0: it walks the list’s records and keeps a pointer to the first one whose type byte is 31, or null. Every class constructor starts that pointer as null.

Record offset Struct field (EffectEntry) Meaning
+0x00 type = 31 marks the record; the effect spawner has no constructor for it
+0x34 params[0] launch factor: the launch impulse × this, before the 1.5 length cap
+0x38 params[1] gravity factor: piece gravity = (0, −0.5, 0) × this
rest zero in every record; nothing reads it

No record: the impulse is not scaled and the gravity setter is not used, so the piece keeps the gravity its constructor gave it (0x1401f7c07: the same vector (0, −0.5, 0) for both the gravity and the second acceleration). There is no other per-object physics value in the record: all eight readers (crumble 0x1401e8b18; 0x1401e9fac, 0x1401ea562, 0x1401edead; roll family 0x1401ec909, 0x1401ecbf3, 0x1401ece92, 0x1401ed172) take only +0x34 and +0x38. Damping, the half-speed push-out, the rest counter and the bounds are the same constants for every piece.

Values in the files (H, 29 of the 30 stage layouts read; st00 has another header and was skipped; read with stageobj.py’s structs). 21 records in 7 stages; the gravity factor is 1.0 in every one:

Stages Definitions Classes Launch Gravity
st03, st13, st23 (Palace and its variants) 11 (12 placements, the small props at y = 50 around (±100, 50, 10 / −110)) 2/3 0.5 1.0
st04, st14 36–41 2/1 2.0 1.0
st24 15–20 2/1 2.0 1.0

The Palace. Deck sections (definitions 0–2, class 2/23), pillars (3, class 2/28) and railings (definition 24, model 56) have no type 31 record: launch 1.0, gravity 1.0. Only definition 11 has one (launch halved).

Deck 1 recomputed (port, factor 1.0 decoded). Same as before: joint 5 rises 31–33 units (corner 38), stays above y = 60 for 5.0 s and lands about 250 units away; joint 3 rises 1.4, the other four slabs do not rise; a slab that is not pushed reaches the floor in 1.32 s. The footage (small pop, ~1.0–1.1 s fall, everything at rest on the floor within ~2 s) still disagrees, by 3–5 frames of 15 fps footage on the fall and by tens of units on the rise. The per-object factor cannot be the reason. Re-read while here, no change: two sub-steps per tick, gravity × 1/30 per sub-step, the second acceleration replaces gravity only with flag 0x10 after tick 30, a piece is removed when its first point is below the height limit or more than 800 units out.

Implementation notes for the rebuild

  1. objects.json already carries the record: a state-0 effect of type 31. Launch factor = params[0], gravity factor = params[1]; no such effect = 1.0 and 1.0. Replace StageObject.LAUNCH_SCALE / Piece.GRAVITY_SCALE with that lookup.
  2. On the Palace this changes only definition 11 (pieces launched at half speed).
  3. Never play type 31 as an effect.
  4. The deck climb stays a WRONG row: do not change gravity for it.

The roll break: one flying box (playfix 11-14, H code and data)

Corrects step 5 of “Breaking” for the roll family (table 2 classes 1, 2, 4, 17): a roll object never makes per-joint pieces and never stays as its wreck in place. Read from the break (0x1401ec350), the support-loss handler (0x1401ebf90), the make-pieces slot 30 (0x1401ec800), the class constructors and the piece setup; checked on the Palace boxes (definitions 10, 13, 14: states 0 and 2, no state 1).

Shot end on a stage object (playfix r2 11-15, H code)

What a shot’s attack object does when its flight meets a placed stage object (tables, chairs, boxes), read in PDUWP.exe:

Build: projectile.gd _crossed_objects (every object on the ending tick’s step, hit after the nearest one), _on_sphere (the shot’s sphere ignores stage-object bodies), _end_on_stage (these hits land after the physics step, as the sphere’s signal put them before: a break’s pieces are first stepped in the next tick; the tick order against the game’s attack update is not decoded); test test_props_table_chair.gd. The 0x6A variants and the remote-caster rule are not built (PLACEHOLDERS “Shot vs stage objects: 0x6A variants”).