Game Development Community

Many bones = performance hit?

by Nmuta Jones · in Artist Corner · 11/12/2005 (1:11 am) · 10 replies

I have a character with about 20 extensions attached to the head (think: Medusa)

Each of the 20 hair extensions has it's own bone structure...about 4 bones each. So we're talking 80 bones attached to the head. I am animating all of them in Max so that they all just kind of slightly move around for during each of the dsq animations.

I didn't think that this would pose much of a performance hit to the engine, since the bones are not controlled in real time....its just an animation. But am I wrong? Is there a performance issue I need to be thinking about here ?

#1
11/12/2005 (3:24 am)
A lot of bones will decrease performance, yes (probably more than it should too but unless you feel like going in and optimizing the animation code there's not that much that can be done about it). That said, I do have some models with roughly 80 bones that seem to work okay.
#2
11/12/2005 (4:38 am)
Adding anything usually decreases performance. it's just a matter of how much? going from 30 bones to ~80 bones may not even be noticable. I can't say. my characters run like 70 bones and i can't really can't tell. I guess the best thing you can do... is make your model, export it. check FPS, then play the animation. see if that does anything. also you can export a boneless version to check too.
#3
11/12/2005 (5:36 am)
I'll just go ahead with it then and I'll post Frames Per Second results here. Mind you its more than 80 bones..... there are 80 bones attached to the head alone, plus all the regular skeleton bones for the body. But I may do some hair locks with 3 bones and some with 4 to optimize things a bit.
#4
11/12/2005 (7:43 am)
80, 90, 100, whatever. My point was that I haven't seen any HUGE difference between my regular models having roughly 30 bones to one having about 80. It's slower, but it doesn't seem too bad. (haven't done any actual messuring though).

(you _really_ don't want to see my control rigs for the 80 bone models though by the way... the max files have over 200 various objects and dummies in them, hehe, messy as hell to work with).
#5
11/12/2005 (9:46 am)
It also depends on how many vertices those bones are moving, and how the vertex weighting is spread since normaly any vertex animation with bones is handled by the CPU. So your going to have to try the same thing on different CPU systems to get an idea of the real performance hit.

I'm not sure if you have agame for your character, you didn't say. But thats also going to take a nice chunk of CPU once you have gameplay, collisions, physics, AI and whatever to fight with.
#6
11/12/2005 (10:12 am)
Yes, I have a TGE game in process, I do have some simple AI for four enemies, and plan to have some vehicle physics on the last level.
#7
11/12/2005 (10:17 am)
Idea you could have two bones one could control some hairs and another could control the other half if you had the halfs mixed together you could do it with less bones. If half and half didn't look good you could try quarters.
#8
11/12/2005 (11:14 am)
Treb

Funny you mentioned that....that's why I ended up deciding on. I ended up using only 21 bones, instead of 80. each bone controls several locks. It looks fine and 20 extra bones doesn't seem like it would be that much of a noticeable hit. I'm already 60% done of rigging it up and it looks OK.

Thanks..
#9
11/12/2005 (3:11 pm)
Came in late on this one, but yes, more bones will decrease performance, as will many verts per bone. One of the reasons we don't use hardware accelerated skinning (and occasionally take heat for it) is because it limits the number of verts per bone. Weighting a vertex by many bones will increase the calculations that need to be done on each vertex to get it's correct position.

At some point I'd like to have skinning done in a vertex shader, or do a re-pass on this so it was brought up to recent tech. I should actually say, "I would like to see it done," so that way I don't have to do it ;)
#10
11/12/2005 (7:39 pm)
I'm not weighting these particular vertices by more than one bone in most cases. But I can certainly undertand why it will affect performance.

My favorite quote regarding this type of stuff is from Paul Catanese in "Director's 3rd Dimension" where he writes:
Quote:
EVERYTHING is a performance hit.

I find that to be true...if there's certain things you don't see much of in PC games often there's a reason for it...and 20 different locks swinging around on a character is one of them.

Pat, Thanks for the tips about the number of vertices per bone and weighting, etc. My solution to the probem is pretty conservative for the reasons you and others listed.