fantasycalendar / FoundryVTT-Sequencer

This module implements a basic pipeline that can be used for managing the flow of a set of functions, effects, sounds, and macros.
Other
46 stars 22 forks source link

[BUG] - Playback rate of flipbooks depend on momentary framerate #274

Open Codas opened 1 month ago

Codas commented 1 month ago

Flipbooks currently exhibit inconsistent playback rates that vary with the current frame rate and are relative to the frame rate when the flipbook animation was first started.

Reproducing it can be finicky in certain cases, but the easiest way is: Set FPS in foundry to 60 or something like that. Create a flipbook animation and play it. In the best case scenario, the animation will play back as if set to 24 fps. lower the framerate in foundry to 30. The animation will now play with 12 fps.

The reason for this is that the AnimatedSprite implementation by default plays each frame for exactly one rendered frame. With a fixed 60 fps, the hardcoded playbackRate lets the animation correctly play at 24 fps.

In reality however, many systems cannot handle a static 60 fps wheras others have the framerate unlocked to above 60.

The AnimatedSprite has the possibility to instead of a list of textures be supplied with a list of FrameObjects that encode timing information for each frame together with the texture to be played.