Inverse Kinematics and Animation

The creatures in Syndrome are a mix up of mechanical and biological.
There’s a complex AI system that controls their behaviors and decisions: patrol, hunt or attack.
But it can be broken down to patrolling, spotting the player, hunting, attacking, idle animations, reacting to sounds, etc.

Take a look at how animation looks in Syndrome:

That guy looks ferocious, right?

For our next game (in development) we have different needs regarding animations.
Things are not so simple as a monster spotting the player and running after him.
We require a more complex animation system that tells the player what’s going on, even subtle things and details about a character.

We want to go all the way with details in the game.

One simple example of what we need: standing characters looking idly at the player.
There’s a movie that illustrates this perfectly: “The Fog” by John Carpenter.
Have a look at this picture from the movie.

Now have a look at the this screenshot from our game.
No, we’re not making “The Fog” videogame, this is just for illustration purposes 🙂
In the movie, the people in the fog usually don’t move. They just stand there, waiting for the fog to advance so they can hunt their victims.
In our game, the men in the fog are also standing, following the player with their gaze.

To do this, we could simply “billboard” the creatures and rotate them towards the player. It would do the job, but it wouldn’t look as good as we want.
So we decided to use Inverse Kinematics on the neck.
This way we have a nice group of idle animations applied on these men in the fog, and their heads and glowing eyes rotate and follow the player, wherever he goes.

We just apply a target to the head bone, so that the head bone follows the player, and that’s it, magic is done.

Another benefit of using IK mixed with animations, is just how natural everything looks.
For example, we have a creature with a light in its head. This creature is wandering and searching for the player.
This creature is also using Inverse Kinematics in both feet. It raycasts looking for collisions below the creature’s feet, and if a collision is detected, we move the feet to the correct position.
Because of IK magic, the remaining leg bones deform correctly giving the illusion that the creature has a much more complex animation than it really has.

But IK usage is not over yet!
The creature is looking for the player while it’s walking around the street.
So again Inverse Kinematics comes to our help.

The idea is to randomly create a position in the creature’s field of view.
A random position is created every 6 to 7 seconds.
When a new position is available, we make the head look at that direction, creating the illusion that the creature is searching for the player.

And none of this is animated, the regular animation has the creature walking with the head facing forward and that’s it.

When the player enters a pre-defined radius, let’s say 6 meters, then the creature’s head will look to the area where the player is.
If the creature detects the player, then it starts running towards the player, ALWAYS with the head focusing on the player.

With IK all movements look natural and realistic.

About The Author

Bruno Cesteiro
Game developer, Gamer, Sci-Fi enthusiast and dad. Co-Owner & Producer @ Camel 101

No Comments

Leave a Reply

PARTNERS


CONTACT US


Business proposal Press inquiry? Questions or comments? Contact us and we'll get back to you asap.






raider
cam191
Follow us on our social channels

COPYRIGHT CAMEL 101 2009 - 2016
All Rights Reserved