Armature Optimization

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
RonnieNeeley
Posts: 13
Joined: Sat Apr 05, 2014 3:41 am

Armature Optimization

Post by RonnieNeeley »

Hey all,

I've got a character rigged with 73 bones total. Most of these are "controlling" bones to assist in animation (IK bones, etc etc). Most of bones are in the hand (each finger has 4 bones, the thumbs have 3).

I'm making an FPS which is set to have 8 v 8 players max. Currently, when we add 4 characters to the game, it starts to get laggy. While there are many ways we can alleviate this, the programmer is going after my rig first, wanting to cut down on the bones. His main concern is the foot rig, which coincidentally, is the most handy rig on the model, as it allows for realistic and easy feet/leg animations. [NOTE: Yes, we also know vertex count is an issue, so no need to mention that.]

My question is, are bones really that huge of an issue? Should this be our main concern when it comes to try to cut down on load time/lag?

The programmer said any issues with this (characters causing lag) are my own, however all we've got is a model and basic bow and arrow setup. The rig isn't fancy or anything, there aren't any controlling bones for the arms or hands or anything, just the feet/legs. Once we start adding more detail, this will only get worse, and there's only so many bones I can remove before things get ridiculous (especially when I'm the one who's having to suffer from not having these controlling bones, because I'm doing the animations).

He ran some tests:

With the map and 8 players (with bows) being rendered (without the foot rig), it takes 54ms. With the foot rig, it's 62ms. So if I remove the nice foot rig, we save 8ms, however that adds a lot more time, frustration, and unsavory results when it comes to animation. He said the goal is to get it below 16ms (so of course, the rig alone won't alleviate this. Also keep in mind, this is basic stuff so far, just 8 dummy characters standing around, not actual players doing things and FX going on).

So yeah, just figured I'd bring this up here to get input. Is there any way to not take certain bones into account in Irrlicht? The program doesn't actually need to be aware of the IK bones and that, considering they're not actually deforming the mesh / just used for animation purposes in Blender.

I've not seen any online FPS games made with Irrlicht so I'm not sure how many others have run into this issue (needing up to 16 rigged humans together in an area).

Thanks! Hoping to get some input on this. Just wondering if perhaps my rig is infact indulgent, and/or if there's anything we can do about it other than remove (genuinely useful) bones.

Note: We're a 2 man team (him on programming, me on everything else), so I have a lot of other duties than animating walk cycles, hence wanting to keep these bones in.

Also, any other optimization tips are welcome!
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Armature Optimization

Post by The_Glitch »

This all depends. You need to optimize where ever you can. You need to also consider the characters poly count that of your enviorment and textures ect. So in the end Im just saying depends on what your trying to do.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Armature Optimization

Post by mongoose7 »

The actual bone count shouldn't matter. But every vertex is affected by some bone(s) and it really doesn't matter which ones. Though keeping the count of bones per vertex to one or two instead of four should give you a proportionate speed up. However, you should easily meet your target if you perform the skinning in the shader. There is a limit on bones in this case, something short of 70, say 50. But you could bypass the limit with effort. Look at Example 29 in the shader pipeline.
RonnieNeeley
Posts: 13
Joined: Sat Apr 05, 2014 3:41 am

Re: Armature Optimization

Post by RonnieNeeley »

Thanks for the input everyone. Just decided to go with a far lower poly mesh and all is well.
Post Reply