Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards animations with Engine.time_scale set skip the final (first) keyframe #57271

Closed
tcoxon opened this issue Jan 26, 2022 · 5 comments · Fixed by #81452
Closed

Backwards animations with Engine.time_scale set skip the final (first) keyframe #57271

tcoxon opened this issue Jan 26, 2022 · 5 comments · Fixed by #81452

Comments

@tcoxon
Copy link
Contributor

tcoxon commented Jan 26, 2022

Godot version

3.4.2-stable

System information

Ubuntu 16.04, GTX970 NVIDIA 384.130, with GLES3 backend

Issue description

In my project I find that AnimationPlayers sometimes (semi-randomly) skip the final keyframe of an animation. I think that this happening when Engine.time_scale is set (which I use to speed up battle animations).

I've been able to create a reproducer for the cases where this happens for an animation that is playing backwards. Forwards animations also seem to be affected in my project, however I haven't been able to reproduce it in isolation.

Steps to reproduce

  1. Run the attached project.
  2. The two 'play' buttons play the same animation on the same AnimationPlayer. Play it 'normally' first, and observe that the animated panel & texture end on blackness.
  3. Click 'Play Fast' (which plays at 8x speed) and observe that when the animation has finished, the panel is red and the godot logo is visible in the TextureRect.

I expected both to end the same way regardless of the speed of playback.

Minimal reproduction project

time_scale_animation_player.zip

@Calinou Calinou added this to the 4.0 milestone Jan 26, 2022
@Calinou
Copy link
Member

Calinou commented Jan 26, 2022

I remember seeing an issue about this (also with forwards animations), but I can't find it right now.

@tcoxon
Copy link
Contributor Author

tcoxon commented Apr 1, 2022

We're seeing this occur relatively frequently on forwards-playing animations on lower-powered devices, even with Engine.time_scale set to 1.0. It seems like it's related to long frame deltas somehow.

We have a lot of things in our project that wait on animation_finished signals that, with this bug, never come--resulting in the game getting stuck in an unplayable state.

@akien-mga
Copy link
Member

I can confirm the bug in current 3.x (4ecb9cc).

I couldn't reproduce it in master after a quick and dirty port of the MRP, but that's not to say that it couldn't happen in a more complex one:
time_scale_animation_player.zip

@tcoxon
Copy link
Contributor Author

tcoxon commented Apr 12, 2022

I managed to narrow the bug affecting the forwards-playing animations in my project down to #26887, which has already been fixed in 3.4 and master. My comments about that can be ignored.

For clarity's sake, the bug affecting backwards-playing animations in the reproducer has a different cause and continues to affect 3.4.

@TokageItLab TokageItLab modified the milestones: 4.0, 3.x Feb 22, 2023
@tcoxon
Copy link
Contributor Author

tcoxon commented Sep 8, 2023

I've reproduced the reverse-animation bug on 4.1.1-stable.
Reproducer

The test scene contains an AnimationPlayer that autoplays an animation with some very closely-spaced keyframes. The animation plays forwards first, and when it finishes it is played backwards.

Expected behavior:

  • ABCDDCBA is logged (via calls from the method track)
  • After all animations are finished, the icon node is modulated with red.

Observed behavior:

  • ABCDD is logged
  • After all animations are finished, the icon node has default white modulation

@akien-mga akien-mga modified the milestones: 3.x, 4.x Sep 8, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Sep 8, 2023
YuriSizov pushed a commit to YuriSizov/godot that referenced this issue Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants