Due to my fascination for algorithms, I created an advanced plugin that generates mazes within seconds from a set of custom properties.
This plugin is perfect for dungeon crawlers, puzzle games, or possibly even a backrooms game.
The algorithm
The plugin uses a greedy version of the Depth-First Search algorithm. Normally this algorithm will start somewhere and then visit one of its neighbouring cells until it has no neighbours to choose from. It will then backtrack along its path until it comes across a cell that has a neighbour again, and it will then start carving from there. While this is a decent way of generating mazes, it comes with several flaws and results in less organic-looking mazes. This is why I added random backtracking, meaning it will sometimes go back a few cells and start carving from there instead of following a path until it can not find a neighbour anymore. This results in better-looking mazes with a lot more dead ends.
The plugin has an easy-to-use editing system with a grid and comes with the following properties/settings that you can manually set as the user.
Grid
- Length - amount of cells along the Y-axis of the maze
- Width - amount of cells along the X-axis of the maze
Walls
- Length - length of the wall in studs
- Thickness - thickness of the wall in studs
- Height - height of the wall in studs
Settings
- Borders - determines if the maze should have an outer wall
- Merge Walls - determines if adjacent walls should be merged for optimization
- Density - determines the amount of inner walls
- Seed - unique ID that allows recreation of a certain maze
Showcase
The plugin is completely free to install so please consider leaving a review or favorite if you have time. If you have any feedback, suggestions, or bug reports feel free to comment down below.
Link: https://create.roblox.com/store/asset/16686022313/Maze-Generator