AI Movement - A Unity discussion


AI movement for our enemies may seem quite simple, but for a game as dynamic as Tenril it becomes greatly more complicated.

This is primarily due to the way built-in Unity features function versus the type of interaction we tried to achieve. Unity's built in Navigation Mesh is a very helpful and versatile feature which is capable of automatically detecting valid areas that an AI can move through, and capable of handling the movement of simple AI. 

- Visualized Naviation Mesh for where AI can walk

Despite being a powerful tool that Unity provides, it is very limited when it comes to animation driven agents. What animation driven means is that when an enemy performs any animation, in this case movement like walking or running, the changes in its position and its collisions correctly reflect the animation.

- Animation controller for the animation driven movement

In order to make this function, we have two different systems work together. Unity's Navigation Mesh system is used purely for receiving information with all movement related features being disabled. This information is then used by a custom movement system that can correctly interpret it and play the correct combination of animations, achieving our desired interaction. This means the AI is able to intelligently navigate around a map, all while appearing to move more dynamically. It's versatile implementations like this which allowed for such advanced features such as our repositioning enemies mechanic.

Hope you learnt something new and maybe find inspiration for your own creations!

Get Tenril

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.