fix(motion): #39 — use SidestepAnimSpeed (1.25) as sidestep mapping base

Fix #4 (commit cc62e1c) divided the observed horizSpeed by WalkAnimSpeed
(3.12 m/s) when computing the sidestep speedMod. That made slow strafe
come out 2.5× too slow because retail's sidestep cycle uses
SidestepAnimSpeed (1.25 m/s) — a smaller base — per
MotionInterpreter.cs:592 `velocity.X = SidestepAnimSpeed * SideStepSpeed`.

User report: "Strafe left and right slowly now is SUPER slow :)".

Replace MotionInterpreter.WalkAnimSpeed with MotionInterpreter.SidestepAnimSpeed
in the sidestep branch only. Forward / backward branches continue using
WalkAnimSpeed (correct for those motions).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-06 08:40:50 +02:00
parent cc62e1cfde
commit 349ba65f3e

View file

@ -3491,12 +3491,14 @@ public sealed class GameWindow : IDisposable
// velocity here. Preserve the sign — SideStepLeft is sometimes // velocity here. Preserve the sign — SideStepLeft is sometimes
// emitted with negative speedMod by the adjust_motion path. // emitted with negative speedMod by the adjust_motion path.
// //
// Magnitude: horizSpeed / WalkAnimSpeed maps the observed speed // Magnitude: horizSpeed / SidestepAnimSpeed maps the observed
// back to a speedMod the sequencer can apply as a framerate // speed back to a SideStepSpeed the sequencer can apply as a
// multiplier. WalkAnimSpeed is the reasonable base because // framerate multiplier. Retail's get_state_velocity for
// sidestep cycles use the WalkAnim equivalent (no separate // sidestep cycles is `velocity.X = SidestepAnimSpeed *
// RunSidestep cycle in the dat). // SideStepSpeed` (MotionInterpreter.cs:592 — constant 1.25
float sideMag = horizSpeed / AcDream.Core.Physics.MotionInterpreter.WalkAnimSpeed; // m/s). Dividing by WalkAnimSpeed (3.12) here was wrong by
// 2.5× and made slow strafe play visibly slower than retail.
float sideMag = horizSpeed / AcDream.Core.Physics.MotionInterpreter.SidestepAnimSpeed;
sideMag = MathF.Min(MathF.Max( sideMag = MathF.Min(MathF.Max(
sideMag, sideMag,
AcDream.Core.Physics.ServerControlledLocomotion.MinSpeedMod), AcDream.Core.Physics.ServerControlledLocomotion.MinSpeedMod),