cover

How does a computer play games against you?

The Game AI Cookbook
How does a computer play games against you?
You press start, and suddenly you're racing a computer driver who knows every turn, fighting a computer opponent who nev

You press start, and suddenly you're racing a computer driver who knows every turn, fighting a computer opponent who never blinks, solving puzzles against a computer that seems to read your mind. But here's the thing: the computer isn't actually thinking about beating you. It's following recipes — very clever recipes — that make it look like it's playing.

The simplest recipe is called "if-then." If you move left, then the computer moves right. If you jump, then the computer ducks. The game programmer writes thousands of these rules ahead of time, like a giant cookbook. "If the player is close, run away. If the player is far, chase." The computer just reads the recipe and follows it, lightning-fast.

How was this book?