Utility AI

Hi there.

I am just fiddling around and experimenting inside Unity now for over a week by trying to create something like an Utility AI. Over the months I have been busy with behavior trees and FSM.

Right now I am trying to recreate something that the awesome guys at Apex AI have made. Here’s the video: Unite Europe 2016 - Next Generation AI for Unity - YouTube

Like shown above, I am trying to create a grid where all the positions inside the navigation area are.
These positions would change their score, just like Apex did, on the amount of monsters around the AI. (So the AI always moves towards the best suited position inside the area.)

Problem is, I couldn’t find a lot about Utility AI on the internet and nothing about this kind of grid positions… I hope somebody can point me into the right direction, so I can continue my work!

Thank you in advance,
Patrick

Hey Patrick,

I have tried to fiddle around with utility AI, but I have not really got into it yet. Still I think I have done what you’re trying to do, in my own ‘game.’ I made a cover system based entirely on this document. It is not a generic solution, as the one Apex probably has, but it works nicely.

If you use A* pathfinding you don’t have to generate any grid, as you already have one. With navmeshes you have to use fustrums and complex math… stuff…

Utility Theory is just where your AI evaluates multiple options, score them based on a (weighted) preference, and select the option that gives the best score. In a nutshell.

Anyways, once you have the grid its not very difficult. You just run through a small selection of the closest nodes in the grid, and perform simple checks on them, like “is this node in the preferred firing range?” or “is this node dangerously close to an enemy?” etc. I hope you get the point with these terrible examples.

Then add a number (a tag in A*) to this node based on what checks are true or not. I would recommend using enums for this to keep track of everything.

You could also then add score based on things like time it takes to reach this node. Anything really. Have fun.

~ Angelo