Insect procedural animator

CONTENT WARNING: SPIDER 3D MODEL AND MOVEMENT

What does it take to move an insect?

An endeavor for a key part of a game concept I have wanted to do for years now, able to finally explore and combine the worlds of inverse kinematics (IK) and creepy crawlies.

It all starts with a 3D model that has been rigged, so when you move the ‘foot bone’ the connected bones all react to try and follow the end bone.

What’s less obvious is that this is already using a technique of physics simulation called ‘Inverse Kinematics.’ This is a mathematical approach and system that tells the bone where in space it is trying to be, then going up the leg and letting the other bones where they should be, all the way up until you hit the main body.

For the purposes of the prototype, I am using a free solution for IK called ‘FastIK,’ this solution uses a ‘pole’ position in space that helps the joints bend in the right direction instead of rotating in any random direction, thus we have legs with knees.

But we need to dynamically place the feet while the player moves around the world.

Let’s get our spider moving by adjusting the position of the body… not that way!

Ahh there we go, when the body moves, the legs react appropriately

Looking good actually!

Now let’s move the body around a little bit

… Close enough.

Let’s move the body using our controller

Now the body is moving, we need to update where our feet ‘should’ be.

A little bit janky, but we’re climbin’

But with some tuning it looks pretty good!

if we use the average foot position for height, and the ‘normal’ of the surface it’s on (the ‘up’ of the surface) then we can climb up walls and rotate the body to face the right direction.

Things can still go a bit wacky

But it figures itself out!

But what if the spider was bigger?

And it can still figure out where to place its feet, dynamically adjusting the body’s rotation and height based on whatever it’s climbing on.

Wow look at that big boi!

I made this to be open-ended, allowing any length leg segment attached to a body with any number of legs! It will require a bit of manual tuning and setup, but unless you’re setting up 10+ critters you’d be able to take any beetle, spider, centipede, ant, or any other type of arthropod and have a dynamic and reactive climbing and movement system.

Thanks for stopping by and keep an eye out for updates in what I might use this for in the near future ;)

Next
Next

Probending