My accidental cave generator?

Hello everyone!

So recently, I was trying to make a maze generator but ended up with this cool generator that generates a “cave”. It isn’t optimized too much and is not polished, but nonetheless, it is pretty cool. Overall, the loading takes anyway from 40-120 seconds. The time depends on your computer!

Some pictures from above


To put it in simple words, the generation process is as follows:
1. I generate a 21x21 grid out of about 441 cells.
2. From that grid, I pick a starting one and find and choose one of its neighbors.
3. I rinse and repeat that approximately 420 times.

One cool thing I also found is that it can overlap the borders so if it chooses a neighbor off the board, it wraps to the other side!

Have fun exploring!



Seems more like a maze generator rather than a cave generator…

1 Like

It was supposed to be a maze generator but just because of the thick passages, I just call it a cave generator. It is a mix of both tbh.