Procedural Character Balance And Animation
I'm not sure if this is more appropriate for AI or physics, so feel free to move it if needed.
I'm currently working on a 2D game. In my game the terrain is created largely with bezier curves that I calculate at start-up. The purpose of the game is to be a sidescroller with a little guy who runs around. I'm making everything "vectorized" like Geometry Wars where everything is just comprised of lines. So I figured my little guy would be made the same way. One thought I had was to do some sort of basic procedural animation system so that the character could use the normals of the terrain to properly animate running no matter what the angle.
One thought I had was to set a certain step size for the character. For each step he takes I would then move forward that much on the X axis. Then I would find the Y value of the terrain at that spot. From there I would attempt to rotate the joints in his legs properly to adjust for the height change. I'd also make his torso lean forward or backward to compensate for that as well.
On other thing I was hoping to achieve, though obviously not needed as of yet, was to create a self-standing 2D character such that, when hit with some force, the character could adjust and remain standing. I've seen demos of robots in 3D doing similar things so I wondered how such things are attempted.
Any comments on my idea or suggestions and links are greatly appreciated. Thanks.
The most simple solution is not too hard, actually. Play your normal walking animation, ajusting the hips height with the terrain height. With standard animation, this would have your front feet go through the ground and your back feet float in the air. Ajust each feet's height to match the ground, and use forward kinematics (you can google that) to find the correct angle for the knee and leg-hips joints.
As for balance, its a bit more computationally expensive. For a person to be in balance on a flat surface, the projection of its center of gravity must lie within the convex hull of its contact points on the ground. To dynamically keep balance, you must use Inverse Kynematics (IK) to keep your center of gravity as such.
If you want all of this to *really* look nice, you need to take into account all biomechanics factors. Meaning not only the size and weight of each bone, but also the angles of comfort of each joint, for example.
As for balance, its a bit more computationally expensive. For a person to be in balance on a flat surface, the projection of its center of gravity must lie within the convex hull of its contact points on the ground. To dynamically keep balance, you must use Inverse Kynematics (IK) to keep your center of gravity as such.
If you want all of this to *really* look nice, you need to take into account all biomechanics factors. Meaning not only the size and weight of each bone, but also the angles of comfort of each joint, for example.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement