Unit Behavioral AI Game AI is not necessarily AI in the standard meaning of the word. Game AI for units is really an attempt to program life-like attributes to provide a challenge or an appearance of reality. A guard in a game that stands in one place never moving can seem very unrealistic. However, if you create a routine to make that guard look around in different directions from time to time, or change his posture, he can start to look more alive. By creating a situation where another guard who walks in a pre-made path occasionally stops in front of the standing guard and appears to speak to him, the appearance of reality can be increased greatly.
Units act in a reactionary manner whenever they are responding to a change in their environment.
If an enemy spots you and starts to run towards you and shoot, then they have acted as a reaction to seeing you. Units act in a spontaneous manner when they perform an action that is not based on any change in their environment. A unit that decides to move from his standing guard post to a walking sentry around the base has made a spontaneous action. Reactionary AI Reactionary inputs should always be based on the senses of the units. When modeling AI after human characters you need to take into consideration their range and distance of sight, their sense of hearing and if applicable, smell.