Day 3 – Item, Animation, and AI

Blog / Game Development

Screen Shot 2014-10-27 at 2.39.34 PM

Play the Game Here!!!!

On to Day 3, where we made some significant progress in the realm of animation, Item Management, and the beginning of AI.  The first thing that should be noticeable is the idle and walk animations.  Those were added using mecanim and the character rig in C4D.  So what is Mecanim?  It’s Unity’s way of making animations incredibly simple.

Let’s say you have an animation on a timeline that’s 600 frames long like this one.  There’s the idle cycle from 0-90 and then the walk cycle from 120-160 and so forth.  You can program it to where:

if (_navMeshAgent.remainingDistance>0.1)
_animator.SetBool(“Walk”, true);

All this simply states is when there is remaining distance from where your character is to the reticule, your character will walk.  Then you have this code:

if (_navMeshAgent.remainingDistance>0.1)
_animator.SetBool(“Idle”, true);

This means when there’s no distance for the character to walk, it’s time to chill and go into idle mode. This is amazing considering the first animation setup I built took about 80 lines of code and wasn’t nearly as seamless as this.  There seems to be a problem with the wrists when exported to an FBX animation.  May need to look into further.

The beginning of the AI really starts with using a similar AI system with the player but having this “chase” sequence begin when the player crosses a trigger, which is the enemy field of view.  Or, if you get too close, the big sphere with a penis will poke you until you quit.  Need to replace the model with something less fertile and something more appropriately scary.

The best part though is the new item management system occurring in the background.  I met with my tutor Jon and I’m glad I got his opinion on what I was building, because it was all wrong.  Now we’re grinding away on a new version which should be ready sometime Friday afternoon.  Can’t wait and I swear to you, Jon is the best!  You should check out his tutorials online to learn game engine coding.  It’s pretty amazing!

Now to move on to improving enemy AI, some more play mechanics, and see about setting up materials for this environment and bringing it over from C4D to Unity.

Please remember to give it a play to see the steady development!



Leave a Reply