Foreword

 

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 “programmer’s drink” and find yourself a nice, cozy chair with your favorite laptop close at hand. You’re about to go a’learn’in.

Welcome to 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 programmer might be wondering about without bogging down in computer science minutia, 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 towards the end of a project 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 which 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 looking 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 Developer’s Conference AI round-tables, 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 terms that a programmer could understand, there are now dozens. Where a few years ago we weren’t at all sure we could fill a single room at the GDC with people interested in talking about the techniques they used to build game AI engines, we now have to turn people away—we just can’t fit everybody in the sessions. Where there were once only a small very small number of web pages dedicated to game AI on the Internet there are now more than I can easily count—a quick Google search as I write this showed over a hundred dedicated in whole or in part to the topic. Amazing, absolutely amazing.

And every one of the developers who visits these pages, who comes to the round-tables, who buys the books, is interested in the same thing:

 

·        What techniques do other developers use?

·        What technologies have other developers found useful?

·        What do different games do for AI? Are they all faking it, does everybody do the same thing, or is there room for improvement?

·        What are the stumbling blocks that others have run into so I’m not surprised? More importantly, what are the solutions other people have developed so that I don’t have to?

·        How can I make my AIs smarter?

·        Most importantly of all, how can I make my AIs more fun?

 

This book is for those people. The ones who seek hard, practical examples and hard, practical answers. There’s more than pure theory here; this book is about  real techniques with real, working examples.

About time, huh?

 

By Engineers, For Engineers

The most important thing to a good software engineer is to know about techniques that work and why. Theory is great but demos and code are better….a developer can get right into the code and see why something works and how it might be adapted to his own problem. This is exactly the kind of thing that game AI developers have been pounding the walls for at every GDC AI round-table. And this book delivers exactly this kind of information, and in spades.

From the initial chapters covering the sturdy Finite State Machine (FSM) to the chapters exploring the more exotic areas of Fuzzy Logic (FL), Mat has built a text that will serve as a ready reference and source of learning for a long time to come. Every major technique in use by developers is covered here, using the context of an innovative agent-based AI engine called Raven to show how a given approach works and why. Basic reactionary behaviors are the most obvious ones and Mat covers them in exhaustive detail, with code showing each evolutionary iteration and demos to help it all make sense.

Mat doesn’t stop there as many books do, however. Example moves on to cover deeper approaches such as heirarchical goal based agents, placing such technologies in the context of the Raven engine and building on previous examples to show how they can greatly improve a game’s AI. These are techniques in use in only a handful of games on the market today but they can make a game’s AI truly stand out if done properly. This book will show you why they make a difference and how to use them. Mat even provides tips for better implementations than used in his examples and summarizes potential improvements to the techniques covered. To this end he offers up the occasional practical exercise to point the interested developer in ways to make a given technique better, helping the reader to focus on how they might use the technology in their own game. After all, code is never done, it’s just done enough.

All of this makes Game AI by Example a book I think you’re really going to find useful. If you’re looking for hard code and real techniques, for a book that covers what game AI developers are really doing and how, then this is the book for you.

Have fun.

 

Steven Woodcock

mailto:ferretman@gameai.com


Home