Skip to content

Scene-driven movement animations#3

Merged
robtfm merged 9 commits into
mainfrom
feat/scene-driven-movement-animations
Apr 22, 2026
Merged

Scene-driven movement animations#3
robtfm merged 9 commits into
mainfrom
feat/scene-driven-movement-animations

Conversation

@robtfm

@robtfm robtfm commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reproduces the engine's velocity-based movement animation selection inside the scene, as a prerequisite for scene-authored locomotion clips.
  • Commits idle + walk animation assets.
  • Fixes a jump-stuck bug where re-pressing jump mid-air re-entered the continuing-jump branch with stale state, leaving the avatar in jump animation with a large negative y velocity.
  • Points @dcl/sdk at the js-sdk-toolchain PR #1377 artifact that ships MovementAnimation / AvatarAnimationState / AvatarMovement protos.

Dependencies

robtfm and others added 9 commits April 20, 2026 13:14
Replace the engine's built-in walk/run/jump/idle selection with a
scene-driven equivalent written via MovementAnimation. selectAnimation
reads the scene's own jump/ground state directly (jumpStartHeight,
grounded, currentJumpHeight) rather than recomputing jump physics, and
holds the landing clip until the engine reports (loopCount/playbackTime)
that it has completed.

Adds run.glb + jump.glb and exports currentJumpHeight from vertical.ts
so the jump clip's playback speed tracks the ascent time-to-peak.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Referenced by selectAnimation but previously left untracked.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A release followed by a re-press while still airborne kept jumpStartHeight
defined but re-engaged the continuing-jump branch with a decayed
jumpSpeedCap, which collapsed to a negative and drove velocity.y deeply
negative. Once landed, the scene kept reporting mid-jump and broadcast a
large negative y velocity. Track the release so continuing-jump is blocked
until a fresh ground press resets it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Updates @dcl/sdk to the js-sdk-toolchain PR #1377 build that ships
MovementAnimation / AvatarAnimationState / AvatarMovement protos. Drops
the redundant @dcl/ecs / @dcl/js-runtime / @dcl/sdk-commands direct
deps — @dcl/sdk pulls matching versions transitively, so pinning them
at the previous PR's tarballs just fought resolution.
Publish avatar-bus audio hashes on walk/run step crossings, jump takeoff,
and landing so the scene-driven animation path exercises the sounds field
end-to-end. Timings and variant pools mirror the native built-ins; clip-
relative crossing detection is forward-only to avoid a burst of triggers
when the walk clip's playback speed goes negative during turns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Port the engine's fallback-path hold into selectAnimation: once the clip
passes its midpoint (which our ttp-scaled speed reaches at the physical
apex), set speed to 0 so the pose freezes. Without this, falling from a
high place loops the takeoff pose repeatedly.

We deliberately don't re-seek each frame — the engine preserves playback
position while speed is 0, and an explicit seek visibly hiccups the pose.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous `landFrame = s.loop` condition was meant to catch the tick
we transitioned from looping ascent to non-looping landing, but engine
CRDT latency kept reporting the clip as loop=true for several ticks
after we switched the request, so the sound retriggered every frame.

Replace with a `landSoundFired` latch reset on a new jump, fired once
on the first tick of the landing block.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Key the landing sound off the airborne->grounded transition and a
>0.5m drop threshold instead of a one-shot latch tied to jumps. This
covers walking off platforms while keeping small step-offs silent.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robtfm robtfm merged commit fe6825b into main Apr 22, 2026
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