▲ | Maze Generation: Recursive Division (2011)(weblog.jamisbuck.org) | |||||||||||||||||||||||||||||||||||||
46 points by homarp 6 months ago | 12 comments | ||||||||||||||||||||||||||||||||||||||
▲ | spencerflem 5 months ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
My favorite maze algorithm is this one: https://cs.wellesley.edu/~pmwh/papers-fcpcg/presentation/sli... Live demo at: https://cs.wellesley.edu/~pmwh/hydrodendron/ It allows generating an infinite maze looking at any arbitrary area of the maze, without any loops, using fractal coordinates | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
▲ | vintagedave 5 months ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Remarkably simple with great results. I recommend checking out the author’s book Mazes for Programmers: one of the best programming books I’ve ever read. Incredibly clearly explained, and very interesting, which is an excellent combination. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
▲ | hinkley 5 months ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Reminds me a little of Hilbert curves. It would be kind of cool to generate an 'infinite' maze this way by starting the process and only recursing to max depth only for the nodes closest to the exits. | ||||||||||||||||||||||||||||||||||||||
▲ | hyperman1 5 months ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
One problem with all these maze algorithms is how they are completely random. When a human creates a maze, he might start with the solution, then add a few false paths that end near the finish but just fail at the last step. Maybe a few loops are added, or a picture or special features are integrated. Only at the very end, the leftovers are filled in with random data. The process is a design, not a random generation. Are there any algorithms available that do similar things? | ||||||||||||||||||||||||||||||||||||||
▲ | Dwedit 5 months ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
My favorite maze generation algorithm was the really simple one where you have a cursor, you push your coordinates to the stack, then remove a wall to a random unvisited square that's adjacent to the cursor. When you run out of possible choices for an unvisited square, you pop coordinates from the stack. Mazes generated by this algorithm tend be easy to solve, with long paths and short dead ends. |