🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

PacMan

Started by
2 comments, last by mr2071 22 years, 1 month ago
I was playing Gaunlet on the gamecube the other day and was noticing how the enemies always get stuck behind walls and how this was never a problem in PacMan. Can anyone explain how the enemies worked in PacMan? I thought at first, maybe that once you got within a range of the enemies, they started coming after you but now that I think about it, they seem to always head in your direction but never get stuck behind walls. How is this accomplished? Mainly, how do they know which way to turn once they hit a wall and can''t move closer to the PacMan? Is there some sort of pathfinding algorithm for this? Thanks!
Advertisement
Original pacman:

1 Ghost heads toward pacman via the shortest route (w/ pathfinding''

1 Ghost heads toward the next junction along pacman''s current path. (Also pathfinding)

1 Ghost tried to prevent you from using the screen wraparound tunnel.

1 Ghost just wandered around randomly (which meant about 1/4 of the time he''d be right in the corner you wanted to go to.)

Of course, not all pacman clones followed the same formula.
First of all, the creatures never stop.

Second, they don''t block each other.

Third, there are no real dead ends in the maze.

Sometimes they reverse direction but not often. They just continue to make decisions at each intersection.

In Gauntlet, there was little AI to guide the creatures to the characters except for a simple straight line movement algorithm. If it ran them into a dead end, they didn''t know to back up, AND they block each other.

It''s just a matter of how the gaming mechanic creates an emergence of overall behavior.
It's not what you're taught, it's what you learn.
Hey,

One thing I think needs to be pointed out is that the ghosts only seemed to change direction when they met an intersection. Otherwise the first ghost that just goes directly to where pacman is would eventually have to catch you, but if he only does this pathfinding search when he reaches an intersection it gave the player an actual chance to get away from him, but still made it difficult.

Doolwind

This topic is closed to new replies.

Advertisement