Skip to content

Client: remote proxy locomotion (gait + in-air) via snapshot interpolation#53

Merged
Kheartz merged 2 commits into
mainfrom
proxy-locomotion
Jun 27, 2026
Merged

Client: remote proxy locomotion (gait + in-air) via snapshot interpolation#53
Kheartz merged 2 commits into
mainfrom
proxy-locomotion

Conversation

@Kheartz

@Kheartz Kheartz commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Remote-player/NPC proxies now animate their on-foot movement (idle/walk/run/sprint blended by ground speed, plus an in-air fall state) and move smoothly instead of snapping between packets.

Locomotion driver (ClientHuman)

  • Ground speed derived from the per-packet position delta (EWMA Σdist/Σtime, so packet-timing jitter cancels and the gait clip doesn't flicker).
  • Primary path: drive the pak's ABP_RemoteAvatar 1D blendspace (Speed + bInAir) for smooth gait blending.
  • Fallback: single-node Hu_BM_* clips / move-blendspace (proxy_locomotion.{h,cpp}) if the pak ABP isn't available, so a build without it still animates.
  • Async-build gate so we don't drive a half-built CCC mesh.

Smooth movement — new snapshot interpolation (core/snapshot_interpolator.h)

  • The framework's Utils::Interpolator is a per-packet error-chaser that snaps then freezes between packets (and was being fed delay in seconds where it wants milliseconds) → visible jitter.
  • Replaced it for humans with a standalone, header-only snapshot/playle): record timestamped (pos, rot) samples,

Wire (shared/modules/human_sync.hpp, HumanEntity)

  • New per-tick stateFlags byte + UpdateData on SerializeFields; only InAir is wired now. The Mounted/Cast/Lumos flags and mountId/spellId/aimPitch fields are reserved so broom/spell land additively without re-cutting the wire.

Test includes a /walknpcs to test the gait animations on velocity and visually affirming the interpolation.

Kheartz added 2 commits June 26, 2026 23:41
Re-express the demo's proxy locomotion onto main's ClientHuman. The proxy is
moved by the network position (movement disabled), so gait can't come from its
velocity: derive ground speed from the per-packet position delta (EWMA) and
drive ABP_RemoteAvatar's Speed input from the pak (smooth blend), falling back
to single-node clips (ProxyLocomotion) if the ABP/blendspace is unavailable.
In-air rides a new stateFlags byte (HumanSync) on HumanEntity via SerializeFields;
mount/spell fields are reserved in the wire for the rest of Phase 4. Adds the
anim reflection helpers (LoadAnimSequence/Asset, PlayAnimBlended,
SetBlendSpaceInputOnSkin) and surfaces CharacterMesh0 from SpawnProxy.
Add a Human.setInAir(bool) scripting binding (sets the InAir state flag, relayed
to clients) and upgrade /walknpcs to orbit spawned NPCs through idle→walk→run→
sprint→jump with facing, so remote-proxy locomotion can be eyeballed with one
client (/spawnnpc, then /walknpcs to start/stop, /clearnpcs to remove).
@Kheartz Kheartz force-pushed the proxy-locomotion branch from b20700d to 9b2cb2b Compare June 27, 2026 03:56
@Kheartz Kheartz merged commit 1de5dfa into main Jun 27, 2026
2 checks passed
@Kheartz Kheartz deleted the proxy-locomotion branch June 27, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant