I had a curious idea this morning. It’s turning out to be a rather interesting can o’ worms.
I hadn’t really considered sideways torques before now: because the bones are static (by necessity: we can’t go recalculating them every frame, for the same reason we can’t animate every limb on the map) I’d been mainly considering creatures as “balanced or not” based on how they stand still. But what about gait? A slow biped with large, wide-spread legs *should* be incapable of using them effectively, but the game would fail to take that into account by always treating them as if they were standing on both legs.
So what if we apply a very rough “gait” calculation, basically just a sin curve, based on their limb size? This applies positive torque when they’re on their left leg, and negative torque on their right.
So far so good, but the creatures need to be able to adapt to this. At the moment, the only gait-influencing attribute is leg size, and it just affects how fast the legs animate. In order to optimise their gait, they need to be able to sync their legs to each other, which can only be done if they have *exactly* the same sized legs.
Here’s where the can o’ worms comes in. How do we allow for gait-sync in creatures who could have any size or number of legs, but whose legs must move at the right speed so as not to slide strangely across the ground?
My initial thought is this: we’re going to need to procedurally modify the animation, specifically the step size. If the aforementioned slow biped with large, wide-spread limbs took small fast steps instead of wide slow ones, it could concievably walk without losing balance. In addition, it could sync up those small steps with smaller limbs that take wider steps, and these smaller limbs could take the weight while the large limbs step forward.
But we still hit a similar problem to before: if the speed is even slightly off, then 10-, 50-, 1000- steps down the road, the legs will no longer be alternating and the benefits of syncronisation are lost.
My current idea is to have a binary flag gene, which stores which limb indices are synchronised. So if limbs 1 and 3 are synchonised, it would store 13. (no, that’s not “1,3” it’s “101”. Afterall, there are only 10 kinds of people in the world…* :D). These limbs would ignore their actual step size in favor of one which allows them to stay in sync.
Well, regardless of whether we manage step sync and sideways torques, I’m sold on the idea of a variable step size: it’s the only way we’ll have decently animated sauropod- and elephantoids. I had originally intended to implement it via additional limb-types, but if I can find a way to do it procedurally I can get infinite more variation! Am hyped! Am very hyped right now!
And I won’t even start on the idea of using the torques to rotate the torso bones so as to make the energy expenditure visible and the walk animation more realistic, because if I do that I’ll never be able to clean the drool off the keyboard.
* * * * * *
*footnote: <i>”… those who find nerd jokes about binary formatting funny, and those who aren’t pretentious nobs with the social skills of parthinogenically-reproducing lizards.”</i>**
**footnote: <i>”Self-depricatory humour. Binary jokes are hilarious and parthinogenically-reproducing lizards are badass.”</i>
* * * * * *
(Edit) So I tried to implement variable step size! And got… um… this…
Success! Although it might need a little bit of tweaking. Just a bit.