• Register
Post news Report RSS The Advanced AI Logic Behind Shinobu

An advanced Unity approach to solving character believability.

Posted by on

The most important goal of this project is to create a very believable AI with tons of branching animations and dynamic behaviors. Because of the ambitiousness, the development has revolved around improving the modularity of many Unity features. Unity's animation system can quickly become a web of problems and is hard to maintain in the long term when additional development behaviors affect the allowed transitions of some animations. So all animations are now done entirely in C#. This gave me a much tighter control over her animations which will be pivotal for adding logic on top. Additionally, the torso and legs animations were split to allow for mixing of animations. However these 2 layers do not always sync up and so within the C# controllers, manual syncing of both layers is performed only when a certain animation is in need of it. For example, a walking animation should sync both torso and legs but a hand waving might not.

Another overhauled feature was figuring out ways for her model to interact with the world during an animation. Inverse kinematics was the answer and so I created my own functions for IK after solving 2 intersecting spheres. This was not enough though. It was great that her arm can now move to any location in a realistic 2 bone fashion but her muscles and deformations were not following. So I rebuilt many of my Blender constraints (Damped track, copy rotations, etc.) into Unity so certain muscles or bones can follow her arm movements. Her shoulders now properly and automatically move depending on the movements of her IK arm. This was great for the chopsticks part of her game behavior.

Eyes are probably the most overlooked part of animations in many modern games including AAA titles. The way we move our eyes can speak volumes more than a realistic body movement. You can have the most realistic body animation but if you don't properly animate the eyes, you can achieve uncanny valley very quickly. So Shinobu's eye logic is very extensive to ensure that she looks at the player and the world in a natural way. Her eyelids move down when she looks down, she blinks, she has variation of look at positions when staring, and blends and constrains her looks with the currently playing animation.

Overall procedural animations are what a character like Shinobu needs to have a more life like attitude. In the future I plan to program ways for her to pick up objects and draw dynamic representations of images. There is a free demo v0.1 for Windows and Linux which you can try out by visiting the main dev blog at Patreon. I am saving up for voice and music assets!

Post comment Comments
Guest
Guest - - 689,161 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: