Death = the burning WRECK-HULK swap (effect 104) -- the authentic chain, reconstructed

The user was right: a dead mech turns into a pile of wreckage.  The authentic
1995 chain, recovered end-to-end:

  kill -> the victim's per-mech DEATH ModelList ('blhdead'/'lokdead'/'owndead'/
  'thrdead', .RES ids 22-25) -> its authored effects: 104 (the WRECK script) +
  1007 (dnboom big explosion) + 1001 (ddthsmk rubble smoke plume) + a damage-
  smoke burst (3/4/5/15).

Effect 104 = ExplosionScripts case 4 (part_008.c:2663, LIVE in the 1996 binary;
the "disabled" warning is case 6): loads the destroyed hulk + flamesml/flamebig
flame meshes with sweep flicker.  Every mech ships its hulk (BLHDBR/MADDBR/
LOKDBR/... + GENDBR generic); the 1996 script hardcoded thrdbr.bgf (dev
shortcut) -- we use the victim's own.

Reconstructed as BTL4VideoRenderer::SwapToWreck: hide every segment mesh, hang
"<prefix>dbr.bgf" on the tree root (pending-swap if death precedes tree build);
routed from the engine's ExplosionClassID dispatch (effect 104 ->
BTSwapMechToWreck(explosion->GetEntityHit())).  The kill now fires the
authentic 'blhdead' resource (manual 7+1 pfx calls removed -- the list carries
1007/1001 itself).  Verified live:
  [death] firing authentic death list 'blhdead' id=22
     ** effect_number = 104
  [BTrender] wreck swap: victim -> 'blhdbr.bgf'

Follow-ups noted: mesh flames + hulk settle (cosmetic), DeathSplash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-08 15:43:08 -05:00
co-authored by Claude Fable 5
parent b44c0f98f6
commit c0fa6bf21a
9 changed files with 302 additions and 29 deletions
+22 -15
View File
@@ -2430,28 +2430,35 @@ void
// fires; the ownerless dummy yields no death, DEATHS stays 0).
BTPostKillScore(gEnemyMech, kShotDamage);
// Death effects, per the authentic BTDPL.INI effect-number map:
// 7 = "the big explosion used as part of mech death" (dnboom)
// 1 = "the mech death/rubble smoke plume" (ddthsmk)
// Fired directly into the render effect layer at the wreck (the
// unexported death sequence's effect chain dispatched these
// numbers through the 0xBD3 manager; the numbers are the data).
{
extern void BTStartPfx(int effect_number, float x, float y, float z);
Point3D wreck = ((Mech *)gEnemyMech)->localOrigin.linearPosition;
BTStartPfx(7, wreck.x, wreck.y + kMuzzleHeight, wreck.z); // the death boom
BTStartPfx(1, wreck.x, wreck.y + kMuzzleHeight, wreck.z); // the smoke plume
}
// Death explosion at the target (torso height, not ground level).
// Death explosion: fire the victim's AUTHENTIC per-mech death
// ModelList -- resources 22-25 are 'blhdead'/'lokdead'/'owndead'/
// 'thrdead' (BTL4.RES); its authored video objects carry the death
// effect numbers (the burning-WRECK script chain, ExplosionScripts
// case 4 loads <mech>dbr.bgf + flames in the 1996 binary). Resolve
// "<prefix>dead" by name (prefix = the anim/model prefix); fall back
// to the generic explode resource if the mech has no dead list.
Origin death_origin = ((Mech *)gEnemyMech)->localOrigin;
death_origin.linearPosition.y += kMuzzleHeight;
ResourceDescription::ResourceID dead_res = gExplodeRes;
if (application != 0 && application->GetResourceFile() != 0)
{
ResourceDescription *dr =
application->GetResourceFile()->FindResourceDescription(
"blhdead", (ResourceDescription::ResourceType)1, -1);
if (dr != 0)
{
dead_res = dr->resourceID;
if (getenv("BT_DEATH_LOG"))
DEBUG_STREAM << "[death] firing authentic death list 'blhdead' id="
<< (long)dead_res << "\n" << std::flush;
}
}
Explosion::MakeMessage death_exp(
Explosion::MakeMessageID,
sizeof(Explosion::MakeMessage),
(Entity::ClassID)RegisteredClass::ExplosionClassID,
EntityID::Null,
gExplodeRes,
dead_res,
Explosion::DefaultFlags,
death_origin,
gEnemyMech->GetEntityID(),