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

Case Study

An essential part of navigation is the ability to avoid obstacles successfully. This accounts for many of the properties previously described. It's also a good place to start learning about game AI development because obstacle avoidance is a relatively simple task.

To understand how obstacle avoidance works, it is worthwhile to analyze the behavior in different situations. The following list is a representative selection of all the possible states that the game character may encounter. For each scenario, the situation is briefly described and the desired outcome is explained (see Figure 6.3):

Figure 6.3. Three different situations that require three different kinds of responses, ranging from quick turnaround to straight forward movement.

graphics/06fig03.gif

  • When no obstacles are in proximity of the animat, it can move forward normally. This can be either straight , or a wandering behavior.

  • In the case where walls are detected on one side, they should be turned away from slowly, in a preventive fashion.

  • If there is an obstacle in front, a turn should be engaged to clear the danger on one side.

  • For those situations where the animat is stuck in a corner, a more radical turnaround should be attempted.

This list of expected actions, together with the four criteria of motion explained previously, forms the requirements for our obstacle-avoidance behavior.

Summary

What has this chapter introduced about movement, and notably the different approaches to re-creating it?

  • Navigation is a skill that produces purposeful movement.

  • Biological creatures do well at navigation because they continuously perceive their environment and act accordingly .

  • Standard game bots generally use a static version of the world, often simplified. This can cause problems if the assumptions are erroneous, notably in dynamic environments.

  • Animats can sense their environment, so they can navigate dynamically. However, this approach in itself doesn't perform as well as the nonembodied approach, because it lacks global knowledge of the world.

The next chapter steps back and focuses on game AI development in general. Before continuing with our quest for autonomous movement, we're going to examine the process we've just been through: analyzing and understanding the problem. This will enable us to draft requirements in other situations when designing different AI components .

Practical Demo

A quick demo is in order to build up motivation to go through the next chapter. On the web site at http://AiGameDev.com/, in the Demos section, there's an animat called Bouncer. Follow the online instructions to run the example. Bouncer runs around monitoring its own movement. When forward movement is not what was expected, a collision is assumed. Bouncer then turns around in a random direction until it can move again. The source code is very simple and can be found alongside the demo.


Chapter 7. Analysis and Understanding

Key Topics

  • The Big Picture

  • The Analysis Phase

  • The Understanding Phase

  • General Advice

In any serious AI engineering process, the two first phases are analysis and understanding (or equivalents). Here, we lay the foundations for the rest of the AI development by describing what we already have, what we're trying to do, and how it's generally done. This is good software engineering practice generally , but it's especially important for the AI as the creation of behaviors is not as easily managed as software.

The analysis phase aims to investigate the game environment, the engine, and existing software used for the development (a.k.a. the platform). When the game engine is being developed in parallel with the AI, the analysis takes into account its design document instead -with little impact on the AI analysis. The understanding phase uses the high-level requirements and goals to analyze of the problem at hand, irrespective of the game engine and for the sake of the AI development only. Both stages are relatively informal, because we deal with English descriptions.

It's vital to spend some time on this for all problems tackled. Already at this stage of the development, we should have such thoughts on paper -or even in digital form. It's imperative to write them down somewhere (for instance, along with the development log) because they'll undoubtedly come in handy, and prevent us from forgetting them later -thereby wasting time revisiting closed issues.

This chapter covers the following topics:

  • A description of the big picture in the software, notably how the AI is split up; as well as the aspects of the AI dealt with by the first two software engineering phases

  • An explanation of the analysis phase, examining the platform to determine assumptions, restrictions, and guidelines.

  • A presentation of the understanding phase, describing the criteria (used to evaluate the desired outcome) and the definition of the problem using a case study

This chapter provides as much advice as possible to help deal with this informal process as rigorously as possible and to maximize its benefits.

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

Similar books on Amazon