AI Game Development. Synthetic Creatures with Learning and Reactive Behaviors
Authors: Champandard A. J.
Published year: 2003
Pages: 78-80/399
Buy this book on amazon.com >>

Discussion

Although it may seem wasteful to spend so much time on the specification, this phase is probably more important than design in software development! If handled incorrectly, the specification can become the bottleneck of the development.

A flexible interface has the advantage of simplifying the experimentation. If prototypes can be refined without changing the interface, the iterations are significantly reduced. As well as practical benefits, there are also design advantages:

  • High-level understanding - The specification provides the blueprint for the AI as a black box, separating design from implementation. Not only does this place the task within a bigger picture (the entire architecture), but it also allows theoretical analysis of the process (for instance, can this problem be solved ).

  • Abstraction - If the input and outputs have been formally described, the entire problem may be classed as a particular variation of a more generic one (for instance, pattern recognition and function approximation ). We can then use the expertise from this second domain to assist our development.

  • Comparison - Given the same interface, different modular implementations can be easily integrated. Evaluating them together then becomes a much simpler task, which is an advantage when comparing prototypes.

These benefits very often outweigh the difficulty of establishing the specification -such as taking into account restrictions, comparing options, making compromises.

Summary

In brief, the purpose of the specification phase is to do the following:

  • Describe the context of the problem.

  • Formalize the inputs and the outputs.

This is done in three steps:

  1. Sketching possible options in one creative burst.

  2. Rationalizing to check for consistency internally and with requirements.

  3. Formalizing the chosen model using knowledge representation and corresponding data structures.

The process of specification becomes easier with practice, but we can follow some rough guidelines:

  • Starting with the outputs is often simpler. The rest of the solution can fall into place around them.

  • Selecting the inputs is a matter of determining what information is required to solve the problem. Thinking about this as programmers helps; the AI will need similar information.

  • It's a good idea to keep the specification very flexible to save us the hassle of having to update it during the application.

With a robust specification, all problems are easier to solve. The next chapter uses the specification for movement to create a simple working prototype that can navigate complex dynamic worlds using steering behaviors.

Practical Note

Diving back into developing movement behaviors, another animat demonstrates the flexibility of the specification. Sir Tank uses straightforward reactive behaviors to bounce off obstacles. This animat differs because its movement is dissociated from its orientation. This separates the movement capability from other capabilities, such as aiming, which will prove useful in the next parts . The demo and code is available online at http://AiGameDev.com/.


Chapter 10. Steering Behaviors for Obstacle Avoidance

Key Topics

  • Artificial Life Overview

  • Algorithm

  • Original Draft

  • Evaluation

A world interface for movement allows any AI solution to be developed. It's generally a good idea to start with a simple solution for three main reasons. First, the validity of the interface specification in a practical fashion is checked. Second, it will provide a reference prototype in no time. Third, there will always be a working demo to show the producers and other team members .

Steering behaviors can be applied to solve the navigation problem reactively [Reynolds99]. A wide variety of different steering behaviors exist, capable of controlling creatures individually or as part of a group . Steering behaviors take the form of relatively simple equations, one of which we're particularly interested in: obstacle avoidance.

This chapter covers the following topics:

  • The concepts behind steering behaviors, borrowed from artificial life

  • A slight modification of the obstacle-avoidance algorithm to match our requirements and fit into the framework

  • The solution in practice and theory, including a discussion of the pros and cons

This approach produces a surprisingly capable animat, which can avoid walls and steer around smoothly.

AI Game Development. Synthetic Creatures with Learning and Reactive Behaviors
Authors: Champandard A. J.
Published year: 2003
Pages: 78-80/399
Buy this book on amazon.com >>

Similar books on Amazon