feat(net): remote retail jumps now show Falling animation + diag for height-mismatch investigation

User report:
1. ACdream watching retail-client jump shows no animation at all
   (legs don't fold during the arc).
2. Local jump arc in ACdream is shorter than what retail observes
   for the same character — formula mismatch somewhere.

Item 1 (animation): K-fix9 wired the body velocity but didn't
swap the sequencer cycle. The remote kept playing whatever
locomotion cycle was active (Ready/RunForward/etc.) through the
arc, so the legs stayed running while the body went up.
OnLiveVectorUpdated now also calls
  ae.Sequencer.SetCycle(currentStyle, MotionCommand.Falling, 1.0f)
when the velocity has +Z > 0.5 m/s. Mirrors the local-player
UpdatePlayerAnimation path that forces animCommand=Falling
whenever !IsOnGround. Style defaults to NonCombat (0x8000003D)
when the sequencer hasn't established one yet (rare on remotes).

Landing transitions back to the locomotion cycle naturally via
the next UpdateMotion the server sends after HitGround.

Item 2 (height): added per-jump diagnostic so we can compare
the formula-predicted peak (sentVz²/(2g) = sentVz²/19.6) with
the actually-rendered peak Δz. Logs:
  [jump.send] extent=... sentVz=... formulaPeak=...m startZ=...
  [jump.peak] sentVz=... formulaPeak=...m actualPeakDz=...m
              startZ=... peakZ=... landZ=...
Strip after the height-mismatch root cause is found.

Drive-by: previous diagnostic left an if/else hijack in the
resolve branch that broke 3 PlayerMovementControllerTests. Fixed.

Tests stay 1222 green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-04-26 17:51:37 +02:00
parent b609b5ea6e
commit 13cc08e506
2 changed files with 48 additions and 0 deletions

View file

@ -2380,6 +2380,25 @@ public sealed class GameWindow : IDisposable
rm.Body.TransientState &= ~(AcDream.Core.Physics.TransientStateFlags.Contact
| AcDream.Core.Physics.TransientStateFlags.OnWalkable);
rm.Body.State |= AcDream.Core.Physics.PhysicsStateFlags.Gravity;
// K-fix10 (2026-04-26): force the Falling animation cycle on
// the remote so the legs match the arc. Mirrors the local
// player's UpdatePlayerAnimation path which sets
// animCommand = Falling whenever !IsOnGround. Without this,
// the remote's existing locomotion cycle (RunForward,
// Ready, etc.) keeps playing through the jump — body goes
// up but legs stay running. Style is the sequencer's
// current style (NonCombat 0x8000003D for humanoids); cycle
// pace = 1.0 (Falling animation has its own baked rate).
if (_entitiesByServerGuid.TryGetValue(update.Guid, out var ent)
&& _animatedEntities.TryGetValue(ent.Id, out var ae)
&& ae.Sequencer is not null)
{
uint style = ae.Sequencer.CurrentStyle != 0
? ae.Sequencer.CurrentStyle
: 0x8000003Du; // NonCombat default
ae.Sequencer.SetCycle(style, AcDream.Core.Physics.MotionCommand.Falling, 1.0f);
}
}
if (Environment.GetEnvironmentVariable("ACDREAM_DUMP_MOTION") == "1")