Skip to content

Reduce other-player warp/stutter via heartbeat extrapolation; add player speed-rate knobs#385

Open
Krilliac wants to merge 4 commits into
mangoszero:masterfrom
Krilliac:feature/movement-enhancements
Open

Reduce other-player warp/stutter via heartbeat extrapolation; add player speed-rate knobs#385
Krilliac wants to merge 4 commits into
mangoszero:masterfrom
Krilliac:feature/movement-enhancements

Conversation

@Krilliac

@Krilliac Krilliac commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
  1. Other-player movement smoothing (Movement.Smoothing, OFF by default)
    When a moving player's client goes quiet mid-stride (lag / packet loss), other players normally see them freeze, then warp. This injects extrapolated MSG_MOVE_HEARTBEAT packets — dead-reckoned along the mover's actual heading (forward/back/strafe/diagonal, backpedal-aware) — so nearby clients keep interpolating smoothly until real packets resume. Broadcast-only (the server's authoritative position is never changed; the next real packet corrects it), ground-movement only, capped to a short extrapolation window. It's experimental A/B netcode, hence off by default — flip it on to test.

  2. Tunable player speed (live)
    Global Movement.PlayerSpeedRate (percent) plus per-type Run / Swim / Walk rates, applied in Unit::UpdateSpeed. Great for fun realms or testing.

Config (in mangosd.conf.dist): Movement.Smoothing, Movement.HeartbeatMs, Movement.MaxExtrapolateMs, Movement.PlayerSpeedRate, Movement.{Run,Swim,Walk}SpeedRate.

Commands:

  • .movement status [target] — pos, speeds, movement flags
  • .movement config — show live settings
  • .movement set — tune at runtime (e.g. .movement set smoothing 1, .movement set run 150)

This change is Reviewable

Krilliac and others added 2 commits June 19, 2026 17:19
…yer speed rates

Other-player movement smoothing (Movement.Smoothing, OFF by default): when a
moving player's client goes quiet mid-stride (lag/packet loss), the server injects
extrapolated MSG_MOVE_HEARTBEAT packets dead-reckoned along the mover's actual
heading (forward/back/strafe/diagonal, backpedal-aware), capped to a short window,
so nearby clients interpolate smoothly instead of seeing them freeze then warp.
Broadcast-only - the server's authoritative position is never changed; the next
real client packet corrects it. Ground movement only; A/B netcode.

Tunable player speed (Unit::UpdateSpeed): Movement.PlayerSpeedRate global percent
multiplier plus optional per-move-type Movement.Run/Swim/WalkSpeedRate, applied to
players only.

.movement status|config|set command group (console/SOAP capable) to inspect a
player's movement state and live-tune the config; speed changes refresh online
players immediately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Jun 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 28 complexity · 0 duplication

Metric Results
Complexity 28
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@AppVeyorBot

Copy link
Copy Markdown

@MadMaxMangos

Copy link
Copy Markdown
Member

Conf version will need bumping on this as it has new values. I'll provide an adversarial review for you Sunday.

Krilliac and others added 2 commits June 20, 2026 09:14
…hrough)

If a predicted heartbeat position crossed world geometry, observers saw the mover
clip through the wall then snap back on reconcile. The extrapolation is now
collision-aware: raycast the predicted path via VMap GetHitPosition and clamp the
heartbeat to just before any obstacle, so the mover visually stops at the wall.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… options

ConfVersion and MANGOSD_CONFIG_VERSION both derive from MANGOS_WORLD_VER; bumping it
so servers are prompted to refresh their config after the Movement.* additions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AppVeyorBot

Copy link
Copy Markdown

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.

3 participants