Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pacman - ghosts path finding

145 views
Skip to first unread message

Michael Haller

unread,
Apr 17, 2001, 6:34:21 AM4/17/01
to
hi all!

I have to implement the pacman game. No, I'm looking for some ideas
about the path-finding algorithm of my ghosts. Well - I could use a
simple BFS-algorithm. But are there some better ideas? Are there some
ideas/homepages about this problem?


Many thanks in advance,
Michael.

Justin Heyes-Jones

unread,
Apr 18, 2001, 11:49:16 AM4/18/01
to
My page covers this in tutorial form...

http://www.geocities.com/jheyesjones/astar.html

"Michael Haller" <hal...@fhs-hagenberg.ac.at> wrote in message
news:3ADC1C2D...@fhs-hagenberg.ac.at...

Gregorys

unread,
Apr 22, 2001, 5:15:13 PM4/22/01
to
I have tried without success in the past to find the actual algorithm used
by the ghosts in the original pacman. As you may know, it is not straight
pathfinding.

I have never been able to find it. Please let me know if you do.

Thanks!


"Michael Haller" <hal...@fhs-hagenberg.ac.at> wrote in message
news:3ADC1C2D...@fhs-hagenberg.ac.at...

Someone

unread,
Apr 22, 2001, 6:32:14 PM4/22/01
to
A web search on "Pacman" NEAR "source code" returned 46 web page
hits. In looking at a few of them, I saw implementations in java and c++.
So, if you don't mind pacman-clones you might try doing a web search?

Eric

Gregorys <greg...@dca.net> wrote in message
news:BRHE6.23246$B22.5...@news1.rdc2.pa.home.com...

Gregorys

unread,
Apr 25, 2001, 8:45:47 AM4/25/01
to
I have searched many clones. I still haven't found the ORIGINAL ghost
movement algorithm.

If you have seen that in one of them, please let me know.

Thanks!

"Someone" <wh...@there.com> wrote in message
news:9bvm5e$c...@dispatch.concentric.net...

Roald Hopman

unread,
Apr 25, 2001, 7:03:46 PM4/25/01
to
How would I recognise :)
I think there are more solutions that create approx the same effect.

Roald

"Gregorys" <greg...@dca.net> schreef in bericht
news:%FzF6.29721$B22.6...@news1.rdc2.pa.home.com...

Richie M

unread,
Apr 27, 2001, 7:16:55 PM4/27/01
to
I remember someone in one of the comp.games.* groups (or such-like) posting
details of what they claimed was the original algorithm, last year sometime.

I've just done a search in deja.com (or google groups as it's called now)
and turned up several previous conversations on the topic going back years.
And I've only checked the comp.ai.* groups. The comp.games.programming
groups may have more.

The following (posted by Rod Jackson on 22/7/98) seems to be the most likely
algorithm for the original:

PAC MAN was the first game to feature enemies which seemed to team up
against
you. This was programmed by giving each ghost a different strategy. One
would
always chase the player, to keep him moving (called The Driver). A second
(the fastest) would follow a purely random path. A third one (The
Interceptor) had a list of IF..THEN tactics at his disposal, so for example,
IF the player ran into the tunnel to shake off the driver, the interceptor
would enter the tunnel from the other side. Gotcha! The fourth ghost would
try to always guard the power pill that the player is closest to, to prevent
the player counter-attacking. NOTE: Most consoles PAC MAN clones did NOT
feature AI like that.


Richie

"Gregorys" <greg...@dca.net> wrote in message

news:%FzF6.29721$B22.6...@news1.rdc2.pa.home.com...

Gregorys

unread,
Apr 28, 2001, 7:46:05 AM4/28/01
to
Thanks! That's the most specific I've seen.

"Richie M" <rich...@eidosnet.co.uk> wrote in message
news:I5nG6.11702$662.35647@news1-hme0...

Jeff Somers

unread,
May 1, 2001, 9:00:58 AM5/1/01
to
On Wed, 25 Apr 2001 12:45:47 GMT, "Gregorys" <greg...@dca.net> wrote:

>I have searched many clones. I still haven't found the ORIGINAL ghost
>movement algorithm.
>
>If you have seen that in one of them, please let me know.
>
>Thanks!

In "Programmers at Work" by Susan Lammers:

From the interview of Toru Iwatani, designer of Pac Man:

