Maze Algorithm Showcase
This code is over 6 months old. The code may have expired and might no longer function.
This is a simple implementation of the origin shift maze generation algorithm.
The algorithm goes as follows:
- Start with a grid of nodes. Each has a direction property that can point nowhere, or to one of its neighbors.
- Initialize the grid to be any perfect maze, that being a maze with no loops or isolated areas. Each node should point to one neighboring node, with a single node, the origin node, pointing nowhere.
- Repeat the following steps for as many iterations as you'd like: 3a. Have the origin node, point to a random neighboring node. 3b. That neigboring node becomes the new origin node. 3c. have the new origin node point nowhere.
(Taken from CaptainLuma's Youtube Video)
There are some different toggleable effects to use, but the default code generates a 8x8 maze.
To change the maze size, go into the init variable and change maze width and maze height
It optimizes the amount of beams it generates as well :)
The bigger the maze, the longer time it takes, and usually if it is bigger than 10x10 you need to enable the wait inside the shuffle loop
Later i might use this to create some sort of infinite mei wall maze, but it would realistically never be that good.
Players |
1 - 12
Categories:
Tools,
Miscellaneous
Maps:
Workshop Expanse
Created at:
Last updated:
Current version:
1.0.0
Share URL:
https://workshop.codes/maze-algorithm