chore(motion): L.3 M6 — scrub stale ACDREAM_INTERP_MANAGER + dead fields

Cleans up dead code revealed by L.3 M2/M3:

GameWindow.cs:
- RemoteMotion.LastServerZ field deleted (only consumed by the M2-
  removed Step 5 landing fallback in TickAnimations; never read).
- RemoteMotion.TargetOrientation field deleted (audit § 1 flagged as
  DEAD; only ever written, never read).
- Stale ACDREAM_INTERP_MANAGER comments removed from RemoteMotion.Interp
  and OnLivePositionUpdated (the env-var no longer gates anything as
  of M2).
- Doc-comments on Interp + Position rewritten to describe the M2/M3
  production semantics (queue catch-up + REPLACE-style combiner).

CLAUDE.md:
- ACDREAM_INTERP_MANAGER env-var entry rewritten as a retirement note
  pointing at commit 40d88b9 (M2). The path it gated is now the
  default for player remotes.

Build green, dotnet test green (8 pre-existing failures unchanged on
this baseline).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-05 15:20:50 +02:00
parent 2365c8cd6e
commit d57ace0177
2 changed files with 13 additions and 53 deletions

View file

@ -295,11 +295,6 @@ public sealed class GameWindow : IDisposable
/// </summary>
public double LastMoveToPacketTime;
/// <summary>
/// Legacy field — no longer used for slerp (retail hard-snaps
/// per FUN_00514b90 set_frame). Kept to avoid churn.
/// </summary>
public System.Numerics.Quaternion TargetOrientation = System.Numerics.Quaternion.Identity;
/// <summary>
/// Angular velocity seeded from UpdateMotion TurnCommand/TurnSpeed
/// (π/2 × turnSpeed, signed). Applied per tick to body orientation
/// via manual integration (bypassing <c>PhysicsBody.update_object</c>'s
@ -334,34 +329,21 @@ public sealed class GameWindow : IDisposable
/// <summary>
/// Per-remote position-waypoint queue + catch-up math (retail's
/// CPhysicsObj::InterpolateTo + InterpolationManager::adjust_offset).
/// Replaces the hard-snap-then-Euler-extrapolate path when
/// <c>ACDREAM_INTERP_MANAGER=1</c> — see Phase L.3.1 spec at
/// <c>docs/superpowers/specs/2026-05-02-l3-remote-entity-motion-design.md</c>.
/// Field exists from Task 3 onwards; consumed in Tasks 4 + 5.
/// Drives per-tick body translation for grounded player remotes
/// via <see cref="Position"/>.
/// </summary>
public AcDream.Core.Physics.InterpolationManager Interp { get; } =
new AcDream.Core.Physics.InterpolationManager();
/// <summary>
/// Per-frame combiner for animation root motion + InterpolationManager
/// correction (Phase L.3.2). Consumed in TickAnimations to compute the
/// per-frame body.Position delta.
/// correction. Mirrors retail UpdatePositionInternal @ 0x00512c30:
/// queue catch-up REPLACES anim when active; anim stands when queue
/// is idle.
/// </summary>
public AcDream.Core.Physics.PositionManager Position { get; } =
new AcDream.Core.Physics.PositionManager();
/// <summary>
/// Most recent server-broadcast Z coordinate from any UpdatePosition
/// (including mid-arc airborne UPs). Used by the
/// <c>ACDREAM_INTERP_MANAGER=1</c> per-tick path as a landing-fallback
/// floor: if gravity drags the body's Z below this value while
/// <see cref="Airborne"/> is still set, force-land locally because
/// the server has effectively told us where the ground is even if
/// it never sent an IsGrounded=true UP. Initialized to NaN so the
/// fallback is a no-op until the first UP arrives.
/// </summary>
public float LastServerZ = float.NaN;
/// <summary>
/// Diagnostic-only (gated on <c>ACDREAM_REMOTE_VEL_DIAG=1</c>): the
/// previous UpdatePosition's world position + timestamp. The per-tick
@ -3444,30 +3426,12 @@ public sealed class GameWindow : IDisposable
// from ServerVelocity / ServerMoveTo which the legacy path
// already handles correctly.
//
// Was previously gated on ACDREAM_INTERP_MANAGER=1; the env-var
// path's per-tick TickAnimations counterpart is regressed
// (issue #40). M2 keeps the OnLivePositionUpdated half (which
// is correct) and rewrites the per-tick half — see TickAnimations.
if (IsPlayerGuid(update.Guid))
{
// Orientation always snaps on receipt — InterpolationManager walks
// position only; heading would otherwise lag the queue.
rmState.Body.Orientation = rot;
// Track the most recent GROUNDED server-broadcast Z. Read by
// the per-tick landing-fallback in TickAnimations: if gravity
// drags the body more than 0.5 m below this floor while still
// airborne, we force-land locally even when the server never
// sent an IsGrounded=true UP for the actual landing frame.
//
// Only updated for grounded UPs — mid-arc airborne UPs would
// raise this value to the player's peak Z, then the body's
// descent would cross (peak - 0.5) and trigger a force-land
// mid-air, producing the user-reported "small landing in the
// air before landing on the ground" when jumping while moving.
if (update.IsGrounded)
rmState.LastServerZ = worldPos.Z;
// Diagnostic (ACDREAM_REMOTE_VEL_DIAG=1): roll the previous
// server-pos snapshot forward AND print the per-UP comparison
// between the max sequencer speed observed since last UP and
@ -3643,7 +3607,6 @@ public sealed class GameWindow : IDisposable
// a halved "observed" rate → visible slow-start. Formula-only
// is stable and simple; hard-snap fixes any drift.
rmState.Body.Orientation = rot;
rmState.TargetOrientation = rot;
rmState.LastServerPos = worldPos;
rmState.LastServerPosTime = nowSec;
// Align the body's physics clock with our clock so update_object