From 2aba89f962c695b49e165f0a5b8c62a585e8ff81 Mon Sep 17 00:00:00 2001 From: arcattack Date: Tue, 14 Jul 2026 11:07:45 -0500 Subject: [PATCH] MP: FIX replicant walk-entry floor -- gate on standSpeed not walkStrideLength (task #50) The prior floor gated on walkStrideLength*0.5, but walkStrideLength is a stride METRIC (~22.0), not the walk velocity (~6.1) -- so the condition sd > 11 was never true for a walking peer and the floor never fired. The replicant's derived speedDemand (== actual velocity 6.13) sits BELOW standSpeed (6.83), so the leg SM's stand->walk gate (standSpeed < demand) never tripped and the peer slid forward in the Standing pose. Gate on standSpeed instead: floor the demand to standSpeed*1.05 when the peer is clearly walking (demand in (standSpeed*0.5, standSpeed*1.05)). Verified live: uvel=6.13 -> spd=7.169 floored, legState enters 5 (walk) on frame 1 with no Standing-pose slide. standSpeed=6.8277 confirmed. Co-Authored-By: Claude Opus 4.8 (1M context) --- game/reconstructed/mech4.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index b480375..10c6a07 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -1968,8 +1968,10 @@ void // so the CADENCE still matches the actual travel (no foot-slip). Reverse // needs no floor -- its entry gate is `commandedSpeed < ZeroSpeed`, which // any negative demand already trips. - if (sd > walkStrideLength * 0.5f && sd < standSpeed * 1.1f) - sd = standSpeed * 1.1f; + // (CORRECTED threshold: walkStrideLength is a STRIDE metric ~22, NOT + // the walk velocity ~6.1 -- gate on standSpeed, the actual gate value.) + if (sd > standSpeed * 0.5f && sd < standSpeed * 1.05f) + sd = standSpeed * 1.05f; replMppr->speedDemand = sd; // REPLICANT TURN-STEP (user-reported: a turning peer // statue-rotates while the local mech steps): the leg SM's @@ -2060,6 +2062,8 @@ void << " spd=" << replMppr->speedDemand << " legState=" << (int)legStateAlarm.GetLevel() << " legFrm=" << legAnimation.currentFrame + << " standSp=" << standSpeed + << " walkStr=" << walkStrideLength << " nu-lp=" << (nextUpdate.ticks - lastPerformance.ticks) << " dt=" << dt << "\n" << std::flush; }