3.7 AI Module
The AI module provides a virtual class that the FSM and GOAP controllers implement and extend. Each agent in the game is controlled by an AI module which can be to be either a FSM or GOAP controller. The AI module provides virtual setup, update and cleanup functions that the GOAP and FSM controllers overwrite using polymorphism to create the different behaviour. The setup and updating of the individual AI modules is carried out by the squads which are in turn updated by the overall squad manager which is updated from the main game loop.
See figure 6 for a UML diagram that illustrates the relationships between the different subsystems, squad manager, the AI module and the game itself.