Home Technical Talk

Rigging for realtime meshes

polycounter lvl 18
Offline / Send Message
JKMakowka polycounter lvl 18
So I finally decided to update my knowledge about animating non vertex baked meshes (I know I am late smile.gif ).

Thus I decided to have a look at the rigs from various id tech 4 based games (on the left prey, on the right doom3):
kneerig.jpg

What I don't quite get are those "intermediate" bones, which do not seem to have any real function, as the way it is set up (at least after import in Blender) still allows only for one point of rotation.
In addition to that it seems strange that
in Prey (and Quake4) those "intermediate" bones are also in such a strange angle to the overall leg (as opposed to the Doom3 rig where they are in the same direction).

And isn't it desirable to have as little bones as possible if the rig is manipulated in realtime (e.g. ragdolls)?

I hope some of you guys have some insight into this. THX!

Replies

  • Hito
    Offline / Send Message
    Hito interpolator
    they're probably there for mesh deformation. The knee bone for example, is child to the thigh bone, and inherits part of the rotation from the calf bone. It drives the vertices around the knee so when the joint bends there is less mesh collapsing than if you had weighed the vertices directly to the limb's skeletal bones. How the intermediate bone is oriented initially isn't very important, as long as the amount of inheritance is appropriate.

    take a look at this post by poopinmymouth aka ben mathis
    http://www.gameartisans.org/forums/showpost.php?p=3445&postcount=21
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Hmmm, sure that would make sense (and I have heard about the use of such a bone in the knee already), but in this case there are not two points of rotation in the knee as the dotted lines only represent a parent-child relation.
    Thus you only have one point of rotation (at the base of the knee bone) as it would be the case with two simply interconnected bones.

    Edit: To illustrate my point that is isn't the mesh deformation:
    knee_weight.jpg

    It's not just the knee vertexes that are weighted to the bone, but all of the lower leg, thus it's not different from a single "lower-leg bone", right?

    I am guessing that if could have something to to with the reference point of the IK solvers (which are sadly lost in the "whatever"-md5 conversion), but that would only explain it in certain cases (to my limited knowldge about that stuff). However this type of bone placement is almost everywhere in these meshes.

    Edit: Or could it be simply an error caused by the blender md5 importer?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Uhh, looks like it might be an MD5 importer error, I don't remember the rigs looking like that.

    Certainly our ETQW rigs just have a single joint at the knee and only one ankle/foot bone. Maybe the D3/Prey ones had more since they were singleplayer though. Seems like really odd bone locations though.

    I don't have the games here so I can't check how they import into Max, I'm pretty sure there are console commands in developer mode to show the bones in the game, maybe if you look those up you can compare what the game is drawing with what your importer is giving you?
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Good idea, will check in game.

    But after longer consideration I think it really is just an importer error (well the rig works just fine... it just looks odd).
  • Baddcog
    Offline / Send Message
    Baddcog polycounter lvl 9
    There are some odd bones used in the Doom3 models.

    I've made a few characters for The Darkmod so far and you do have to place IK solver bones.

    These bones need attached to the mesh but not weighted to any verts. Their placement can be fairly random but their pivot location needs to be correct.
    Basically they tell Doom which way to bend a joint when using IK to manuever stairs when the regular walk/run anims don't work.

    If you look in the characters .def file you will see these named like so:
    IK_Knee.
    Also in the def are other leg bone names that tell Doom which bone is the thigh, kness, ankle and foot.

    The important part is that the pivot of the IK bone is on the outside of the joint.

    This is my post at D3World that explains everything I know about those bones.
    http://www.doom3world.org/phpbb2/viewtop...974b03f7e53bd73

    BTW, the bones do change size when run thru the md5 exporter. My rig did this to, I had full length bones down the calf, but once run thru the exporter they became small bones at the knee (which is the same pivot location as the original bones) so they will be weighted to the entire low leg. Nothing is wrong with that, it just looks different.


    Also, the IK solvers aren't lost in conversion. Doom3 doesn't use IK Solvers as 3dsMax or Maya do. They just use IK based on the animations, the 'IK_Bones', and the .def file that tells D3 which bones to use in an IK set-up.
    It's fairly primitive but really only used for making feet hit the ground over uneven terrain.
    The IK is useful in 3d programs when you're animating the mesh but is not exported with the mesh or anims.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Thanks for the explaination.

    I am currently working on a generic rig:
    jkm_rigwip01.jpg

    Any ideas how to improve it? (The "floor" bone is hidden on that screenshot).
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Sorry to dig up this relativly old thread.

    But I think I got it to a usable state:
    http://freegamearts.tuxfamily.org/fga-it...=Humanoid%20rig
    (Download .blend licensed under the GPLv2 or later)

    But I got a question regarding such rigs:

    I basicly tried to stay close to rigs found in id tech 4 games and just added IK solvers and such which were probably lost during the md5 conversion.
    However this clearly isn't as comfortable as some rigs ment for non real time rigs, which have all sorts of helper bones and seperate pieces of the skeleton which have their own root etc (as typically done for rendering rigs).
    It is really a general rule to not use such helper bones (which I assumed) or does it not really matter that much as long as the general limitations of the .md5 format (40 bones) are not exeeded (as someone suggested to me)?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Well, if you're talking about the MD5 format, all it stores is positions/rotations of bones per frame, so as long as your exporter is only outputting that information for the required bones and nothing more, then you can use whatever helpers etc. you like.

    Basically you'd just be "baking" your animation during the export process, and you'd only export the bone objects which are actually affecting the mesh, not exporting any of the helpers or other extra things which aren't actually adding any info, they're just making it easier to control the bones you want to export.

    This may be slightly different to stuff like Crysis where they have IK on things, I'm not sure how that's handled. Although I think MD5s can do IK too, I'll have to check on how that's set up.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Ahh, ok that helps a lot already, thanks!

    However I doubt the Blender exporter supports exporting only certain bones frown.gif

    Hmm, but wouldn't you still need a complete skeleton with one root bone, as opposed to individual foot rig setups (with their own root and only connected to the main rig via constrains) as often seen with rendering rigs?
    At least I imagine ragdoll like effect could be quite difficult that way.

    Concerning realtime IK in Doom3, well AFAIK is is really basic and controlled by an external config file in which the individual bones are named. (Edit: Baddcog already mentioned that above)
    Dunno about Crysis either.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm, yeah, if you had foot bones not parented to leg bones then I don't think that would work. The main bones would still all have to be in a correct heirarchy.
Sign In or Register to comment.