Hi!
I come to you for optimization questions.
To explain the situation quickly, for a project we are working on with friends, we need a crowd of different characters with as much variety as possible. We would like to have quite a few different types of skins (all "humanoid" but with notable differences, some have long hair, others don't, some have their hair tied back etc.) And then over these Basic Skins, objects that would give even more variety to the whole. (Different pairs of glasses, different caps in front and back, different hats, etc.). But also, different objects held with the possibility that each object needs an "animation" that is linked to it (holding a sword is not the same as holding a lantern or a box) And each of these Skins will have to be able to work with all the animations that we'll need. (Idle, Race etc.)
So, for this purpose and following this post Animations synchro in the previews and in the engine I reviewed my approach and used skins instead of animations and took into account all the possibilities of skins in my skeleton. And since I'm going to need a lot of skins, in order to avoid having to redo each skin at the slightest modification and since apparently it was the best "approach" I found to manage this multitude of different skins, I also made a "Placeholder" skin with all the possible variations, that I duplicate to create other skins, removing what's unnecessary for the new Skin.
This method has the big advantage of having everything in one skeleton and therefore easily being able to switch from one to the other and to display or not what we want to display.
That makes us about 80 bones on the character, which is a lot for the size of the character, but it didn't seem like a problem at first sight, because I've already done a lot more with no performance concerns. Yes except that... As explained in this post: Need advice on how to improve performances we sometimes have up to 300 of these characters displayed at the same time on the screen and there, we have a performance problem.
So, from what I understand, I'm going to have to redo all the animations and change the logic I had applied. And to do it again, tell me if I'm wrong, but I'm going to have to:
1- Apparently reducing the number of bones could have a big impact on performance, so I know I'll already be able to remove about twenty bones on the skeleton, or even a little more (we'll lose a little bit of quality, but at the size where we're going to see the characters, it won't make much difference).
2- Apparently, mesh modification is also quite heavy in this kind of case, so maybe reduce the number of images modified per mesh.
But then I wonder what should be done to improve performance even more in this case :
Even if I reduce the number of bones, there will still be a lot of "unused" bones on all skins. And so of the lost "performance" I think, right?
I don't know if IKs also weigh their weight in this case, or if it's not a problem.
We wonder with my Dev, if there is a way to divide the different additional "parts" into several skeletons and that in code, he can take these "parts" of the skeleton and "attach" them to others, while making sure that all the anims work and that each skeleton influences the others well (For example, we could have a basic skeleton with just "Body + arm + Leg + Head" and above, in code, if necessary, add the necessary parts to the selected skin. For example, "to make a character with long hair and a cap in the back, you activate the skeletons for these two characteristics and you don't activate the others. ». This would further reduce the number of bones used and therefore improve performance.)
What your thought on this? And maybe you have an idea of a totally different workflow that will work well for this case.
Thanks!