- 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!
- 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!