Chapter 13. Artificial Intelligence

KEY TOPICS

  • AI Basics

  • Take Away Those Godlike Powers!

  • State Machines and Reacting

  • Probability Machines

  • Making Decisions

  • Patterns

  • Object Spawning

  • Putting It All Together

  • Evolution

  • Other Game AI Ideas

  • Summary

One of the first games I ever tried to make was a Pac-Man clone. It had 16 colors, was written in BASIC, ran on a 486, and flickered—a lot.

But the point is, my first attempt at making the ghosts move was a little bit off the mark. Whenever a ghost would have to decide which way to go, it would always move in the direction of the player. This essentially made “super-ghosts” that were so good at tracking Pac-Man down that he rarely had time to eat a power dot. But if he was lucky enough get to a power dot in time, all the ...

Get Developing Games in Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.