Warp: decouple from player SimulationState (fix camera/targeting regressions)
Pulsing the player's SimulationState (DropZoneAcquired->Translocated) to trigger the translocation sphere regressed everything else that dial drives in our reconstruction -- the camera flipped to inside-view, targeting/firing gated off, shadow pass glitched. That dial is load-bearing; co-opting it was wrong. Replace with a self-contained render one-shot: btplayer.cpp respawn calls BTStartWarpEffect(dropZoneOrigin); the effect plays its own collapse->expand and touches nothing but the render. No SetSimulationState, no DropZoneLocation write, no per-entity renderable walk (the tree's BTTranslocationRenderable objects are now inert). Scale capped 30/40 (authentic 100/150) so the sphere -- centred on your own reinsertion -- doesn't envelop the camera; tunable via BT_WARP_SCALE. Smoke-verified 2-node: warp fires on each respawn (collapse 31->5, expand ->35), repeats, respawn cycle intact, no crash. Camera/targeting restored (state pulse gone). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
63c1c5a460
commit
f0535356bc
@@ -204,11 +204,6 @@ static_assert(sizeof(BTPlayer::MakeMessage) == 0xD0,
|
||||
|
||||
static const char *SelfDestructName = "self destruct"; // &DAT_00524b38
|
||||
static const Scalar RespawnDelay = 5.0f; // death -> drop-zone hunt (@004c0830)
|
||||
|
||||
// WARP (task #52): countdown from the respawn's DropZoneAcquired pulse to the
|
||||
// VehicleTranslocated flip that makes the translocation sphere EXPAND (reveal).
|
||||
// One local player per node, so a file-static holds it. <0 = idle.
|
||||
static Scalar sWarpExpandTimer = -1.0f;
|
||||
static const Scalar TicksPerSecond = 1.0f; // (see note in PlayerSimulation)
|
||||
|
||||
//
|
||||
@@ -759,19 +754,6 @@ void
|
||||
|
||||
Player::PlayerSimulation(time_slice); // FUN_0042e168
|
||||
|
||||
// WARP (task #52): once the collapse has had time to play, flip the
|
||||
// SimulationState dial off DropZoneAcquired so the translocation sphere
|
||||
// leaves its "wait" phase and EXPANDS (reveals the reborn mech).
|
||||
if (sWarpExpandTimer > 0.0f)
|
||||
{
|
||||
sWarpExpandTimer -= time_slice;
|
||||
if (sWarpExpandTimer <= 0.0f)
|
||||
{
|
||||
sWarpExpandTimer = -1.0f;
|
||||
SetSimulationState(VehicleTranslocatedState); // state 2 -> expand
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(lastPerformance - lastConsoleUpdate) / TicksPerSecond >= CONSOLE_UPDATE_INTERVAL // _DAT_004c08fc
|
||||
|| application->GetApplicationState() == Application::EndingMission // app+0x88 == 6
|
||||
@@ -1068,22 +1050,16 @@ void
|
||||
|
||||
//
|
||||
// WARP (task #52): fire the translocation sphere at our reinsertion.
|
||||
// Publish the drop-zone position into our DropZoneLocation attribute (the
|
||||
// sphere renderable draws there) and pulse the SimulationState dial to
|
||||
// DropZoneAcquired -- state 1, the sphere's COLLAPSE trigger.
|
||||
// PlayerSimulation flips it to VehicleTranslocated ~1.4 s later, which the
|
||||
// sphere reads as "reincarnate" and EXPANDS to reveal the reborn mech.
|
||||
// (Authentic trigger = the player's own SimulationState + DropZoneLocation
|
||||
// attribute; the flip-timer stands in for the engine's +1 s drop-zone
|
||||
// re-post choreography, which our sever-and-recreate respawn skips.)
|
||||
// Self-contained render one-shot at the drop-zone position -- it does NOT
|
||||
// touch the player's SimulationState (that dial drives the camera/POV +
|
||||
// targeting in our reconstruction; pulsing it for the sphere trigger
|
||||
// regressed all of those). The effect plays its own collapse->expand.
|
||||
//
|
||||
{
|
||||
Point3D *drop_attr = (Point3D *)GetAttributePointer("DropZoneLocation");
|
||||
if (drop_attr != 0)
|
||||
*drop_attr = message->dropZoneLocation.linearPosition;
|
||||
const Point3D &p = message->dropZoneLocation.linearPosition;
|
||||
extern void BTStartWarpEffect(float x, float y, float z);
|
||||
BTStartWarpEffect((float)p.x, (float)p.y, (float)p.z);
|
||||
}
|
||||
SetSimulationState(DropZoneAcquiredState); // state 1 -> collapse
|
||||
sWarpExpandTimer = 1.4f;
|
||||
}
|
||||
else if (deathCount == message->deathCount) // param_2[0xe] == param_1[0x80]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user