From 349ba65f3ec008cd371d883010415770b882145e Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 6 May 2026 08:40:50 +0200 Subject: [PATCH] =?UTF-8?q?fix(motion):=20#39=20=E2=80=94=20use=20Sidestep?= =?UTF-8?q?AnimSpeed=20(1.25)=20as=20sidestep=20mapping=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/AcDream.App/Rendering/GameWindow.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 7eb151c..588e448 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -3491,12 +3491,14 @@ public sealed class GameWindow : IDisposable // velocity here. Preserve the sign — SideStepLeft is sometimes // emitted with negative speedMod by the adjust_motion path. // - // Magnitude: horizSpeed / WalkAnimSpeed maps the observed speed - // back to a speedMod the sequencer can apply as a framerate - // multiplier. WalkAnimSpeed is the reasonable base because - // sidestep cycles use the WalkAnim equivalent (no separate - // RunSidestep cycle in the dat). - float sideMag = horizSpeed / AcDream.Core.Physics.MotionInterpreter.WalkAnimSpeed; + // Magnitude: horizSpeed / SidestepAnimSpeed maps the observed + // speed back to a SideStepSpeed the sequencer can apply as a + // framerate multiplier. Retail's get_state_velocity for + // sidestep cycles is `velocity.X = SidestepAnimSpeed * + // SideStepSpeed` (MotionInterpreter.cs:592 — constant 1.25 + // 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, AcDream.Core.Physics.ServerControlledLocomotion.MinSpeedMod),