Skip to content

Fix for multiplayer regressions caused by changes in frame timing - #773

Open
DAPTYX wants to merge 1 commit into
dhewm:masterfrom
DAPTYX:revert-multiplayer-pacing
Open

Fix for multiplayer regressions caused by changes in frame timing#773
DAPTYX wants to merge 1 commit into
dhewm:masterfrom
DAPTYX:revert-multiplayer-pacing

Conversation

@DAPTYX

@DAPTYX DAPTYX commented Aug 6, 2026

Copy link
Copy Markdown

Attempt to isolate server work from the frame pacing changes in c2a14db (caused 16 ms ping, even on localhost) and abd8d4a (caused client-server desync) by restoring the multiplayer behavior. These changes resolved both issues for me.

Testing was performed on CachyOS. The faulty/fixed behavior could only be observed by connecting to the server, not on the client hosting the server.

Inkub0 added a commit to Inkub0/dude that referenced this pull request Aug 19, 2026
…ation; MP frame-timing mitigation

Fold the genuinely-better parts of dhewm3 PR dhewm#771 ("decouple rendering from
game tics") into our own com_interpolate, plus the dhewm3 PR dhewm#773 multiplayer
frame-timing mitigation. Both touch the same frame-timing files, so they land
together.

com_interpolate refinements (all archived cvars, default 1, no-op unless
com_interpolate is set; applied to both neo/game/ and neo/d3xp/):

- com_interpolateAim: low-latency mouselook. Overlays the pending, not-yet-
  simulated mouse-look delta onto the rendered view each frame so aiming tracks
  the mouse 1:1 instead of rendering ~16.7ms (one tic) behind. Exposed ABI-
  stably via a new idCommon::GetPendingViewAngleDelta() appended to the vtable
  (forwarding to idUsercmdGenLocal), not by changing idGame::Draw's signature
  the way dhewm#771 does. The mouse buffer is read non-destructively (only the tic
  clears it) and the sign/scale/invert + strafe/mlook gating mirror MouseMove()
  exactly, so it never steals input and doesn't hitch when a tic lands. The view
  weapon recomposes onto the produced renderView eye so the gun stays locked to
  the real-time aim. Shooting still resolves at the tic (no gameplay change).

- com_interpolateAnim: sample animated entities' skeletal animation at the sub-
  tic instant (in UpdateRenderEntity), so monster limbs move smoothly above
  60fps rather than stepping at the tic rate. Skips the view weapon, which owns
  renderAnimTimeOffset, to avoid double-applying.

- com_interpolateCubic: cubic Hermite (Catmull-Rom) entity position instead of
  linear lerp, smoother through accelerations. Adds a second history sample
  (renderInterpOriginPrev2/AxisPrev2/HistCount). Stays strictly interpolation
  between the last two tics -- no extrapolation, no overshoot.

Deliberately not ported from dhewm#771: extrapolation, com_maxFps (we already have
com_maxFPS), and the MP async / renderView->time decoupling that PR dhewm#773 had to
fix. Our approach keeps the game-DLL ABI stable, stays single-player-scoped,
and preserves the eye-relative view-model + gui-glow-light interpolation.

MP frame-timing mitigation (dhewm3 PR dhewm#773): use fixed USERCMD_MSEC timing in
multiplayer (single-player still recalculates each frame), and skip the full-
frame tic-sync sleep on an active server (clients keep it) to avoid the phantom
localhost ping and client/server desync from earlier frame-pacing changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant