Bones versus Everything (perf test)

Hey there,

I can’t manage to find the final answer here :
Some people say that you can have a large number of bones without impacting perfs, some others say to reduce to an extent ?

Logically, I’d believe they’re not that impacting, as just every transform modifier, but I sense a doubt behind this.

Say, with like 66 bones per character onscreen x 2 (fighting game), so 122 bones total, would it be bad ? Would reducing it to 60 bones dramatically boost global perfs ?

I’ll make tests tonight, but as bones number is very impacting on the animation workflow, complete performances knowledge about it is very important from the start.

Thank you for your precious attention pals,
Regards

The more bones you have, the more calculations have to be done, so generally you want to have the fewest possible. Of course, that depends on what you’re doing exactly…if your game has just one character in it, you can have more bones. If you have several characters, then you want to go for the bare minimum.

–Eric

You’re just gonna have to test and see - for a 1 on 1 fighting game you might be able to get away with it, but 60 bones sounds excessive anyway.

  • 4 per leg (hip, knee, ankle, ball of foot)
  • 4 per arm (clavicle, shoulder, elbow, wrist)
  • 3-4 in your spine, from root to neck
  • 1-2 in your neck, 1 for the head
  • X for hair, cloth, extras

Obviously you can have an articulated humanoid with as little as 20-25 bones, so I wonder how you’re doubling that figure. Do you have fully articulated fingers/faces? There’s a reason nobody did that in the N64 days.

I’d like to take this opportunity though to dispell some possible misconceptions about bones and their impact on performance. The exact effect has WAY more to do with how many verts are being manipulated per bone than the actual bone count. The actual performance hit comes not from the presence of a bone, but from the computation of the vertex deformation. So a bone that is softly deforming a hundred verts with a gradual influence falloff is WAY more expensive than a bone that’s just moving a half a dozen verts with zero falloff. Furthermore, a bone costs nothing unless its actually DOING something, so if you did have a character’s face articulated, it shouldn’t actually have any performance impact unless its animating at the moment.

Just as an example, Zombieville USA uses an array of textured planes bound to bones for its various particle effects (blood, brains, etc). They are considered one draw call as a result, since they’re just a single mesh, and the bones are animated via code. When these ‘particles’ aren’t in use, I simply move the unused particles off screen until they’re needed again - but my pool of potential particles includes over 100 pieces. Parts of the UI (such as the ammo counter and cash display) are achieved in a similar fashion, so essentially I have maybe 200 bones hanging around at all times, but they only effect performance while they’re being animated.

Thank you guys for your contribution !

Ok a little explanation on my high number of bones :

  • it’s a fighting game, 1 on 1, no more animated chars.
  • The background is like the first Tekken, just a scrolling bitmap. Action is focused on the fight.
  • There will only be 2 lights and a few 2D effects (various impact effects)
  • the GUI will have 4 buttons, 1 crosspad, 2 healthbars, and combo typos (I know it’s a lot, but I got tricks in the hat to manage fight visibility)

So yes, there won’t be very much to display.

Now the hierarchy of one char :

head (+mouth, eye direction x 2, eyelids x 2), neck, {shoulder, arm, forearm, palm, 5 fully articulated fingers, hip, leg, tibia, foot, foot_top} x 2, torso, belly.

Yes, there are finger bones, because Lego guys did never fight very spectacularly :slight_smile:

And for a fighting game not to be “just another fighting game”, you have to be spectacular, have multiple fight styles body positions, which I believe is not possible with less bones.

So if it’s possible, I’ll try to make it. But I’ll be more careful after what you wrote, and I thank you for that.

And there’s another fact to be considered : I believe this game would be ok to launch by this Christmas, which will be approximately synchronized with the next iPhone gen.

Well I’ll keep your advices in mind anyway, and won’t jump straight into a rush before having made several tests on my iPhone.

On a sidenote, congratulations for Zombieville USA, it’s looking greatly addictive, truly :slight_smile:

Sidenote : I posted this picture of one of my game model in another thread, but it could help to understand that bone hierarchy I’m talking about.

Really, I couldn’t see less bones :frowning:

Looking good.

When you find out on how bones effect performance please let us all know, I can’t test it myself since I do not have unity and an apple developer account yet.

I would ditch the 5 fully articulated fingers and just use a few bones for the whole hand. You will not notice such small details on a 3.5" screen, and that’s a lot of bones to be using on something like that. Look at games from 10 year ago…generally they were using some limited texture animation for faces (if they were animated at all, which they frequently weren’t), and not actually using a bunch of bones for the eyes, mouth, etc. And hardware from 10 years ago is approximately what your target is here.

–Eric

Oy, I had a PAINFUL experience wrt bones. Our character started with 44 bones and failed MISERABLY when we had 2 characters on screen. Even one just walking was chunking and we had optimized everything else (fx, tris @ 600 for char, draws @ 15 for environment, etc).

Simon would probably be your best bet for input as his snowboard guy is probably the most animated full character I can think of.

Our character ended up going from 44–>10 bones. Yup, 10. Animator dreamora gave me that advice and it was excellent. His fist is always a fist, etc. You will certainly need to make similar hard choices, I guarantee it. Better to make these now than later…

Another option is to articulate the thumb and index, and then group your middle/ring/pinky together under one bone. They won’t be able to splay, but you’ll be able to curl them all together, and still have your hands capable of many shapes (pointing, grasping, etc.), saving yourself 6 bones per hand. I think the gain could be pretty substantial, and your hands on that model are so small that its quite wasteful to burn 15 bones a piece on them. Same thing with eyelids… do you need to be able to see your character blink during the fight? Her eyeballs would probably be 3 pixels tall. If you want to have facial control for pre and post fight closeups, swap to a different model for that - all it’ll do during the fight is waste resources. You probably don’t need lower lid animation at all too - when people blink its 80% upper lid movement anyway.

Just trying to give you some ideas on where you can make compromises, cus I have my doubts that model is going to fly on iPhone (but you should definitely do your own tests first).

Thank you guys for your precious advices and your feedback (damn … 10 bones ?? :cry: ), I’ll do some tests this week end, and let you know of course. If it fails, I’ll cut the number of bones.

I don’t know how the iphone would handle such things but you could make some stock head meshes with 3-4 different expressions and tell the game to swap them around, or use a seperate texture for the head with some different painted face poses on like screaming, hurt, smile, happy etc.

Dynamic mesh swapping would be too MemBandwith charging, I think.

But texture swapping is the solution I was thinking about if I had to cutoff global mesh quality :slight_smile:

Tekken 1 did that.

About it, I had a look at Tekken 1 screenshots yesterday, and oh my god, it’s hugely ugly …

iPhone can handle much better graphics imho.


sidenote : I’ve done a live test on my iPhone, the scene have 8k tris, 60+ bones, and animation plays fluidly. I’m full of hope. Keep you in touch when I achieved 2 chars.

Ok, I will post a screenshot this week end, but I come with 15 fps on the iPhone with 2 instances of this girl.

8k tris, 17 draw calls, 120 bones.

With a little mesh optimization, I’m sure I can hit 30 fps with a nice quality.

Full of hope I am. :slight_smile:

go go go little screenshot !

Well there are artifacts, but I don’t care for now :slight_smile:

precision : the 2 models are contantly rotating + looping on a 5 frames animation.

(the number is the fps)

122226--4598--$ss_eimpact_829.jpg

So my guess is that the governing number is the total number of non-zero bone-to-vertex weights rather than the total number of bones. What would be the count of that in your fighting girls?

There is simply no “dead vertex” :slight_smile:
Every single vertex got a bone and a weight.
Furthermore, ~40% of the vertices have 2 bones on it.

I didn’t expect such good results, to be honest.

edit : wait a minute, I just rechecked, the tris and vertices are much higher in fact …
There is a total of 16k tris, and 32k verts.

Just to let you know that this is possible :

I managed to hit a stable 30 fps with 2 chars, by reducing polys to 800 ~ 1000 per char.

123970--4642--$ss_eimpact2_480.jpg

so 2000 triangles per character right? fully rigged still? that is impressive for the iPhone which is slower then the 2nd gen touch :o

I know you said your BG’s will be tekken like but once you get the code in there too I would not be suprised in the framerate dropping again, but i’ll love to see you do well with a visually good looking fighter :slight_smile:

Yeah I can’t wait to see the whole package too :wink:

I keep realistic views about the final framerate, which would be ~25. If it is less, some solutions will be applied, even if it has to lower global visual quality.

Actually this woman is more around 800 polys, and so are the other fighter models.
Some will be much lower, but will have some physics effects on clothes :wink:

Yes you’re right, it’s really impressive to see such a preformance for that old technology.

I think this is a good point for Unity. Some people in the gossip forums keep saying the graphic perfs are bad, here is the proof they’re not.