4 ms·
With a one-off precomputation you can do a lot. If you store the distance to exit in each cell you can introduce a slight bias towards the exit. Easy to impleme
by remcob 6y ago
With a one-off precomputation you can do a lot. If you store the distance to exit in each cell you can introduce a slight bias towards the exit. Easy to implement but not very realistic since it assumes things the guests can not know.
More realistic would be observing that the entry and exit are on the outer edge and the maze is simply connected, so a trivial left-hand rule [1] will solve the maze in linear time. On its own pretty boring. You could ad some randomness to make it interesting. But would it still have linear expected solving time if you do that?
[1]: https://en.wikipedia.org/wiki/Maze_solving_algorithm#Wall_follower https://en.wikipedia.org/wiki/Maze_solving_algorithm#Wall_fo...
- qznc 6y agoMight also give the guests a slight tendency to get away from each other so they tend to spread all over the maze. That might look nicer to the player. Not too strong though otherwise every guest stays in their own dead end.
- DuskStar 6y agoTracking what tiles the guest has been to and disallowing travel in a direction that does not lead to any unvisited tiles while keeping behavior otherwise random would be my preference.