Jump to content
  • Advertisement
Sign in to follow this  
threadbare

Skeletal animation - Walking/Running

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making a game in 2D with characters animated by skeletal animation, and I don't know how to do running. If it's flat surface, I can handle it quite well by keyframes, but what about slopes/staircases/etc.?

Share this post


Link to post
Share on other sites
Advertisement
Many games don't bother with worrying about sloped surfaces. They simply play the same run animation. Most of the time it's not very noticable. Some current gen games are starting to use IK(inverse kinematics) to be able to dynamically make the foot follow the surface, make the character aim at a particular point, etc...

Share this post


Link to post
Share on other sites
I'll tell you how I did it. I hope you can take something from it.

My skeletal animation system is closely tied with the physics system. If the animation system is not enabled, the character will fall and tumble to his death. This is done by defining circles, particles, at key joints on his body, and colliding those particles with the world. These particles are also what defines the current pose of the character.

Now something I have been experimenting with is projecting these circles out of geometry in real time during animation. For example, the animation system will force a particle to a certain location and then the physics system will push that particle out of any obstructing geometry. The constraints will be satisfied and then the leg automatically never goes inside an object.

This generally worked well except for a few cases where projecting the foot or leg out caused some interesting poses or jerks in the animation. I still have not decided whether this feature will be used because of these strange situations.

Another solution I considered was rotating the character to match the normal of the surface he is standing on. So if the character was going up a steep incline, he would be leaning back. Cases where I thought this might fail though were stairs where the incline constantly changes.

Did this help?

Share this post


Link to post
Share on other sites
Quote:
Original post by skittleo

Another solution I considered was rotating the character to match the normal of the surface he is standing on. So if the character was going up a steep incline, he would be leaning back.



not to be real picky or anything, or to try to tell you you're wrong - and maybe i misunderstood you, but are you sure about this?

I used to do a fair bit of hiking, and even now where I live there are plenty of steep hills, and when I'm going up a steep incline, i dont lean back, just the opposite, I lean forward, into the hill, like most people that I know.

Your body should want to stay upright with respect to actual level, not just the plane its standing on. So for going down a steep grade you would be 'leaning back' i would think, no?

Share this post


Link to post
Share on other sites
xanin-

Sorry I never checked back on this post until now.

Yes you are completely correct. I have since decided that this would be a very unrealistic solution. It's all about weight balance. But thank you for confirming my thoughts.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!