02 Oct 2018

Wildlife

Adding some dynamic animation to the mix

Inspiration

I am not artistically talented. I've tried a lot over the years to improve but if I ever become good it won't be for awhile yet. I think for the purposes of my game I can make 3d models and textures which are 'good enough' but for animation I think I really stuggle to make stuff look good. I think especially since I have a job now, it's really difficult to spend my precious few hours in the evening working on something I can't finish in one sitting. So I've been looking at how to do procedural animation, looking at inverse kinematics and the like.

The main inspiration for this is Rain World. I loved playing this very difficult but ultimately very rewarding game last year, the world and the wildlife really suck you in; and combined with the story, it created a really unique experience I want to replicate to an extent in my game.

One of the signature parts of Rain World is how all the creatures in the game are animated using very physics based movements. This looks very bad in some cases because you get creatures awkwardly slamming themselves into surfaces and getting stuck on things; however for me this strange behaviour was soon forgiven when I saw how it brought life to the entities in the world. It is really great to see the creatures just move around and attack you without feeling like there's a canned animation playing out that you can memorize. You just learn how the creatures move and what their intents are which is brilliant and something I want in other games.

My Approach (As much as it is mine)

It'd be nice to write a blog post saying how I replicated the magic of Rain World in my own prototype, however I failed, at least on my own. I mentioned in a previous post how I looked at the CPG in mammalian animals as a way of implementing procedural gait generation, implementing a solution from a paper. However this approach while it worked looked very stiff and unnatural. What it needed to work was to simulate more of the physics of the creature, not just footfalls but stretching and twisting the body and adapting to terrain. This seemed like too much work and I wasn't convinced that my approach was going to be frame rate friendly so I gave up.

This changed when on the weekend I finally bought Moveen off the unity asset store. I had been looking at the package for awhile but it was quite expensive so I held off. It creates walking animations very easily (at least for the prefabs they give you) and with some simple AI I had a prototype animal working within a day. I then combined this with the BioIK package I already had to add some life to the main body of the model, so the head turns to look at the player and the body rotates when the destination of the creature moves. It looks great for a prototype and I can't wait to try making a proper model for it.

The screenshot doesn't convey the motion too well, I tried to screen cap when the creature was turning to face the player to show it in a really twisted position. The two blocks which make up its 'face' have some IK which already gives the appearance of some kind of jaw. The way the AI controls it at the moment leads to charges, overshooting when the player dodges and also some circle strafe behaviour as it slowly accelerates towards the player. I think if I made it have some kind of melee attack it'd make an interesting 'hit and run' type of enemy.