Skip to content

Optimize AnimationTree, Improve internals & Editor & Node::process_thread_group safety#117277

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
Ryan-000:ryan-opt-tree
Mar 14, 2026
Merged

Optimize AnimationTree, Improve internals & Editor & Node::process_thread_group safety#117277
akien-mga merged 1 commit into
godotengine:masterfrom
Ryan-000:ryan-opt-tree

Conversation

@Ryan-000
Copy link
Copy Markdown
Contributor

@Ryan-000 Ryan-000 commented Mar 10, 2026

Supersedes #113444

Related #116394 #112308 #110474

Benchmark

Compiled with scons production=yes debug_symbols=yes target=editor
Ran with ./engine_binary --headless --print-fps --path /path/to/project res://path_to_world.tscn
Project: optimize.zip


Scene: res://World.tscn

Before: (a1eaac8)

FPS: high 227, low 223, median 224.5
MSPF: high 4.48, low 4.40, median 4.45

After: (ac1c551294f64f60dda5b2b7fc95335666189e2c)

FPS: high 342, low 333, median 338
MSPF: high 3.00, low 2.92, median 2.95

median FPS change: +113.5 (+50.56%)
median MSPF change: -1.50 (-33.71%)


Scene: res://World_StressTest.tscn

Before: (a1eaac8)

FPS: high 110, low 103, median 105
MSPF: high 9.70, low 9.09, median 9.52

After: (ac1c551294f64f60dda5b2b7fc95335666189e2c)

FPS: high 127, low 118, median 126
MSPF: high 8.47, low 7.87, median 7.93

median FPS change: +21 (+20.00%)
median MSPF change: -1.59 (-16.70%)

Bugsquad edited:

@Ryan-000 Ryan-000 requested review from a team as code owners March 10, 2026 03:35
@TokageItLab TokageItLab added this to the 4.x milestone Mar 10, 2026
@Ryan-000 Ryan-000 force-pushed the ryan-opt-tree branch 2 times, most recently from a3085e2 to a06b90d Compare March 10, 2026 03:45
Comment thread scene/animation/animation_node_extension.cpp
Comment thread scene/animation/animation_blend_tree.h Outdated
Comment thread scene/animation/animation_blend_tree.h Outdated
Comment thread scene/animation/animation_blend_space_2d.h Outdated
Comment thread scene/animation/animation_blend_space_1d.h Outdated
@Mike-Litton
Copy link
Copy Markdown

Mike-Litton commented Mar 11, 2026

This looks very impressive. Is it something I could cherrypick into 4.6.1 to solve some animation performance problems I have been having?

@Ryan-000
Copy link
Copy Markdown
Contributor Author

Ryan-000 commented Mar 11, 2026

This looks very impressive. Is it something I could cherrypick into 4.6.1 to solve some animation performance problems I have been having?

The PR is based off this commit a1eaac8, so I think you would need a 4.7 build to get it to work.

If you get a chance to test it there, it would be helpful if you could let us know whether you run into any issues.

@Mike-Litton
Copy link
Copy Markdown

This looks very impressive. Is it something I could cherrypick into 4.6.1 to solve some animation performance problems I have been having?

The PR is based off this commit a1eaac8, so I think you would need a 4.7 build to get it to work.

If you get a chance to test it there, it would be helpful if you could let us know whether you run into any issues.

Which are the commits I should get so that it is applicable to 4.6? I want this into my production game that releases soon.

@Ryan-000 Ryan-000 force-pushed the ryan-opt-tree branch 2 times, most recently from 609326b to 16c6dd9 Compare March 12, 2026 23:33
Comment thread scene/gui/graph_edit.h Outdated
Apply suggestions from code review

Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-Authored-By: Silc Lizard (Tokage) Renew <tokage.it.lab@gmail.com>
Copy link
Copy Markdown
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although there are many lines of changes, most of them are actually changes to arguments. Since consensus on these changes was already reached in #112308 (review) before this PR was split off, this should not be a problem.

I encountered an issue where results were broken when filters were complex (for example, this MRP state shouldn't be processed but it is not so), but since this behavior is unchanged from before, I consider that it is no problem as an optimization PR. See also #89726.

BTW, regarding filtering, there was already a proposal to turn it into a resource like #76788, so I believe that not only will fixes for complex cases be needed, but a large-scale rework will also be necessary at some point.

I also found a bug where the read-only state in BlendTreeEditor is broken, but this PR is unrelated to that as well.

I recommend merging this PR at early stage of dev so that many people can test them to ensure there are no issues.

@TokageItLab TokageItLab modified the milestones: 4.x, 4.7 Mar 14, 2026
@akien-mga akien-mga merged commit 96436e3 into godotengine:master Mar 14, 2026
20 checks passed
@akien-mga
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors when switching animations while in Capture blend mode in BlendSpace1D and BlendSpace2D

6 participants