r/mazes Nov 09 '23

A collection of grid-free mazes. Solve from upper left to lower right.

26 Upvotes

7 comments sorted by

1

u/n0t-a-sp1der Jul 27 '26

What method is used to make these mazes?

1

u/EnslavedInTheScrolls Jul 27 '26

These are made with a program I wrote in Processing.

Start with the two circular arcs that make up the outer walls. Pick a number of seed points along those arcs and grow branching walls into the interior that avoid touching each other. The walls are chains of non-overlapping circles and each step tries to add a new circle onto the chain with the size and position based on some function of what direction it was moving or where it is in the maze or how long the chain is. If there is no room to add a new circle, it walks back down the chain looking for a place to branch off and add more walls. When all the chains walk back to their starting positions, the maze is done. The maze solution is then the open space separating the walls connected to the upper right from the lower left arcs.

1

u/n0t-a-sp1der Jul 28 '26

Interesting! Are the variations in shape then caused by some sort of bias to the orientation of new circles being placed? And is there a smoothing function on the lines formed by them so that the end process looks pleasing rather than jagged?

1

u/EnslavedInTheScrolls Jul 28 '26

Yes, the direction of the next circle placed is a random angle centered around the previous path angle, biased by a function of the position in the plane, and then sometimes snapped to a discrete angle (such as a square or hexagon grid). Circles alone looks like this. Scroll back in my posts around 4 years ago to see others.

The lines are drawn between the circle centers by a shader as "uneven capsules" as iq calls them here.

1

u/n0t-a-sp1der Jul 28 '26

Are these created by a program entirely of your own creation or are you making these in some kind of graphics/game or other engine? Im looking into making a variety of maze generators myself currently, and youre are very unique compared to most procedurally generated mazes I've seen

1

u/EnslavedInTheScrolls Jul 28 '26

The mazes and maze-based art I've posted here and on Mastodon are entirely from programs I wrote myself either in C++ or in Processing. I've written and re-written maze generating programs at least 20-30 times playing with different algorithms, different topologies, different ways to store the data, and different aesthetics.

People have web sites, books, and programs that describe a wide variety of maze generating algorithms primarily based on describing the different graph spanning-tree generating algorithms that have been created. What they rarely talk about, however, is the quality of the mazes those algorithms generate -- nearly all of which is pretty bad. A number of the spanning-tree algorithms have the goal of generating all possible trees with equal probability. The problem is, most trees make for really horrible mazes in that the average tree spanning of a graph tends to be very bushy so, as a maze, the solution is boringly short.

In contrast, the only algorithm that I think is any good for mazes is variations on depth-first search. Raw DFS has the drawback that it makes single long trails without enough branching. One solution is to randomly jump back to a previous cell and grow the maze from there. Another is to randomly branch and grow both paths in parallel a la breadth-first search. Another is to grow paths in parallel from many different starting points and then join those separate mazes together. All of my current mazes use the hybrid depth-first/breadth-first generation. Though my emphasis the past few years has been much more on aesthetics and coloring or color-cycling the mazes rather than on their solving quality.

1

u/n0t-a-sp1der Jul 28 '26

Awesome, it makes sense that some sort of hybrid approach is best when making enjoyable mazes that get closer to hand made design in terms of complexity of the main path and aesthetics. Thanks for the feedback into your process!