Interviewer: What was the most difficult part of designing the game?

Iwatani: The algorithm for the four ghosts who are the enemies of the
Pac Man -- getting all the movements lined up correctly. It was
tricky because the monster movements are quite complex. This is the
heart of the game. I wanted each ghostly enemy to have a specific
character and its own particular movements, so they weren't all just
chasing after Pac Man in single file, which would have been tiresome
and flat. One of them, the red one called Blinky, did chase directly
after Pac Man. The second ghost is positioned at a point a few dots
in front of Pac Man's mouth. That is his position. If Pac Man is in
the center then Monster A and Monster B are equidistant from him, but
each move independently, almost "sandwiching" him. The other ghosts
move more at random. That way they get closer to Pac Man in a natural
way.

When a human being is constantly under attack like this, he becomes
discouraged. So we developed the wave-patterned attack--attack then
disperse; as time goes by the ghosts regroup and attack again.
Gradually the peaks and valleys in the curve of the wave become less
pronounced so that the ghosts attack more frequently.

jeff somers

Gregorys

unread,
May 1, 2001, 8:08:30 PM5/1/01
to
Cool! Thanks!

"Jeff Somers" <lius...@rcn.com> wrote in message
news:DLHuOj1jsQC9Gn...@4ax.com...

Walnut

unread,
Jul 16, 2001, 8:03:37 AM7/16/01
to
For PacMan to be a true Artificial Intelligence game, the ghosts
should not be allowed any other knowledge than what they glean by
sighting Pacman at the end of corridors or passing gaps in the walls!!
In addition, the ghosts should have no advance knowledge of the layout
of the maze or the game other than what to do when they reach a wall
and the knowledge of what strategies to follow to pursue. They should
start patroling and when they sight pacman make moves accordingly.

Ed Halley

unread,
Jul 19, 2001, 9:25:48 PM7/19/01
to
Walnut <wal...@froggy.com.au> wrote in message news:<tic0lt8aairqth8hi...@4ax.com>...

> For PacMan to be a true Artificial Intelligence game, the ghosts
> should not be allowed any other knowledge than what they glean by
> sighting Pacman at the end of corridors or passing gaps in the walls!!
> In addition, the ghosts should have no advance knowledge of the layout
> of the maze or the game other than what to do when they reach a wall
> and the knowledge of what strategies to follow to pursue. They should
> start patroling and when they sight pacman make moves accordingly.

I disagree.

The computer players should not have information that the player does
not have, true, but they should have exactly the same level of
information. The player sees the whole maze and the pawns (pac +
ghosts), so the opponent A.I. can see the whole maze and the pawns
(pac + ghosts). The player can memorize the landscape and strategize
before the game, so the A.I. should be able to do this, also. If you,
the player, could only see down the current corridor, then I would
agree with your premise. That is not the case.

Pac Man is an open game (everyone sees all pertinent facts). However,
there are games like Risk and Poker that do not show all information,
and this is the kind of game where it is terribly unfair for the A.I.
to peek, just because the adjudicator memory and rules are also in the
same memory space.

Penguin_Lad

unread,
Jul 20, 2001, 10:39:40 AM7/20/01
to
Wow, what a great project you could get out of creating ghost AI!

Some ghosts could have better memory than others, thus once they have been
round the course they remember it. Other ghosts may forget some sections of
the course.
Others may forget, and panic.
When ghosts meet, they could exchange knowledge onto each other, about the
course, and the last location of Pacman. The accuracy of the course
knowledge that is passed on, would be determined by the ghosts communication
skills.

FANTASTIC! You could go on for ages...by giving each ghost differing
variables, and combining it with AI elements, they'd kill Pacman in no
time...

Hmm perhaps he needs some help. Introducing a "rogue" ghost, that gives
false information to the others when they pass, would make it interesting.

The normal ghosts could eventually work out who is the rogue ghost, by
looking at the information given by him, compared to where pacman turns up
next. Then they turn on the rogue and kill him.

I suppose a rogue ghost could sometimes give REAL info, if he thought he was
going to get caught...you could actually see a REAL ghost killed by his
friends, if they all decide he is the rogue.

wowza...there's an A-level project in there somewhere...

"Walnut" <wal...@froggy.com.au> wrote in message
news:tic0lt8aairqth8hi...@4ax.com...

0 new messages