fix(anim): instant-engage Falling cycle on jump start (skip transition link)
User reported transition from running to jumping looked
slow -- the character stood still for ~100 ms at the start
of the jump before the legs folded into Falling.
Root cause: AnimationSequencer.SetCycle resolves a
transition link (e.g. RunForward -> Falling) from the
motion table and enqueues those non-looping link frames
BEFORE the Falling cycle. The link is the "stop running,
prepare to fall" anim -- a few frames of standing-style
pose. While it drained, the character looked frozen.
Fix: SetCycle gains a skipTransitionLink parameter. When
true, the GetLink call is bypassed AND the entire queue is
cleared (so any in-flight non-cyclic frames from a
previous transition don't continue draining). Only the
target cycle gets enqueued, cursor goes straight to its
start.
Both call sites pass true for Falling:
- OnLiveVectorUpdated (remote-jump VectorUpdate handler)
- UpdatePlayerAnimation (local airborne path) when
animCommand == Falling. Other transitions
(Walk -> Run, Run -> Ready, etc.) keep the link --
smooth transitions stay smooth, only the jump start
is hard-cut.
Tests stay 1222 green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ff504e9ec1
commit
b86e77e837
2 changed files with 48 additions and 12 deletions
|
|
@ -2427,12 +2427,14 @@ public sealed class GameWindow : IDisposable
|
|||
// K-fix10 (2026-04-26): force the Falling animation cycle on
|
||||
// the remote so the legs match the arc. Mirrors the local
|
||||
// player's UpdatePlayerAnimation path which sets
|
||||
// animCommand = Falling whenever !IsOnGround. Without this,
|
||||
// the remote's existing locomotion cycle (RunForward,
|
||||
// Ready, etc.) keeps playing through the jump — body goes
|
||||
// up but legs stay running. Style is the sequencer's
|
||||
// current style (NonCombat 0x8000003D for humanoids); cycle
|
||||
// pace = 1.0 (Falling animation has its own baked rate).
|
||||
// animCommand = Falling whenever !IsOnGround.
|
||||
//
|
||||
// K-fix18 (2026-04-26): pass skipTransitionLink:true so the
|
||||
// RunForward→Falling transition frames don't play first.
|
||||
// Without that flag the remote stood still for ~100 ms at
|
||||
// the start of the jump while the link drained, then
|
||||
// folded into Falling. Skipping the link makes the pose
|
||||
// engage immediately on jump start.
|
||||
if (_entitiesByServerGuid.TryGetValue(update.Guid, out var ent)
|
||||
&& _animatedEntities.TryGetValue(ent.Id, out var ae)
|
||||
&& ae.Sequencer is not null)
|
||||
|
|
@ -2440,7 +2442,8 @@ public sealed class GameWindow : IDisposable
|
|||
uint style = ae.Sequencer.CurrentStyle != 0
|
||||
? ae.Sequencer.CurrentStyle
|
||||
: 0x8000003Du; // NonCombat default
|
||||
ae.Sequencer.SetCycle(style, AcDream.Core.Physics.MotionCommand.Falling, 1.0f);
|
||||
ae.Sequencer.SetCycle(style, AcDream.Core.Physics.MotionCommand.Falling, 1.0f,
|
||||
skipTransitionLink: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5067,7 +5070,16 @@ public sealed class GameWindow : IDisposable
|
|||
{
|
||||
animScale = s;
|
||||
}
|
||||
ae.Sequencer.SetCycle(fullStyle, animCommand, animSpeed * animScale);
|
||||
// K-fix18 (2026-04-26): when transitioning into Falling
|
||||
// (jump start), skip the link so the legs engage Falling
|
||||
// immediately. Without this the local player visibly
|
||||
// stood still for ~100 ms at the start of every jump
|
||||
// while the RunForward→Falling transition link drained.
|
||||
// For everything else (Walk → Run, Run → Ready, etc.) we
|
||||
// keep the link so transitions stay smooth.
|
||||
bool skipLink = animCommand == AcDream.Core.Physics.MotionCommand.Falling;
|
||||
ae.Sequencer.SetCycle(fullStyle, animCommand, animSpeed * animScale,
|
||||
skipTransitionLink: skipLink);
|
||||
}
|
||||
|
||||
// Legacy path: update the manual slerp fields (for entities without sequencer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue