Random Maze Generation?

I’ve looked through all the posts in devForum that are talking about these (title, and I do believe that is what I’m looking for, but as the beginner scripter that I am, I don’t quite understand all of it. It would be great if I could have an explanation on how to make these randomly generated mazes, or have anything that could help me get a better understanding of the maze generation code, process etc… Thanks!


This isn’t a simple question with a single answer. What you are looking for is an algorithm of list of them, which you can then manually convert to Roblox-compatible Lua. Of course there are maze-generating free models already if you want to dissect one that is already in Roblox, but if you want to learn you should go check out pages like this one or do a search for ‘maze algorithm’. Be warned, this sort of thing has a lot of big words and a lot of comparing pros and cons that don’t matter in practice.

1 Like

Thanks for the feedback, I’ll be sure to look at it.

1 Like

There’s tonnes of algorithms for generating mazes. My favorite is the recursive backtracker, which is described on the wikipedia page that @JarodOfOrbiter linked. If you want, here’s a video tutorial as well from one of my favorite programming youtubers: https://www.youtube.com/watch?v=Y37-gB83HKE

It’s not that complicated, but still great challenge for beginner and intermediate programmers. Please comment or make another post if you run into specific issues implementing it! :slight_smile:


That’s a good one to watch, he’s good. Thanks for sharing that, I quite enjoyed it.

1 Like

i used this video to make a maze in unity a few years back

1 Like