Implement the translocation sphere -- the "blue warp" respawn effect (task #52)
BTTranslocationRenderable was a no-op stub; now reconstructed over the engine's POVTranslocateRenderable: loads tsphere.bgf and runs a collapse-on-arrival / expand-on-reveal sphere (scale 100->1 over 1.3s, then 1->150 over 1.0s, rotating) keyed on the player's SimulationState dial. Drawn direct from the render loop by BTDrawTranslocationSpheres (beside BTDrawBeams, PASS_ALPHABLEND) -- the same accommodation the beams/reticle use. The asset loads by FILENAME (tsphere.bgf), not through the RES table -- which is why every resource-name search missed the effect for three rounds. Trigger wiring: btl4vid.cpp MakeEntityRenderables builds the sphere for the LOCAL player (the authentic wiring builds it only for replicants + a POV fade for self, but peer player-attribute replication isn't wired -- on a replicant SimulationState/ DropZoneLocation read uninitialised). btplayer.cpp pulses SimulationState DropZoneAcquired->VehicleTranslocated at respawn (a 1.4s flip timer stands in for the engine's +1s drop-zone re-post) and writes the respawn origin into the DropZoneLocation attribute. Verified 2-node (BT_TLOC_LOG): on respawn the sphere collapses (~100->5) then expands (->150) at the valid drop-zone origin, deduped to <=2 active, respawn cycle un-regressed, no render errors. Visual appearance (colour/size) still needs a live look; the authentic see-others'-spheres path needs player replication. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6cd5f0b940
commit
63c1c5a460
@@ -204,6 +204,11 @@ 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)
|
||||
|
||||
//
|
||||
@@ -754,6 +759,19 @@ 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
|
||||
@@ -1047,6 +1065,25 @@ void
|
||||
|
||||
AlwaysExecute(); // param_1[10] &= ~2 (run every frame)
|
||||
deathCount = 0; // param_1[0x80]
|
||||
|
||||
//
|
||||
// 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.)
|
||||
//
|
||||
{
|
||||
Point3D *drop_attr = (Point3D *)GetAttributePointer("DropZoneLocation");
|
||||
if (drop_attr != 0)
|
||||
*drop_attr = message->dropZoneLocation.linearPosition;
|
||||
}
|
||||
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