-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
AnimationBlendTree performance issue #65199
Comments
Fire, I am uploading a test project, all the animations and the test model are done by me, so they are royalty free for Godot, plus if anyone buys my game in the future the game assets are easily exctractable so I am not worried about them, and honestly mixamo has better animations than me 🌜 , Running this test project I get to ~5 fps, the characters were duplicated using In my game I plan to have 20 to 30 characters at the same time, mind you not all of them would be human, which might be the most expensible characters in the game, more if possible would be also great, so having this perfomance with only 5-6, I will need to explore alternatives to improve it. My current workflow for this project is to have the rig separated from the characters, this is done exporting a animation rig from blender, with all it's animations in the NLA, and a linked duplicated rig with no animations in the NLA used to hold the skinning information for any meshes, this way in Godot I import the .gltf mesh and change the skeleton to the one that has all animations. This allows me to group assets into separate .gltf files, which helps managing assets from blender, TokageItLab, the One of the optmizations I plan to work on is to reduce the amount of oneshots I have using transition nodes to group them, this in theory should reduce the amount of inactive one shots mixed in the tree, and maybe I can work something out with the blend nodes as well, Another idea I tried was to edit the tree_root nodes itself, reusing the same structure, swapping animations using gdscript, but this requires each tree_root to be unique or changing one tree_root node all character using that tree_root would also change that animation node, so in theory this can also work with a specialized small tree unique for the player, if the player needs way more animations than npcs, |
For animation, we already have the following three plans for optimization:
Footnotes
|
So I re-worked the animation tree to a new system, project file below, using fewer nodes whenever possible to achieve the same result as my previous prototype, here's how the second prototype animation tree looks: This new system looses a lot of blending which I had in my previous test, but it's easier to work with, I thought this system would improve the perfomance because transitions nodes should be easier to optmize, seems it's not the case, running the new prototype it behaved identical to the other, about ~5-6 fps, |
Originally posted by @JoanPotatoes2021 in #53752 (comment)
I am facing breaking perfomance loss if I use physics in process_callback of animation tree, which I wanted because I wanted to have a constant root_motion velocity despite the fps, which points to this issue.
However I didn't wanted to spam another issue because it might be related to alpha perfomance? I didn't saw anything about optmizing animation trees or perfomance issues related to animations though, here's a gif showing my problem,
-note that gif was rendered to 20 fps
I might not be using animation trees correctly, but this seems how it was supposed to work? Here's how is structured, it was designed for a third person shooter. I saw this type of animation tree being done for other projects, is it that costly to blend multiple animations? I am a little worried to be honest,
Why I am getting so much perfomance loss setting the process callback to physics? I would expect just like Calinou pointed out, to limit the update rate of the animations,
That gif was on an complete empty project, my skeleton have 107 bones, the tree is very complex and I have a lot of animations but by no means should it drop so low, something's going on. On my full project it drops from 240 fps to ~5-20 fps with just 5 characters with meshs and this very same animation tree and skeleton.
REF
v4.0.alpha15.official [432b25d]
Windows 10, Nvidia Geforce GTX 1050 TI, Vulkan
The text was updated successfully, but these errors were encountered: