-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Animated Texture stopping #69621
Comments
@Zettexe Please upload a minimal reproduction project to make this easier to troubleshoot. |
Guessing from previous contributors chat discussions, should Animated Texture be marked as deprecated? @reduz |
Reduz wanted to nuke it next time which would be unfortunate, if it can't be overhauled to work properly. Due of the implementation of AnimatedTexture (which I did not touch in #65188) I noticed a silly flaw. Whenever you tab out, AnimatedTexture stops "ticking". Wait for enough time where the next frame should've arrived, but it does not. Then you tab in, and the next frame switches instantly. This makes perfect sense in theory, as a result of its implementation. Every rendered frame that passes, AnimatedTexture checks if enough time has passed, to switch to the next frame. That is it. It does not skip any additional frames depending on how much time has actually passed, only one per frame. This can also theoretically make the timings of an AnimatedTexture inconsistent with very variable framerates. The "frame jumping" could be fixed by having the current frame be based on a constant "timeline" that loops consistently. It's not easy, but it is definitely doable (I'd gladly do it, for one). It may even be more optimised than it currently is. |
Updated the original post with a minimal repro, easiest way to see the issue is to minimize the running game for a couple minutes then come back to it. The longer you wait the longer it takes for the Animation to restart. |
@Mickeon So should AnimatedTexture get the "is_experimental" flag perhaps, then? |
"Deprecated" sounds more suitable. A shame, however. |
I don't know where the conversation for deprecating AnimatedTexture is happening, but I found it useful to use in TextureRects to have GUI with simple animations looping. It was much cleaner than mixing Controls with Node2Ds, and also easy to make them responsive. I don't know if this is a use case that is common enough to "save" this resource from being deprecated, but it was a pretty neat use case that I don't know if there is an easy alternative to it. |
In Godot 4.0.2 AnimatedTexture on a Sprite works for me fine when I run the scene, but in the Editor it seems to "stutter". When I tab focus between the Editor and other running software, it stops completely (in the editor, when I run the project it runs fine). Since it is a resource which is has the same broad spectrum of application as a regular texture, and is very simple an easy to use, it would be a loss to depreciate it without adequate replacement. If we could something like SpriteFrames instead as a animated texture, that would be cool. |
The editor is capped to 10 FPS when unfocused by default. Adjust Unfocused Low Processor Mode Sleep Usec in the editor settings to change this. |
That's not the issue I'm talking about @Calinou |
sometimes this happens to me too... sometimes it stops to play and only plays if something makes the screen updates, like, if anything get focus like a button or option |
This is because of low-processor usage mode – AnimatedTextures don't force continuous redrawing. This is a bug, but I don't know if it can be fixed given how AnimatedTextures work. |
I turn it on and test and turn it off again: same thing... but at least works in the game... the crazy thing is that works in 3.5.2 with no problem... with the same configs (when applicable) used in 4.0.2 |
Godot version
Godot 4 Beta 6
System information
Windows 10, Vulkan, NVIDIA GeForce RTX 2080 Ti (527.37)
Issue description
After leaving the game running in the background for a while the animated textures seem to stop completely most of the time but sometimes they are only stopped for a moment then speed up to seemingly catch up.
Steps to reproduce
Put Sprite2D with an animated texture as the texture
Launch game and leave it in the background
Eventually it will either desync or stop the animations completely
Minimal reproduction project
minimal-reproduction.zip
The text was updated successfully, but these errors were encountered: