Pacman AI

Started by
4 comments, last by Rodrigox17 21 years, 1 month ago
I''ve been trying to code a pacman ai, but i can''t get the ghost to find their way around the walls. So sometimes they get stuck. Is there anyone who has coded a pacman ai that could help me out????
Advertisement
I know there are documents detailing the AI used in pacman lurking somewhere on the net. You should search for them via google.

One thing you could do to resolve the getting stuck difficulty is have the ghosts only change their path when they reach an intersection. Otherwise they just keep following the passageway they are currently in. The only problem I can forsee is them getting stuck going back and forth from one intersection to another. Better than not moving I guess and you could have them never backtrack twice or something.
umm, only decide where the ghosts are going to move at the corners..(both on the map and in your corners)

now whatever way the ghost came from, make that an invalid choice..

         |  2 |--------    --------     1   GG->  3--------------------


SO GG(our green ghost) is going towards 3, so he must now make a choice, make 1 an invalid choice, because GG just came from 1.

       ------       |  ^ |       |  | |          | GG |--------    --------     1         3--------------------


our GG will continue intil he hits the wall, then reverse, when he gets to the corner, since he came from 2, he can only goto 1 or 3.

Hopefully, this helps...



~~~~~Screaming Statue Software. | OpenGL FontLibWhy does Data talk to the computer? Surely he's Wi-Fi enabled... - phaseburn
generally, at least one ghost follows the general path of the pacman- so if its path changes suddenly, so should the ghost''s. therefore, 1 should NOT be an invalid choice

ahh, I love TI-83 games.
If I remember correctly, one ghost always tried to follow the pacman. another tried to get the player at intersections, another watched those holes that you could go to reappear on the other side of the map, and the last one moved more or less randomly, just in the general direction of the player.

I may be wrong, but this is what I remember reading some time ago.
Gaiomard Dragon-===(UDIC)===-
quote:
generally, at least one ghost follows the general path of the pacman- so if its path changes suddenly, so should the ghost''s. therefore, 1 should NOT be an invalid choice



umm, nope, ghosts don''t back track, they do reverse every so many seconds, but if a ghost is going forwards, it will never turn around and go in the reverse direction. If they reversed, it would be impossible to trick them




~~~~~Screaming Statue Software. | OpenGL FontLibWhy does Data talk to the computer? Surely he's Wi-Fi enabled... - phaseburn

This topic is closed to new replies.

Advertisement