As I studied more about animating characters in 3D, I have pondered about the performance of multiple 3D animated rigged character models.
For example, at 5:11:10 in https://www.youtube.com/watch?v=GoJsl7HmWnc . At that timestamp, as the player on the horse start moving toward a huge army, we can see from afar that all those enemies simply stay still and do not move at all. They become active only when you are close enough. Certainly, this is no different than objects culling for objects far away.
But since that game is not made in Godot, has anyone done something like this in Godot? If I am to have an army of characters like that, normally how is Godot’s performance and are there any optimization tricks that I should be aware of for Godot?
you can get over 50 animated characters on screen at the same time, it depends on the pc.
godot doesn’t do skeleton 3D culling, if you can code the AnimationPlayers of each unit to become disabled when off screen or distant enough, that improves performance a lot, I managed to get over 200 units.
now, with culling there are limitations, root motion can not be used because the units would stop moving when the AnimationPlayer becomes disabled.
Also, AnimationTree uses a lot of resources, so you have to use AnimationPlayer only and manually set the animation.
but I did these tests around 4.2-4.3, maybe it’s better now?
and while there seems to be a lot of units in that video, I’m count around 50 max.
using fewer bones could also help.
I haven’t tested whether the problem is with CPU, or sending data to the GPU and don’t know enough about how animation works in godot, but that’s what I tested about 2 years ago.
As far as I know, this has not been done in Godot. There are many incidental conditions: how many polygons and what textures a single model has, how many characters there are, how complex the animation is. Only practical experimentation can provide an answer.
ryzen 5 2400g and integrated GPU. I’m sure a modern pc can do much better.
so, it is 4.2, so before a lot of optimizations.
Looking at it I remembered that I didn’t use any physics, instead I used servers to do a raycast on a terrain to move the units, and they didn’t have collision, only an Area3D for selection.
I’m not sure but I think it’s more CPU than GPU, you’ll have to do your own tests.
What I can tell you is, it runs at 36 fps with almost 300 units, so 50-100 would be safe, enough for a small crowd like dinasty warriors.