The static solution can be calculated by solving the Poisson equation. In [1] you can see a small implementation of the idea.
The static solution can be calculated by solving the Poisson equation. In [1] you can see a small implementation of the idea.
A classic example is programming the ghosts in pacman to trap the player, which seems to require a sophisticated, collaborative strategy. Instead, a much simpler solution is to make a "pacman smell" diffuse through the maze:
- The cell containing pacman has its "smell" clamped to 1
- Cells containing walls and ghosts have their "smell" clamped to 0
- The "smell" of an empty cell is the average of its neighbours
This way, dumb hill-climbing will move the ghosts along the fastest route to the player. "Collaborative" behaviour emerges from the "smell" being clamped to 0 by ghosts: if a route to the player is already blocked-off by a ghost, those behind will not get any "smell" from that direction, and will take other routes instead; effectively cutting-off all of the escape routes. (I implemented this in Pygame many years ago, and it was no fun to play, since the ghosts were way too smart!)
1: http://www.roguebasin.com/index.php/The_Incredible_Power_of_...
Funnily enough he uploaded a video two hours ago that shows what it looks like.