10 Simple Video Game Features (That Are A NIGHTMARE To Develop)
6. Walking Up And Down Stairs
By majority, videogame animations are keyframed, using forward kinematics and inverse kinematics.
Forward kinematics are when you directly manipulate what you want to move - usually, from the root bone outwards (so you’d animate the shoulder, then the elbow, then the wrist, then fingers). Inverse kinematics, however, are when you animate the outermost joint, and the software attempts to approximate all the bones back to the root (a bit like manipulating a traditional puppet).
We use inverse kinematics to create some procedural animations, so the code just tries to... effectively guess where to place the foot next, whilst also following a base animation for “reference”.
If this sounds tricky, it’s because... it is.
So, walking up some stairs, you could either just have your character use his/her standard, canned animation (so it appears as though he/she is “gliding” upstairs) or you could delve deep into the world of procedural, FK/IK hybrid animation in an attempt to make that character’s original animation look organic, AND actually planting feet on individual steps in sequence.
There‘s a reason why, even games which have tackled the mighty challenge of “character walking up steps”, still have characters that look a bit like they’ve downed a full bottle of Famous Grouse.