Repository navigation
51 worked example explosion playback
Document 50 left one blocker: how a clip's frame is chosen. It was not the generic part drawer at all.
An "Expl" object's default descriptor block (0x44bb40, from its class descriptor +0x14) has no shape
of its own; its first word 0x42dd90 is a draw callback, FUN_0042dd90, and that function draws the
record's own parts (record[8] corners, [9] count, [10] parts, 6 ints each). Reading it:
-
progressis the object's+0x64(16.16); the updateFUN_0042dbe0addsrecord[5]per tick and kills the object atrecord[3].n = progress >> 16. - A part is
[cel, flags, corner idx x 4]withflags = start | end << 8 | fade << 16 | variant << 24(signed bytes). It is drawn whilestart <= n <= end, as cel + (n - start), on the quad given by its four corner indices into the record's corner array, all corners scaled byrecord[6]. - From
n >= fadeit fades:alpha = 1 - (n - fade + 1) * (1 / (end - fade + 2))(the reciprocal table at0x48a080, filled byFUN_0041ae50with0x10000 / k), handed toFUN_00423060, which quantises to the 3DO's 16 translucency levels (level = (alpha >> 12) - 1: below 1 the part is hidden). - The variant byte's low three bits pick among following parts by the object's serial: 1 and 4 a pair, 2 four, 3 eight, 0 a single part; the group's other parts are skipped.
So document 49 misread the flags: byte 0 is the start, byte 1 the end, byte 2 the fade start. The
frame counts it derived were end, not a count; the clips it drew from the cels were right, and, checked
the other way, end - start + 1 reproduces the clip lengths seen in the strips (1109: 14, 1123: 16).
The record's script runs in step: WAIT n holds until progress >= n. For the candidate building
(0x443f30, rate 1/6): sound, wait 3 (18 ticks), glow descriptor, wait 4, SHATTER 4 (op 17: the decoration breaks into pieces, document 121; this was written DRAW_LIST 4), TILE_STATE.
FUN_0042e6a0 returns immediately when a record was spawned, so the destroyed art and coastal id (22 -> 62,
document 44) appear when the script reaches TILE_STATE -- 24 ticks (0.38 s) after the hit, with the
explosion already burning -- not at the hit.
-
game/explosion_effect_3d.gdplays any record: parts with frames bystart/end, the fade above (the level to opacity mapping is(level + 1) / 16, an approximation: the blend words are hardware register values), variants, scale, duration/rate, and a minimal script runner that firestile_state.tools/build_pack.pyemitseffects/explosions.json(frames resolved to sprite ids) andPack.get_destroy_effect()/get_explosion()read it;tools/extract_explosion_records.pyregeneratestools/data/explosion_records.jsonfrom Ghidra dumps. - A destroyed pool target plays the record its coastal entry names and changes state at
TILE_STATE; a projectile that hits a vehicle plays0x444b68and one that hits a target tile0x444ac8(surface 3 and 4 of document 50) where it ended. Verified by screenshots on RFMAP001 tile (75,56): intact building, explosion starting, fireball, then the ruin.
- Sounds, the ground glow, neighbour tiles'
TILE_SET/TILE_DMGops, the damage box (mines), the tile's own position offset callback. - Projectile impacts on land, water and pavement, and the muzzle flash: traced in document 52 (a level Tank shell never lands; the flash is now played).
- The z of an effect (drawn at the ground here).
Next: back to the next-steps doc.
Return Fire, rebuilt
Elsewhere