Often, the AI engine is split into multiple layers with different responsibilities:
Modules at the base are implementations of AI techniques.
Capabilities of the characters depend on these AI techniques.
Behaviors are expressed in terms of the specific capabilities.
Arbitrators coordinate and select the right behaviors.
The implementation of AI systems benefits from similar trends as game engine development, combining flexibility with efficiency:
Native code is used for expensive common runtimes.
Scripts provide customized layers, simple to implement.
Data files store as much information as possible separate from the codebase.
Table 49.2 summarizes patterns for specific problems.
Table 49.2. Common Problems Encountered in Games and AI Techniques to Handle Them
Rule-based system, fuzzy expert system
Finite-state machines variations
Decision trees, neural networks
As far as learning systems are concerned, there are useful guidelines, too:
Prefer supervised approaches, especially when realism is hard to express.
Levels of magnitude in the feedback guide the learning.
Mixing and matching these ideas should enable us to develop any game AI system in a simple but robust fashion.