From 1efe8efc68565aa3575e952198d4074056c38059 Mon Sep 17 00:00:00 2001 From: Joe DiPrima Date: Sun, 2 Aug 2026 17:12:48 -0500 Subject: [PATCH] #118 tails: death score cost + the DeathWithoutHonor console notice * SpecialCaseDeathPenalty restored to the engine ScenarioRole (SCNROLE.h/ .cpp) -- the 4.10-only role field the 2007 WinTesla source dropped (record slot [1] after KillBonus, fail-hard read; role+0x20; the DefaultRendererRate pattern). Its consumer decoded from the @004c05c4 export gap (@004c07cd, missing from the #52 reconstruction): every death with advancedDamageOn hands the ENGINE base ScoreMessageHandler (@0042da20 == PLAYER.cpp:138, a DIRECT call bypassing the BT type Verifies) a type-1 award of -penalty. Wired verbatim. Shipped content authors the key nowhere -> cost 0 in the field. NUANCE [T4]: the 1995 engine adds at Player+0x1c8, which no BT scoreboard reads (+0x278) -- the pod's cost may never have displayed; our single-cell port shows it. * The eject console notice: FUN_004c198c IS the ConsolePlayerMechDeathWithoutHonorMessage ctor (T0 BTCNSL.CPP survives and is compiled) -- "death without honor" is the punch-out record. BTPlayerEjectBookkeeping now sends it to the console host through the same ConsoleClientID path as the VTVDamaged notify, then latches suppressConsole: the eject notice REPLACES the death notify. Verified two-node: "notice -> console host 1" fires on the ejecting node; the relay-side delivery of client-5 traffic is a pre-existing question shared with the never-observed VTVDamaged sibling (operator-console workstream). * Eject alarm-10 audio: resolved NEGATIVE -- the five Eject*.wav ship in AUDIO/ but BTL4.RES references them nowhere (orphaned like the SQUAT clips); wiring them would be a stand-in. Operator-optional deviation. * RIO 0x38 panic control: deferred with the plumbing documented (the glass Flight-Controls window already renders the 0x38 bank; consumer = read buttonGroup[ButtonPanic] alongside the binding-engine edge) -- pod-hardware-only, untestable on this bench. Two-node verify (fresh-exe rerun after a stale-exe trap): REFUSED healthy, PUNCH-OUT after generator kill, death + wreck swap + smoke + un-wreck warp all replicated on the observer, respawned mech refuses again, console notice fired. Co-Authored-By: Claude Fable 5 --- context/decomp-reference.md | 11 +++++++ engine/MUNGA/SCNROLE.cpp | 16 ++++++++++ engine/MUNGA/SCNROLE.h | 14 ++++++++- game/reconstructed/btplayer.cpp | 52 +++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 1 deletion(-) diff --git a/context/decomp-reference.md b/context/decomp-reference.md index d9ff6db..af6bb54 100644 --- a/context/decomp-reference.md +++ b/context/decomp-reference.md @@ -340,6 +340,17 @@ From the weapon `.SUB` records + the charge-curve `.data` constants (PE-parsed a BTWeaponCountsForEject / BTGeneratorCountsForEject / BTHeatSinkBankCoolantFraction / BTPlayerEjectBookkeeping; input = binding-engine `Eject` action (Backspace / pad LeftThumb; BENCH `BT_EJECT_AT=`, `BT_KILL_SUBSYS` now comma-list). +- **DEATH SCORE COST decoded 2026-08-02 (#118 tail) [T1]:** the death handler tail + `@004c07cd-0x4c0828` (inside the @004c05c4 export gap — missing from the #52 + reconstruction) gates on `advancedDamageOn`(+0x264) and hands the ENGINE base + `Player::ScoreMessageHandler` (`@0042da20` == PLAYER.cpp:138) a type-1 ScoreMessage + with `scoreAward = −ScenarioRole::specialCaseDeathPenalty` (role+0x20, the 4.10-only + key; restored to SCNROLE.h/.cpp — record slot [1] after KillBonus, fail-hard read). + Direct call, NOT dispatched — bypasses the BT handlers' type Verifies. NUANCE [T4]: + the 1995 engine adds at Player+0x1c8 while every BT scoreboard reads +0x278 — the + pod's death cost may never have displayed; our single-cell port shows it. Shipped + content authors NO role keys, so the cost is 0 in the field. Other role+0x1c reader: + `@0x4a0506` inside the deferred id-0x16 report tail (#45) reads killBonus. - **THE SIM TIME MODEL — CLOSED 2026-08-02 (issue #96) [T1]:** the arcade `Simulation::PerformAndWatch` is **`FUN_0041c018`** (part_002.c:5101): `slice = (till.ticks − this[4].ticks) / DAT_0052140c; this[4] = till; diff --git a/engine/MUNGA/SCNROLE.cpp b/engine/MUNGA/SCNROLE.cpp index a135767..69ad18f 100644 --- a/engine/MUNGA/SCNROLE.cpp +++ b/engine/MUNGA/SCNROLE.cpp @@ -48,6 +48,7 @@ ScenarioRole::ScenarioRole(const CString &role_name, const CString &model_file) resourceAddress; killBonus = player_data->killBonus; + specialCaseDeathPenalty = player_data->specialCaseDeathPenalty; // BT 4.10 (restored) returnFromDeath = player_data->returnFromDeath; damageReceivedModifier = player_data->damageReceivedModifier; damageInflictedModifier = player_data->damageInflictedModifier; @@ -64,6 +65,7 @@ ScenarioRole::ScenarioRole(const CString &role_name, const CString &model_file) damageBias = 0.0f; friendlyFirePenalty = 0.0f; killBonus = 0.0f; + specialCaseDeathPenalty = 0.0f; // BT 4.10 (restored) returnFromDeath = 0; } } @@ -151,6 +153,20 @@ Dump_And_Die: return -1; } + // BT 4.10: read right after KillBonus, fail-hard like every other key + // (binary role reader @00429bec, dest = record slot [1]). + if( + !model_file->GetEntry( + "gamedata", + "SpecialCaseDeathPenalty", + &local_model->specialCaseDeathPenalty + ) + ) + { + std::cerr << model_name << "Missing SpecialCaseDeathPenalty" << std::endl; + goto Dump_And_Die; + } + if( !model_file->GetEntry( "gamedata", diff --git a/engine/MUNGA/SCNROLE.h b/engine/MUNGA/SCNROLE.h index 95ef9d4..966a4af 100644 --- a/engine/MUNGA/SCNROLE.h +++ b/engine/MUNGA/SCNROLE.h @@ -9,7 +9,12 @@ class NotationFile; struct ScenarioRole__ModelResource { - Scalar killBonus, damageReceivedModifier, damageInflictedModifier, damageBias, friendlyFirePenalty; + // BT 4.10 carries specialCaseDeathPenalty as record slot [1], right after + // killBonus (role reader @00429bec dest offsets; the 2007 WinTesla source + // dropped the BT-only field -- restored 2026-08-02, the DefaultRendererRate + // pattern). Consumed by the BT death handler tail (@004c07cd): every death + // with advancedDamageOn costs -specialCaseDeathPenalty score. + Scalar killBonus, specialCaseDeathPenalty, damageReceivedModifier, damageInflictedModifier, damageBias, friendlyFirePenalty; int returnFromDeath; }; @@ -20,6 +25,7 @@ public: protected: Scalar damageInflictedModifier, damageReceivedModifier, friendlyFirePenalty, damageBias, killBonus; + Scalar specialCaseDeathPenalty; // BT 4.10 role+0x20 (restored 2026-08-02) CString roleName; int returnFromDeath; @@ -61,6 +67,12 @@ public: return killBonus; } + Scalar GetSpecialCaseDeathPenalty() const // BT 4.10 role+0x20 + { + Check(this); + return specialCaseDeathPenalty; + } + CString GetRoleName() const { Check(this); diff --git a/game/reconstructed/btplayer.cpp b/game/reconstructed/btplayer.cpp index 94e6ce7..9f45193 100644 --- a/game/reconstructed/btplayer.cpp +++ b/game/reconstructed/btplayer.cpp @@ -641,6 +641,32 @@ void } // else: out of lives -> the +10s mission-review post (id 0x18). Deferred. + // + // THE DEATH SCORE COST (@004c07cd-0x4c0828, raw disasm 2026-08-02 -- this + // tail was missing from the #52 reconstruction). Gated on advancedDamageOn + // (+0x264) alone in the binary: self-award -SpecialCaseDeathPenalty + // (role+0x20, the 4.10-only role field restored to SCNROLE.h) as a type-1 + // score message handed DIRECTLY to the engine base handler (@0042da20 == + // PLAYER.cpp:138 `currentScore += scoreAward` + the vehicle + // RespondToScoreMessage no-op hook) -- NOT dispatched, so it bypasses the + // BT ScoreInflicted Verify. Shipped content authors the key nowhere, so + // the cost is 0 in the field today; a mission that authors it gets it. + // BINARY NUANCE [T4]: the 1995 engine cell (+0x1c8) is read by no BT-side + // scoreboard (they read +0x278), so the pod's penalty may never have been + // visible; our port has ONE currentScore, so it shows. + // + if (advancedDamageOn && scenarioRole != 0) // this+0x264 (binary derefs role unguarded) + { + BTPlayer::ScoreMessage death_cost( + BTPlayer::ScoreInflictedMessageID, // 0x16 + sizeof(BTPlayer::ScoreMessage), + BTPlayer::ScoreMessage::DamageReceivedScore, // type 1 + -scenarioRole->GetSpecialCaseDeathPenalty(), // scoreAward @+0x1c, NEGATED + 0.0f, + EntityID::Null); // senderMechID (binary copies @0x522524) + Player::ScoreMessageHandler(&death_cost); // the DIRECT base call + } + // // RELEASE THE DEATH LATCH (#81, the GHOST MECH fix -- 2026-07-30). // @@ -2408,6 +2434,32 @@ Scalar BTPlayerEjectBookkeeping(void *player_v) { return 0.0f; } + + // The console EJECT NOTICE (@0049f88e-0x49f8cf): FUN_004c198c is the + // ConsolePlayerMechDeathWithoutHonorMessage ctor -- "death without honor" + // IS the punch-out record (4.10 wire id 0xF; our catalogue re-tags it 6, + // not load-bearing) -- sent to the console host through the same + // ConsoleClientID path as the VTVDamaged notify. The suppressConsole + // latch below is its other half: the eject notice REPLACES the death + // notify for this death. + Host *console_host = + application->GetHostManager()->GetConsoleHost(); // FUN_00429078 + if (console_host != 0) + { + ConsolePlayerMechDeathWithoutHonorMessage eject_notice( + player->ownerID); // this+0x18c + application->SendMessage( + console_host->GetHostID(), // console_host+0xc + NetworkClient::ConsoleClientID, // 5 + &eject_notice); + // Rare + forensic -- always log (the DumpAmmo precedent). + DEBUG_STREAM << "[eject] DeathWithoutHonor notice -> console host " + << (int)console_host->GetHostID() << "\n" << std::flush; + } + else + { + DEBUG_STREAM << "[eject] no console host -- notice skipped\n" << std::flush; + } player->suppressConsole = 1; // +0x258 const ScenarioRole *role = player->GetScenarioRole(); // +0x208 if (role == 0)