The probabilities in the last two numbers are probably the most interesting to play with.
Mazes have been a longtime fascination of mine. I wrote my first maze generation program back around 1986, on a Dick Smith VZ200.
- Technically a single-solution maze such as is generated here is an undirected acyclic graph, with certain constraints applied.
- The inherent geometry of a square graph is the same as a hex graph, except that a hex map allows connections to six neigbours rather than four. In fact, the algorithm used here represents a hex graph internally as a grid.
- The 3D topology is now enabled. If you want to try the third dimension, I STRONGLY suggest you try a very small maze first. The 3D maze view includes a randomised goal.
- More interestingly, the algorithm is also easily adapted to a four dimensional space, where each square allows you to warp to one of two interconnected hyperdimensions.I’ve thought about trying to implement this but thinking about the space rotations in four dimensions in order to generate the first person view gives me headaches. What I may do instead is code the algorithm to only do fourth dimension transitions if a third dimension path is not available, then add “warp up” and “warp down” buttons to the UI.I will probably do this sooner or later. Navigating a hypercube is just too cool an idea to pass up. I doubt that I’ll carry the hex generation across to that however.
- The hex grid can be mapped trivially to a circular maze. (The center of the circle is the hex in the middle of the maze). I may or may not actually do this at some point. Calculating the arc segments isn’t inherently difficult but my last maths class was in 1988.
- This is the first nontrivial program I’ve implemented using PHP (although I’ve tweaked existing code in the past). Ditto Javascript (the PHP has a boatload of embedded javascript to render the 3D view).
I really like your work on the first-person 3D maze. There’s a project I’m working on that could be joined together with your script to make something pretty awesome. Comment on this if you’re interested in doing business. I’d rather not leave too many details out here.
Sure, I’m interested.
Do you want me to email you at the address you gave as a contact?
Absolutely