Draw the blinds. Turn off the TV set. Shut off your cell phone. Turn on a
little background music. Pour yourself a cup of your favorite “program
mer’s drink,” and find yourself a nice, cozy chair with your favorite laptop
close at hand. You’re about to go a-learnin’.
Welcome to Programming Game AI by Example.
I must confess I was surprised when Mat contacted me back in 2003
about this book. I wondered to myself, “He already covered all of the new
techniques pretty well…what more is there to do?”
As we exchanged emails Mat expressed that he had a simple desire to
follow up on his first book, AI Techniques for Game Programming, with
something having a completely different focus. Whereas Techniques
explored the more “exotic” biological technologies that a game AI pro-
grammer might be wondering about without bogging down in computer
science minutiae, Mat wanted Example to focus more on what technologies
are actually being used by most game AI programmers in their day-to-day
work. New technologies and new approaches are always to be considered
when it makes sense to do so of course, but developers must always have
the basics at hand to build a firm foundation for any game AI engine.
That’s what this book is all about.
The Surge of Game AI’s Importance
Game AI has undergone a quiet revolution in the past few years. No longer
is it something that most developers consider only toward the end of a pro
ject when shipping deadlines loom and the publisher is pushing to have the
game ship before the next holiday milestone. Now game AI is something
that is planned for, something that developers are deliberately making as
important a part of a game’s development as the graphics or the sound
effects. The market is rife with games of all kinds and developers are look
ing for every edge they can get to help their game get noticed. A game with
truly smart opponents or non-player characters is one that gets noticed
automatically, no matter what it looks like.
We’ve seen this in the enormous growth in books on the subject, in the
surge in attendance at the Game Developers Conference AI roundtables,
and in the explosion of game AI web sites across the Internet. Where a few
years ago there were only a handful of books that covered AI techniques in