AnimationChain skips one frame between each step due to deferred command flush #25

Closed
opened 2026-05-19 18:44:34 +00:00 by funman300 · 0 comments
Owner

File

solitaire_engine/src/card_animation/chain.rs lines 98–113

Description

advance_animation_chains uses Without<CardAnimation> to detect when the current step has finished. advance_card_animations ends a step via commands.entity(entity).remove::<CardAnimation>(). Bevy deferred commands are not flushed until the next ApplyDeferred point. In the same frame a step completes, CardAnimation is still visible to the query — advance_animation_chains does not pop the next entry, producing a consistent 1-frame gap between every pair of chain steps. For fast chains this is a visible stutter; for long sequences the timing error accumulates.

Fix

Either schedule an explicit ApplyDeferred between advance_card_animations and advance_animation_chains, or have advance_card_animations signal step completion via an Event rather than relying on component removal visibility.

## File `solitaire_engine/src/card_animation/chain.rs` lines 98–113 ## Description `advance_animation_chains` uses `Without<CardAnimation>` to detect when the current step has finished. `advance_card_animations` ends a step via `commands.entity(entity).remove::<CardAnimation>()`. Bevy deferred commands are not flushed until the next `ApplyDeferred` point. In the same frame a step completes, `CardAnimation` is still visible to the query — `advance_animation_chains` does not pop the next entry, producing a consistent 1-frame gap between every pair of chain steps. For fast chains this is a visible stutter; for long sequences the timing error accumulates. ## Fix Either schedule an explicit `ApplyDeferred` between `advance_card_animations` and `advance_animation_chains`, or have `advance_card_animations` signal step completion via an `Event` rather than relying on component removal visibility.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#25