The Goal

My goal with this project was to create an AI coordinator that would keep a check on the AI entities in the scene and make the decisions to save on computing power and make it seem like the AI was a more coordinated group. 

 

AI Coordinator:

An AI coordinator made in five weeks during half time (4h/day)

Setup:

I started the project by setting up a scene in Unity with a player which was both manually controlled and could move on its own based on a random position given to it. 

I then added an AI actor. 

I decided to use Unity cause of its ability to set up a scene easily for this project as no advanced graphics were needed. Just a simple scene with a few actors following orders from the coordinator.

Screenshot (43).png

Behavior:

Screenshot (45).png

After having set the scene up so did I have to decide on what kind of behavior I wanted. I decided to go with a pursuit behavior and a patrol behavior to start. 

Having the AI follow the player around until it was out of reach before starting to patrol the screen until it was in range of the player once more. 

To switch in between the different states so did I use the Unity animator as a behavior tree. Able to switch around it with the help of bools which was controlled by the coordinator.

After working some so did I manage to make it so that the AI actor switched from following to patroling and back again based on distance. But it was not perfect. 

As the actor just started to patrol a small area before starting to follow the player once more once it was in range. 

To combat that so did I create specific coordinates that the AI coordinator held. Selecting one of them and feeding it to the actor when it entered the patrolling behavior instead.

Once that was done so was it time to add another AI entity, I created an actor array that the coordinator looped through to see if any of the actors were in range of the player or if the player was in range of any of the actors to trigger a behavior switch.

Post-Project Conclution:

The project proved more of a challenge than I initially believed it to be. Both a combination of being familiar with Unity but having not used it in a while. As well as having to learn to use C# from my limited experience with it and familiarity with C++ caused some issues. 

If I would have done this again so would I try to get a more solid base for the navigation of the actors down as my focus on the coordinator and not having the actors move smoothly and without issues certainly caused some wasted time.

But this is something that I want to keep on perfecting and keep on working on. 

Results:

When the five weeks were done so was the coordinator working but not perfectly. 

Some issues had returned and the navigation of the AI actors was not perfect or what I wanted. With some unexpected behavior, I wished I could have spent more time ironing out.

Points of Improvements:

  • Iron out the movement issue.

  • Adding more behaviors. Ex: Intercepting, avoiding, etc. 

  • Add more AI actors to the scene.