ABSTRACT

Game AI Architecture (GAIA) is a modular AI architecture that is designed to be (a) extensible, meaning that as new capabilities are needed, they can easily be added and (b) reusable, meaning that the architecture can be quickly and easily ported from project to project, including across different game engines. This chapter presents some tricks and lessons learned from the factory system for the GAIA, with a strong emphasis on providing actual implementation details. These tricks include abstracting the data format, encapsulating the information objects will need to initialize themselves, a consistent approach for object construction and initialization. It also includes the injection of code from outside of the AI library, the use of templates and macros to standardize factory definitions and using global object configurations to remove duplication from the data. The chapter focuses specifically on GAIA factories and on aspects of those factories that are worthy of reuse.