JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Technical Overview

This book is based on a framework called FEAR, a Flexible Embodied Animat 'Rchitecture! It's an open source project that provides portable support for the creation of game AI, as well as building blocks that can be combined.

All the code available with this book—both for AI modules and example animats—compiles with FEAR. This book's web site at contains step-by-step instructions on how to install FEAR. This book itself is a resource for learning AI, and not a technical guide to FEAR. For further details about how FEAR works, or to follow recent progress, see the project web site at

FEAR is based on many of the ideas explained in this book, combined with other design principles. FEAR can be understood as one way of putting the ideas in this book into practice.


FEAR uses a high-level specification to describe all aspects of the AI [FEAR03a]. FEAR uses a minimal domain-specific language based on XML for this purpose. AI is essentially about manipulating data at different levels, so this is formalized as three separate parts, as follows:

  • Interfaces provide a set of functions (with inputs and outputs) that can be called, messages that can be passed back, type definitions, and constant declarations.

  • Modules are the implementation behind the interfaces. Most interfaces are runtime (that is, implemented in C++), but the storage of persistent data can be considered as an interface with the disk (for instance, writing binary files during shutdown). To formalize dependencies between modules, each module imports and exports interfaces.

  • Architectures are built from nested components (instances of modules) forming a hierarchy. The root of the hierarchy is usually the brain of the animat.

These high-level definitions are processed by the toolset to create source files, based on customized templates. This is known as meta-programming (a.k.a. code generation). The programmer can thereby create new definitions (for example, modules and interfaces) and have them running in FEAR with minimal coding. Already, most of the repetitive programming work can be automated.


The purpose of the framework is to implement the specification. FEAR does not impose a particular framework, but recommends a simple application programming interface (API) that common code should comply with [FEAR03b]. The developer can thereby build the system with one of many different types of implementations (for instance, static, dynamic, different styles of C++). This is achieved by expressing parts of the framework as templates, processed by code-generation tools to customize the system for each module and interface.

The framework can be tailored to almost any situation. At the moment, the FEAR team is focusing on a dynamic C++ framework, designed to be very flexible during initialization. This book uses this framework because it is ideal for educational and experimental prototypes. The demo animats are configured and loaded with little or no recompilation.

A static C++ framework will remove all the runtime customization for the sake of speed. The FEAR team is working on such a static framework that is fully compatible with the API and design patterns used in the dynamic framework. The architectures and modules can thereby be hard-coded and linked together, with most of the overheads optimized out.

Status of Development

FEAR has been going since early 2002, supporting other animat projects at first, but as a self-standing initiative since. There have been three major iterations already, but much work remains to be done—both in research and development. That said, the codebase is mature enough to support experimentation for educational and research purposes.

FEAR aims to become a general-purpose framework for state-of-the-art game AI development. Any kind of feedback on the project is extremely welcome. The developers also strongly encourage any kinds of contributions! Don't hesitate to get in touch via the web site at or directly by email.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor