Procedural Animation: First Steps


Creating Procedurally Animated Wall Crawlers

           This week we started working on the procedural animation that will be driving some of the enemies in the game.  I can't thank our animation and rigging expert (Zach Bille) enough for the excellent work he has done with the modeling and IK rigging. I, on the other hand, did all of the programming work that is bringing this animation to life. 

            We decided that we wanted procedurally animated enemies pretty early on in development. Our enemies will be insectoid & arachnid-like robots, so well thought out movements entirely determined by scripting and logic only makes sense! The major benefit of having the movement dynamically adjusted based on the terrain that the enemies walk on is that it also works to sell the movement styles of these enemies. The spider-like robots should be able to crawl around the environment, and while now that only means obstacles on the floor, the goal is to eventually get these machine creatures to seemingly defy gravity much like the real animals they are based on.

Early Procedural Terrain Movement

           The first order of business was to get our (now rigged) spider enemy to move its limbs based on its location, rotation, and the terrain below it. The video above demonstrates what some of the early forms of this movement are looking like. Without diving too deep into the code of it, each leg has an optimal foot placement. However, when the enemy moves forward the leg stays where it last landed and as the spider moves, the current leg position needs to catch up to this optimal placement. Once the foot is outside of the comfortable range it is then moved back to its optimal position. Once we managed that, all that was left was adjusting the optimal position's height to account for the terrain  under it. The final result ended up looking like what you can see above.

A.I. Wall Crawling

           Of course the enemy isn't really moving like a spider unless it has the ability to climb up the sides of walls like one. In the earlier builds of our game, we featured enemies with AI navigation that could move along the floor in search of the player or their next idling position. In the video above you can see that we have brought this movement into the third dimension, allowing for the spider to scale up vertical surfaces. This was done by making sure that walkable areas were generated on every side of any terrain object. However, that alone is not enough to get the spiders on the walls on their own. We then had to add in a few more components that bridged the navigation paths from one plane to the next, allowing the spider to transition between these surfaces.


Merging the Animation & Movement


           The last thing that needed to be done was to get the procedural animation working on the new, wall climbing, AI enemy. As you can see in the clip above, the spider now has the ability to place it's "optimal foot locations" on the vertical walls that it's scaling. First we had to adjust the procedural animation script to allow for verticality. Before this, if we just moved the original procedural spider on to the wall crawling AI, its legs would simply go limp and be pointed straight down like wet noodles. To fix that, we adjusted the raycasts to account for the local rotation of the spider. The video above is the results we've gotten so far!

           There's still plenty of work to be done on these enemies and some bugs to be addressed, but this progress has been extremely motivating so I couldn't be happier to report it. I am looking forward to further developing the game myself and to seeing what the rest of the team can do too!

           That's all for now & thanks for reading!

- Maxwell Elliott

Get Manic Media's Mechanical Mayhem

Leave a comment

Log in with itch.io to leave a comment.