How to save performance with animations?

Hey there,
I have tested some things like 2 same animals, one with 20 bones, another with 40 bones, but both have the same performance.
Then I have tested with removing bones from LODs, also no change in performance…

The only thing which saves performance is to hide the skeletal and show a static mesh.
With Static Meshes I can have about 4x the amount of skeletals with same performance^^

How do you save performance with skeletals and/or animations?

There are many factors here…

First not all bones have the same cost. The further along a chain the bone is, the more expensive it will be. Because to get to it you have to calculate all of the parent transforms even if they don’t do anything. Fingertips for example would be more expensive then the spine.

Second while there maybe be 80 to 100 bones in a character there are going to be 40,000 to 80,000 vertices most of which need to weighted 2 or 3 or 4 bones, so really who even cares about optimizing bones. Your LODs should focus on optimizing vertex count and restrict number of bone influences per vertex for optimal performance gains. Which is not to say that bone count does not matter, it does but it is a secondary consideration.

What’s more the thing that will really beat you down is the number of drawcalls unless you have Vulkan but thats not so common yet. If your character has a 5 or 6 materials applied to it and its carrying a weapon with another 3 or 4 materials. Then placing 100 characters in the scene will result in 1000+ drawcalls … good luck with that. Each material’s complexity will also play a part in the overall cost.

Lastly your example of 4x Static Meshes vs Skeletal meshes. If you use Instanced static meshes you should be able to stuff the scene with far far more than 4x skeletal meshes at the same performance cost.

I am having some problems too with my setup. I have a character with about 20 materials but by itself it doesn’t drag down FPS at all. However I gave into the temptation of making a highly complex animation BP with sub-BPs and a lot of mixing, blending and bone transfers and that really drags down FPS notably as soon as I activate that BP. I am currently working on another solution with multiple but simpler BPs that are exchanged on the character depending on the context. I am not done yet so I can’t report whether it helped or not but what I know for sure is that a highly complex animation BP can be a speed killer.

You could try converting your Anim Blueprints to C++ only. Use a custom UAnimInstance and inherit your AnimBlueprint from it. Then you can have an empty EventGraph (moved to C++) and just use the anim blueprint for the AnimGraph and customization of properties.

What if I have 5 or 6 materials on the character and 2-3 on the weapon, but all materials have no texture, because the meshes got colored by faces?
https://www.instagram.com/p/BrkEuGlH9XY

I have no idea how many I can have for true, in the first test with skeletals I had about 150 enemies on screen at 60fps and with static meshes 600 enemies^^
With 1000 enemies I had with skeletals about 12fps and with static meshes about 30fps…
But this was on beginning of development, now I have never tested for a long time.

Did anyone test if skinning can create performance drops? For example, if the bone influences more than 4 vertex?