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

AnimationTrees' progress with Ping-pong loop are corrupted when there are multiple instantiated same AnimationTrees on the scene #100018

Closed
mrjustaguy opened this issue Dec 4, 2024 · 4 comments · Fixed by #100039

Comments

@mrjustaguy
Copy link
Contributor

mrjustaguy commented Dec 4, 2024

Tested versions

Reproduced on 4.4 dev 5 and 4.3 Stable

System information

Godot v4.4.dev5 - Windows 10.0.22631 - Single-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 32.0.12019.1028) - Intel(R) Core(TM) i3-10105F CPU @ 3.70GHz (8 threads)

Issue description

Animation pace is inconsistent, and at times just goes to hell.

The first video showcases the animation pace inconsistency

unknown_2024.12.04-17.17.mp4

The second video I've also seen happen in the MRP at times, but only have a video of it happening in my game dummy scene, Observe Walk Calm in animation tree not completely bouncing going between 0 and 1, also at the start it may feel stuttery, but that's because it's a 30 fps video of a 60hz setup, and it's actually not visible but the animation was very aggressively switching back and forth from frame to frame

unknown_2024.12.04-15.48.mp4

Steps to reproduce

Inconsistent behavior, with no good steps to reproduce found yet beyond it seeming like it has something to do with the Transition node in Animation Tree. Animation Player animation runs smoothly consistently. the MRP at times may or may not produce the broken results.

Minimal reproduction project (MRP)

Bug.zip

@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2024

Since the issue description seems to be mixed-up the matters, let's separate them:


1. If there is more than one AnimationTree, each one is misaligned

This is not a bug. It is the intended behavior because each AnimationTree is getting a different delta. If you want to process the same fixed delta in all AnimationTrees, set CallbackModeProcess to Physics and this problem will not occur

Image

Alternatively, you can get the delta from the root node of the scene and proceed manually with passing it into AnimationTree.advance(delta) and setting CallbackModeProcess to Manual,

2. The AnimationTree progression is broken “when opening the AnimationTreeEditor”

This is definitely a bug. However, it is a bug only in the editor. Perhaps, as with #22887, there is a confusion of pointers for what is passed to the editor


So the former is not a bug, only the latter needs to be fixed. And in any case, AnimationNodeTransiton is never relevant.

@TokageItLab TokageItLab changed the title Animation Tree Transition is absolutely broken AnimationTreeEditor will corrupt the AnimationTrees' progress when there are multiple instantiated same AnimationTrees on the scene Dec 5, 2024
@TokageItLab TokageItLab added this to the 4.x milestone Dec 5, 2024
@TokageItLab TokageItLab moved this to Work in progress in Animation Team Issue Triage Dec 5, 2024
@TokageItLab TokageItLab added the bug label Dec 5, 2024
@TokageItLab TokageItLab changed the title AnimationTreeEditor will corrupt the AnimationTrees' progress when there are multiple instantiated same AnimationTrees on the scene AnimationTreeEditor corrupt the AnimationTrees' progress when there are multiple instantiated same AnimationTrees on the scene Dec 5, 2024
@mrjustaguy
Copy link
Contributor Author

mrjustaguy commented Dec 5, 2024

The problem does occur with callback on Physics on all animationtrees, so 1. is also broken

unknown_2024.12.05-06.20.mp4

Edit: Nvm, seems something went wrong during setting up that messed up the sync internally, restarting the scene and it's not happening anymore.

@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2024

Yes, synchronization loss during setup is also a known problem of the editor, so you can make a separate issue or proposal as an Enhancement; Like detecting a synchronization change and setting the active property of the associated AnimationTree in the scene once to false and then to true again.

@fire fire moved this to Work in progress in Animation Team Issue Triage Dec 5, 2024
@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2024

The following MRPs confirm that the latter problem (pointer-confusion) occurs outside the editor.

at-bug.zip

In conclusion, simply the backward flag is not parameterized and each AnimationTree access the same reference. Therefore, this problem should be specific to ping-pong.

@TokageItLab TokageItLab modified the milestones: 4.x, 4.4 Dec 5, 2024
@TokageItLab TokageItLab changed the title AnimationTreeEditor corrupt the AnimationTrees' progress when there are multiple instantiated same AnimationTrees on the scene AnimationTrees' progress wiht Ping-pong loop when there are multiple instantiated same AnimationTrees on the scene Dec 5, 2024
@TokageItLab TokageItLab changed the title AnimationTrees' progress wiht Ping-pong loop when there are multiple instantiated same AnimationTrees on the scene AnimationTrees' progress with Ping-pong loop when there are multiple instantiated same AnimationTrees on the scene Dec 5, 2024
@TokageItLab TokageItLab changed the title AnimationTrees' progress with Ping-pong loop when there are multiple instantiated same AnimationTrees on the scene AnimationTrees' progress with Ping-pong loop are corrupted when there are multiple instantiated same AnimationTrees on the scene Dec 5, 2024
@github-project-automation github-project-automation bot moved this from Work in progress to Done in Animation Team Issue Triage Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants