top of page

AI Experiment, HFSM

One area I haven't spent much time in is AI, this actually occured to me while I was working my way through some GDC and Unite presentations on Youtube, after seeing these two presentations:

AI in the Awesomocalypse: Creating the Enemies of Sunset Overdrive, Adam Noonchester, GDC (


Unite 2014 - Practical AI in Games, Emil Johansen, Unite 2014


The later especially, it melted my brain a little but over the next couple of days began to sink in and turn into motivation.

So I set up a simple little prototype, I also needed to learn more about coroutines so this was a good situation to play around with them and see what they can do.

I tried to implement a high level state machine (using an enum) with each state having its own state machine within that, vaguely like a behaviour tree. I've also tried to use a series of checks to sort all priorities in order with the intention of using it to then determine the AI's behaviour, perhaps to lead to more complex actions (like look for the ammo nearest some cover for example). This project still has a lot of bugs and sections unfinished but it shows some promise.


The units spawn, see each other, and decide to start shooting, they then decide to seek cover when their health gets low.

The units seek cover but this is resulting in them losing interest in each other (bug) and then going looking for ammo or health, their next priority.

Source Code:


Featured Posts
Recent Posts
Search By Tags
No tags yet.
Follow Us
  • Facebook Classic
  • Twitter Classic
  • Google Classic
bottom of page