r/unity_tutorials • • Jul 29 '22

Video Infinite Procedural Maze Generation (Unity Tutorial)

110 Upvotes

11 comments sorted by

5

u/Puzzleheaded-Ant-916 Jul 29 '22 edited Jul 30 '22

The Eller's Maze Algorithm is a non finite procedural maze generation algorithm, where the main approach to generation is creating the maze one row at a time. Above, I’m looping the maze on itself, changing the maze texture every iteration. However you theoretically run it off in any direction indefinitely.

If you are interested in this topic at all and want a very detailed explanation to how this works, I recently made a video explaining the algorithm. It's the first video in a series I’m making, in later videos I am going to actually walk through how to code it in Unity.

Video: https://youtu.be/kD-YUSNffFY

Clean Version: https://imgur.com/gallery/n2jniGe

4

u/Spe333 Jul 30 '22

This is pretty cool.

Is it possible to set this up to just make a random finite maze every new load in?

4

u/Puzzleheaded-Ant-916 Jul 30 '22

Yea absolutely. You can set any width and height, get a finite maze and every time you load in it will have a new pattern. There’s also options to make the maze more vertical, horizontal, or scattered depending on what your looking for.

1

u/Spe333 Jul 30 '22

Awesome. I’ll dive into this next week, I mainly Do VE stuff and this would be fun to try out.

3

u/xvan77 Jul 29 '22

So, you are the person that created the backrooms?

1

u/HopelessGameDev Jul 30 '22

the problem i see is that it’s either unsolvable or too solvable…

2

u/Puzzleheaded-Ant-916 Jul 30 '22 edited Jul 30 '22

Yea I randomized it a bit too much in the video above. This is a much cleaner version. https://imgur.com/a/n2jniGe

2

u/HopelessGameDev Jul 30 '22

that’s better but it still has a lot of redundancies with pieces, it might need some more logic to clean up the random inaccessible holes

2

u/Puzzleheaded-Ant-916 Jul 30 '22

Thx for the feedback, I’ll look into this

1

u/Any-Entertainment420 Jul 30 '22

/remindme 6 days