PacMan and related games

Does anyone know (or know of a site) the details of how the “ghosts” in Pacman decide to move?

  • do they make a random turn when they hit a wall?
  • do they randomly change direction without hitting walls?
  • are they move related to Pacman’s location (ie. some semi-smart tracking?)
  • some other smart or semi-smart alogrithm?

This isn’t specifically about Pacman, just using that as an exmple

I’ve been all over the net and can’t find anything specific

Hey Dave, not sure if this helps

I made a MsPacman clone and I think one of these links had the ghost behavior I used

Thanks… didn’t realize that those ghosts had so much going for them :slight_smile:

This is a good read, too :

Yes, this was a valuable, if not the most valuable link when making my clone but couldn’t find it. I remember spending days on the part about ‘cornering’. (’< • • • •

It never ceases to amaze me how ordinary players find out such complex bugs or idiosyncrasies just through playing the game. Probably says more about me than them …

It could be from looking at the source. I got the source from someplace, written in assembly for MariaOS; made sense of parts but ultimately didn’t help me much.

I thought the bit about 2pixels before/after on the corning was interesting… my app is not a PacMan clone, but the concepts are similar… but the method I used has a message queue… so the users says go right, but the actor is not centered on a tile, the message goes to an event queue… this queue is processed everytime the actor is “centered”… and so far it feels right in test play, the main actor will have a bit of an advantage still as the enemy won’t even evaluate their move until they are centered.