AI for Game Developers

Front Cover
"O'Reilly Media, Inc.", 2004 - Computers - 371 pages

Advances in 3D visualization and physics-based simulation technology make it possible for game developers to create compelling, visually immersive gaming environments that were only dreamed of years ago. But today's game players have grown in sophistication along with the games they play. It's no longer enough to wow your players with dazzling graphics; the next step in creating even more immersive games is improved artificial intelligence, or AI.Fortunately, advanced AI game techniques are within the grasp of every game developer--not just those who dedicate their careers to AI. If you're new to game programming or if you're an experienced game programmer who needs to get up to speed quickly on AI techniques, you'll find AI for Game Developers to be the perfect starting point for understanding and applying AI techniques to your games.Written for the novice AI programmer, AI for Game Developers introduces you to techniques such as finite state machines, fuzzy logic, neural networks, and many others, in straightforward, easy-to-understand language, supported with code samples throughout the entire book (written in C/C++). From basic techniques such as chasing and evading, pattern movement, and flocking to genetic algorithms, the book presents a mix of deterministic (traditional) and non-deterministic (newer) AI techniques aimed squarely at beginners AI developers. Other topics covered in the book include:

  • Potential function based movements: a technique that handles chasing, evading swarming, and collision avoidance simultaneously
  • Basic pathfinding and waypoints, including an entire chapter devoted to the A* pathfinding algorithm
  • AI scripting
  • Rule-based AI: learn about variants other than fuzzy logic and finite state machines
  • Basic probability
  • Bayesian techniques
Unlike other books on the subject, AI for Game Developers doesn't attempt to cover every aspect of game AI, but to provide you with usable, advanced techniques you can apply to your games right now. If you've wanted to use AI to extend the play-life of your games, make them more challenging, and most importantly, make them more fun, then this book is for you.
 

Selected pages

Contents

1 Introduction to Game AI
1
Deterministic Versus Nondeterministic AI
2
Established Game AI
3
The Future of Game AI
4
2 Chasing and Evading
6
Basic Chasing and Evading
7
LineofSight Chasing
9
LineofSight Chasing in Tiled Environments
10
Further Information
164
9 Finite State Machines
165
Finite State Machine Design
168
Ant Example
170
Further Information
187
10 Fuzzy Logic
188
How Can You Use Fuzzy Logic in Games?
190
Fuzzy Logic Basics
192

Intercepting
20
3 Pattern Movement
27
Standard Algorithm
28
Pattern Movement in Tiled Environments
30
Pattern Movement in Physically Simulated Environments
38
4 Flocking
52
Classic Flocking
53
Flocking Example
55
Obstacle Avoidance
73
Follow the Leader
76
5 Potential FunctionBased Movement
80
ChasingEvading
82
Obstacle Avoidance
87
Swarming
89
Optimization Suggestions
94
6 Basic Pathfinding and Waypoints
96
Breadcrumb Pathfinding
101
Path Following
109
Wall Tracing
115
Waypoint Navigation
120
7 A Pathfinding
126
Starting the Search
128
Scoring
132
Finding a Dead End
141
Influence Mapping
146
Further Information
148
8 Scripted AI and Scripting Engines
149
Scripting Opponent Attributes
150
Basic Script Parsing
151
Scripting Opponent Behavior
154
Scripting Verbal Interaction
157
Scripting Events
162
Control Example
205
Threat Assessment Example
207
11 RuleBased AI
212
RuleBased System Basics
214
Fighting Game Strike Prediction
218
Further Information
226
12 Basic Probability
228
What is Probability?
232
Probability Rules
238
Conditional Probability
242
13 Decisions Under UncertaintyBayesian Techniques
244
What is a Bayesian Network?
245
Trapped?
249
Treasure?
254
By Air or Land
258
Kung Fu Fighting
262
Further Information
267
14 Neural Networks
269
Dissecting Neural Networks
274
Training
285
Neural Network Source Code
289
Chasing and Evading with Brains
305
Further Information
315
15 Genetic Algorithms
316
Evolutionary Process
317
Evolving Plant Life
321
Genetics in Game Development
327
Further Information
347
Vector Operations
349
Index
359
Copyright

Other editions - View all

Common terms and phrases

About the author (2004)

As a naval architect and marine engineer, David M. Bourg performs computer simulations and develops analysis tools that measure such things as hovercraft performance and the effect of waves on the motion of ships and boats. He teaches at the college level in the areas of ship design, construction and analysis. On occasion, David also lectures at high schools on topics such as naval architecture and software development. In addition to David's practical engineering background, he's professionally involved in computer game development and consulting through his company, Crescent Vision Interactive. Current projects include a massively multiplayer online role-playing game, several Java-based multiplayer games, and the porting of Hasbro's "Breakout" to the Macintosh.