The behavior of the enemies is controlled by a finite-state machine. Basically there's a bunch of cover points around the map that raycast to the player to determine whether or not they are a 'good' or 'bad' cover point. They also raycast from a 'shoot from cover' point to determine whether or not the enemies can pop out and shoot the player from this point.
The enemies simply try to find the nearest 'good' cover point that they can shoot you from and that isn't currently in use by another enemy. If there are none, then they start moving to random 'non-cover' points on the map that they'll be able to shoot you from.
No comments:
Post a Comment