
Understanding Pac-Man Ghost Behavior (2010) - shawndumas
http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior
======
chriswarbo
One nice approach to programming the ghosts is "collaborative diffusion":
[http://sgd.cs.colorado.edu/wiki/Collaborative_Diffusion](http://sgd.cs.colorado.edu/wiki/Collaborative_Diffusion)

\- Associate each tile with a "pacman-ness" value, which will be calculated
iteratively

\- The tile containing pacman is held at the maximum value

\- Tiles containing walls or ghosts are held at zero

\- Every other tile's value is the average of its neighbours' on the previous
iteration

By hill-climbing this value, the ghosts will follow the shortest path to
pacman. Also, since the ghosts act like walls, they will avoid following each
other and instead converge on pacman via different routes.

I made a Python implementation years ago, and it was impossible to avoid
capture!

~~~
meatysnapper
What about a Bayesian search?

------
ghostDancer
The Pacman
Dossier:[https://home.comcast.net/~jpittman2/pacman/pacmandossier.htm...](https://home.comcast.net/~jpittman2/pacman/pacmandossier.html)

------
SQL2219
Pac-Man goes Lego:

[https://www.youtube.com/watch?v=01CDZMjj1Oc](https://www.youtube.com/watch?v=01CDZMjj1Oc)

------
panic
This page: [http://gameinternals.com/post/2072558330/understanding-
pac-m...](http://gameinternals.com/post/2072558330/understanding-pac-man-
ghost-behavior) has even more on Pac-Man ghost behavior (and many fewer ads).

~~~
dang
Ok, we changed the url to that from
[http://www.todayifoundout.com/index.php/2015/10/ghosts-
pac-m...](http://www.todayifoundout.com/index.php/2015/10/ghosts-pac-man-
work/). Thanks.

Edit: It was posted at the time:
[https://news.ycombinator.com/item?id=1963553](https://news.ycombinator.com/item?id=1963553).

~~~
wingerlang
I was confused as to why just today I found two separate links on the same
subject. Probably clicked the initial link.

The todayifoundout version credits the older article though.

