Morning AI Programming

This morning I decided it was a good time to start work on the state based AI system we will be using in CUT.  The approach as a whole is an extremely common way to do AI in game, and it will give me a good amount of flexibility later for adding in some extra steps if need be.

So far I have four states I am working on which are as follows: Idle, Wandering, Chasing, and Attacking.

  • Idle - This is the starting state, and occurs when the enemy is standing still
  • Wandering - Enemy exits idle state and wanderings around an area of the NavMesh
  • Chasing - A player is either in range, or vision of the enemy and it will start to chase.
  • Attacking - Occurs when the player is in attack range after the chasing state.

This should cover most of the enemy interaction I need at the point and I can use the same code across a few enemy types and vary it later.