There are three fundamental technologies used in modern computer games: graphics, physics, and artificial intelligence(AI). But while graphics and physics have shown great progress in the last five years, current AI still continues to display only simple repetitive behavior, which is of little replay value. This deficiency, unfortunately, is often sidestepped, and the emphasis switched to multi-player games, which take advantage of real human intelligence.
In this article, I have attempted to model AI based on the functional anatomy of the biological nervous system. In the pure sense of the word, a biological model of AI should use neural networks for all stimulus encoding and motor response signal processing. Unfortunately, neural networks are still difficult to control (for game design) and very computationally expensive. Therefore I have chosen a hybrid model, which uses a "biological" signal path framework in conjunction with more traditional heuristic methods for goal selection. The main features of this model are:
Figure 1. Block diagram of the data flow between functional units for this brain model.
This AI model was developed for use in SpecOps II, a tactical infantry combat simulation of Green Beret covert missions. While the emphasis of the project has been on realism and squad level tactics, it still falls under the category of a first-person shooter. The original SpecOps project was based on the U.S. Army Ranger Corps. and was one of the first "photo-realistic" tactical combat simulators released for the computer gaming market. The combination of high quality motion capture data, photo digitized texture maps and sound effects recorded from authentic sources produce a rather compelling combat experience. Although the original game was fun to play, it was justifiably criticized for having poor AI. Therefore one of the major goals for SpecOps II was to improve the AI. The previous game logic and AI was based on procedural scripts; the new systems are based on data driven ANSI C code. (My experience has convinced me that data driven code is more reliable, flexible and extensible than procedural scripts.) When the data structures that drive the code are designed correctly, the code itself can become very simple.
Table 1. Parallels to Biological Nervous System
|Functional Unit||Biological System|
|Stimulus Detection Unit||Visual / Auditory Cortices|
|Directives||Reflex / Conditioned Response|
|Known / Acquired Goals||Short-Term Memory|
|Goal Selector / Navigator||Frontal Cortex|
|Direction / Position Goal Servos||Motor Cortex / Cerebellum|
Typical Behavior in SpecOps II
In the course of a normal game, a player can order one of his buddies to attack an enemy. If this enemy is blocked by the world, the path finder will navigate him until there is a clear path. Once the path is clear, the direction servo points the AI at the enemy and he begins firing his gun. If that enemy is taken out, the AI may engage other enemies that were aroused by the weapons fire. If all the known enemies have been taken out, the buddy returns to formation with his commander.
Another typical sequence might begin when a player issues a "demolish position" command to a squad member. The AI will then navigate to the position goal, place a satchel charge and yell out: "fire in the hole!" The "get away from explosive" directive will then cause him to move outside of the danger radius of the explosive. I have observed an interesting case where the initial evasive maneuver lead to a dead end, followed by backtracking towards the explosive object. Eventually the navigator got the AI a safe distance away from the explosive in time.