Sunday, June 30, 2013

How do characters move?

I'm going to start this with a bit of my thoughts on how I look at character motion and what I think about when I'm setting up a character.

In games, for the most part, all we have to work with are joints and painted weights to get a character moving, though with more powerful processing we are starting to see some divergence.  Studios are starting to use more blend shapes and more complex ones to solve difficult areas as well as different weight calculations such as dual quaternion skinning.  I'll get into that soon, but it deserves it's own post, so for this one we'll stay focused on the question at hand, how do we move a character?  Or better yet how do characters move?

To get good motion out of a character we first need to understand what we're trying to accomplish with our joints, mesh and weighting.  At the highest level we are trying to simulate how something moves, but first lets look at what each piece is in the context of a human to help understand what we have to work with.  The mesh is the skin and cloths, weighting is the definition of how the skin follows the joints.  That leaves our joints to be bones, muscles, and tendons.  A pretty tall order to demand from what's essentially a point in space that can only move, rotate, and scale.  It's also an area where I've seen flaws in character motion, and still do in some modern games.  When joints are placed in a mesh to try and build an anatomically correct skeleton it becomes very difficult to use them to simulate the muscle and tendons.  And it's those muscles and tendons that provide motion to the human body.  The skeleton is there to provide support and structure to the muscles and tendons, but not motion.  As a technical artist it's rough seeing joints placements that ruin the deformation of a character, and it doesn't only ruin the deformation.  Bad deformation also hurts animation, even excellent animation can look bad if the deformation isn't there to support it.

Now, if we're going to simulate how a person, an animal, or some mystical creature moves we need to understand how it's anatomy moves it and on an even finer level how it's anatomy moves.  All of the complex motion that we can do with our body, our arms, our legs starts with simple motion.  A group of muscles expand and contract, tendons connect those muscles to our bones and those connections turn that linear motion into rotational motion.  This may be a little bit of an over simplification, but the major motion/locomotion of living creatures boils down to linear muscles compressing.  This leads us to another problem.  We have points in space, and while they can move, rotate, and scale in games it's fairly rare that we use all of the channels.  The translation is handled by hierarchies with forward and inverse kinematics, beyond that when translation is animated it's normally done to purposefully break anatomy.  Scale is also tricky and difficult to use well with the hierarchies inheriting the scale, we can pull off joints to do a non-terminal scale(scale on a joint with no children), but in most cases that leaves us with a point that can rotate in space.

No comments:

Post a Comment