Looking into:
maze generation - DFS
A* algorithm
genetic algorithm
minuet activity
After a lot of research, it seemed like prim's would be optimal for this. This creates a maze with only one solution/fastest path to any point. You can also get to any point from every other point.
Took me around 4.5 hours to make the basics, more to add stuff(see below), followed pseudo code from https://cantwell-tom.medium.com/prims-algorithm-as-a-maze-in-javascript-aec7415ad2cd but wanted to make the code myself. Had to learn how to use sets.
Click to generate maze using Prim's algorithm.
In this one, red dots are points where all adjacent edges were already visited. This isn't every end point, but it's only end points, so it works if these are where treasure or monsters are.
Here is a version on a smaller scale, possibly for laser cutting, points with 3 or 4 adjacent edges are marked to generate more treasure spots. The black lines indicate where I could possible break this into pieces.
A problem is that DND maps are usually not pure mazes. Like sometimes you want bigger rooms. I made this maze generator before the one above. It does not work as well and I don't like how it looks compared to the other ones. It's more like one path that just goes to the closes point, but it does have cycles(they aren't really cycles in the algorithmic sense, they are just where the path overlaps) which you could interpret as bigger rooms. I made this by copying code from https://www.freecodecamp.org/news/prims-algorithm-explained-with-pseudocode/, and I had to learn how to use objects in java script, took me a while. I think I will go with the maze gerator above, I like the look better.
LITTLE MAZE, use WASD
now you can pick out of 3 of the vertecies in the frontier set to be the next vertex. use number keys
What it would look like on an LED panel (use R,G,B,Y for respective colors):
Turned the code into c++ code because arduino is in c++ (makes a text based maze), but I'm having issued making it compile in arduino
Copilot helped me figure out the errors of what is and isn't computable with arduino. I removed iostream usage. It helped a lot with memory issues.
Turns out, I had too much global memory being used, meaning there wasn't enoug