Article

How to Create an Architecture for AI Actors

Alex J. Champandard on June 4, 2007

Game AI is fundamentally about behaviors. You need to design and implement a program that controls your actors to make the game fun. To achieve this, most often, you’ll need to do the following:

  1. Gather information about the world

  2. Remember certain things when necessary

  3. Decide what to do ahead of time

  4. Attempt to follow the plan, checking for problems

This breaks up the architecture into four parts.

Sensory System

The sensory system deals with perception for actors. Typically, it involves accessing or computing information from the world representation. For example:

  • Line of sight checks using the physics collision bounds.

  • Determining nearby objects or actors.

  • Gathering information about sound events.

Specialized algorithms deal with each of these things, and the AI system can typically re-use most of the work done in the engine.

Actuator System

The counterpart of the sensory system is the actuator system. It helps the AI achieve things in the game by modifying the world representation. For example:

  • Controlling a body using motion-captured animations.

  • Playing sounds for voice or other special effects.

  • Communicating with other actors, or sending events.

The tricky part is working out which actions to execute, and when…

Decision Making and Control

Making decisions, and then executing them is the main part of the AI. This is traditionally done with a scripting language or a state machine. Each actor is then controlled by a small program that the designer writes.

The challenge here is to create a system that deals with game specific problems:

  1. Pursuing long-term goals.

  2. Responding to short-term events.

  3. Handling large quantities of content!

To make decisions, a control program mostly uses global information about the world. However, this can be customized for each actor…

World Model

When actors store their own pieces of information in their memory, it’s called a world model. The AI essentially use little facts to express what an actor should know about the world.

There are two main ways of doing this:

  • A specific data-structure that’s not extensible, just contains a limited number of facts.

  • An extensible data-structure that can store any piece of information.

The second approach is known as a blackboard architecture. It’s slower, but in practice is more powerful.

Discussion 0 Comments

If you'd like to add a comment or question on this page, simply log-in to the site. You can create an account from the sign-up page if necessary... It takes less than a minute!