Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Classic Games (Games) Games

Pac-Man's Ghost Behavior Algorithms 194

An anonymous reader writes "This article has a very interesting description of the algorithms behind the ghosts in Pac-Man. I had no idea about most of this information, but that's probably because it's difficult to study the ghosts when I die every 30 seconds. Quoting: 'The ghosts are always in one of three possible modes: Chase, Scatter, or Frightened. The "normal" mode with the ghosts pursuing Pac-Man is Chase, and this is the one that they spend most of their time in. While in Chase mode, all of the ghosts use Pac-Man's position as a factor in selecting their target tile, though it is more significant to some ghosts than others. In Scatter mode, each ghost has a fixed target tile, each of which is located just outside a different corner of the maze. This causes the four ghosts to disperse to the corners whenever they are in this mode. Frightened mode is unique because the ghosts do not have a specific target tile while in this mode. Instead, they pseudorandomly decide which turns to make at every intersection.'"
This discussion has been archived. No new comments can be posted.

Pac-Man's Ghost Behavior Algorithms

Comments Filter:
  • by camperdave ( 969942 ) on Friday December 03, 2010 @07:14PM (#34438986) Journal
    A.K. Dewdney came up with a similar idea back in 1984. It's called corewars [corewars.org].
  • by Anonymous Coward on Friday December 03, 2010 @07:25PM (#34439102)

    I read somewhere If pac-man leaves tile A entering tile B on the same clock pulse as a ghost leaving tile B enters tile A, the machine will switch their positions on that pulse; they never occupy the same tile.

  • Breaking news!!!! (Score:5, Informative)

    by mrsam ( 12205 ) on Friday December 03, 2010 @07:32PM (#34439170) Homepage

    Yawn... This stuff that already been posted on the Pacman Dossier [comcast.net] for years. Not really "news for nerds".

    Now, what would really be "news for nerds" is the analysis of the ghosts' behavior in Google Pacman [google.com], which is very similar, but subtly different.

    Of course, since Google Pacman's source is available, this can theoretically be deduced straight from the source, but it's more fun to figure it out by trial and error. Great timekiller. There are definitely notable differences -- like certain directions the ghosts will never turn to if they enter the intersection from one direction, but will if they enter the same intersection from the opposite direction.

  • by Anonymous Coward on Friday December 03, 2010 @07:33PM (#34439174)

    Well, the behavior is complex in today's games, but the algorithms are not. The behavior trees are hand-scripted IF/THEN/ELSE for the most part. Then otherwise for the most part it's a bit of pathfinding and other simple AI techniques and the AI itself is not really that impressive.

  • by VortexCortex ( 1117377 ) <VortexCortex AT ... trograde DOT com> on Friday December 03, 2010 @09:57PM (#34440460)

    Following exact patterns work because that generates the same exact pseudo-random number pool that the ghosts use to pick directions.

  • by fishexe ( 168879 ) on Saturday December 04, 2010 @12:53AM (#34441372) Homepage

    It's awful that some people have gone so far off the deep end that simple jokes cannot be told without questioning their intentions.

    I don't think anyone was questioning the intentions. They were questioning the effects that such jokes have on the culture, particularly when they are so one-sidedly against women all the time. It's great that you're an equal-opportunity offender and I salute that, but the FOSS community as a whole is not. Even if the individual jokes themselves are all meant in good fun, taken together they create a boys'-club atmosphere that is not healthy to the growth of the community.

    On the other hand, folks are overly sensitive about some things. No one granted anyone the 'unalienable right' to not be offended. Some shit offends me too, but I get over it.

    I would re-read the link notionalTenacity posted. It isn't about safeguarding the right not to be offended, because of course no such right exists. It's about creating an environment that encourages all to participate, which is not something we have a "right" to but would be a very smart thing for the FOSS community to foster.

    Have you tried getting over it and trying to have a sense of humor? Not about things like the dude sticking his hand down the chick's pants....that's messed up and he should at least have the hell beaten out of him a few good times for it. About things like "hur hur, women ain't got no direction smarts!"

    You don't think the two are related? Really, would a man really try to stick his hand down a woman's pants at a conference where people didn't make repeated jokes about the entire female sex and there weren't pictures of women in bikinis in the presentations? One sexist joke is harmless, if it's the only one, but that kind of pervasive behavior creates an environment where men literally think, "these women are here to pleasure me, not to participate in tech talk", and that mindset leads directly to the odd one attempting the ol' scoop-n-grab.

Neutrinos have bad breadth.

Working...