Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

asdasd12345

PacMan ghost AI

This topic is 5407 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to build a pacman ghost AI that is completely not dependent on anything random. One of the parts I want to write for the ghost AI is to be able to tell it to go to a specific tile, and then have it figure out automatically how to get there. Does anyone know how I could do this? So I could write Ghost.GoToTile(13,5); and it would do it.

Share this post


Link to post
Share on other sites
Advertisement
just an other proposition idea:
what if you would just make a "follow the direction where pacman is" ai?
I mean, every time it has the choices between 2 or more pathes, it''ll take the one corresponding to pacman''s direction. If pacman is on the left, then go to the left path, that''s all.
Some ghosts could also have a "horizontal move" priority, or a vertical one or just some compromizes like the direction in which lies the most distance between him and the pacman.
just an idea...

Share this post


Link to post
Share on other sites
quote:
Original post by misterX
just an other proposition idea:
what if you would just make a "follow the direction where pacman is" ai?
I mean, every time it has the choices between 2 or more pathes, it'll take the one corresponding to pacman's direction. If pacman is on the left, then go to the left path, that's all.
Some ghosts could also have a "horizontal move" priority, or a vertical one or just some compromizes like the direction in which lies the most distance between him and the pacman.
just an idea...


It'll be too easy. The ghost will just follw pac-man around.

Or it'll be too hard

As for the direction stuff, you can look up A* (A-star), but that might be overboard for a pacman clone. Other than that, I would think just a little bit of thinkig, and you should be able to solve it.

[edited by - beernutts on February 26, 2004 10:38:42 PM]

Share this post


Link to post
Share on other sites
at every junction in your map, place a node, and create a path-map by connecting all nodes that ''adjacent''

then use a Shortest-Path algorthm to find the best way to get from where you are to where you want to go.

Add a filtering system that lets you weight edges depending on arbitrary characteristics (i.e. defined by the caller of SPT) and then you can have ghosts who prefer to move horizontally rather than vertically and vice versa. Another thing you should try is mark nodes where pacman has been recently, and have one ghost interpret those nodes as very expensive, that way, that ghost will always try to get to pacman using a route that pacman did not come from (i.e. cut him off from the front)

Google "Shortest path tree"

George D. Filiotis

I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites
if you search the AI forum, you can find the exact behavior of the ghosts in pacman (each one has a different way of chasing pacman)... this has been asked a billion times already.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It should be noted that the original pacman''s AI had 3 different ghost AI''s..

There was the smart ghost, the not so smart ghost, and the dumb as a stump ghost. And they never did anything "randomly" - that is.. if you repeated the exact same moves on a particular level the ghosts would also repeat their exact same moves. Once you got up to the highest level you could repeat the exact same pattern and win level after level...

- Rockoon

Share this post


Link to post
Share on other sites
1) A gohst that moves about at random
2) A ghost that tries to follow pacman
3) A ghost that tries to cut pacman off
4) A ghost that goes where the majority of the pellets are


I think this sums up pacman ai.

Share this post


Link to post
Share on other sites
I''ve read that Pac-man AI, everything from 1 - 3 from try_catch_this is what I heard, and then for the 4th ghost, he stays around the centre of the map close to the portals that put pac-man on the other side of the screen.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!