Learn how to create procedurally generated caverns/dungeons for your games using cellular automata and marching squares. Full source code available on GitHub. Full playlist here.
Hope you enjoy
This is really impressive. I’m actually trying to do something much simpler (I think) and am having all sorts of troubles. Nothing like a random generator, just a custom Unity editor that would allow a game designer to click points in 3D space (currently against a plane) and connect the points together with meshes (edges), and then creating the polygon that the edges make when the designer clicks a point that they already made (points = sphere with a collider on it used during the creation process).
These tutorials give me some hope that it is possible for me to figure it out. Thanks!
Thanks a lot for this, this comes in a handy as I’ve been looking into learn about procedural creation for a while
edit: seems like the last tutorial(3) source code isn’t working correctly, no mesh is visible despite the small hickup everytime I hit the left mouse button or at the start due the cave generation code doing its magic, so I assume something is wrong with the meshgenerator code.
I added the mesh filter, tweaked values (width and height from 5 to 1000, random fill percent from 5 to 60) but still no mesh.
The mesh filter component in the editor does show it isn’t empty, but the mesh name that is added is just blank space (though I think this is on purpose) and selecting doesn’t seem to be doing anything.
If you need more info let me know
I’ve uploaded episode 05 - it covers the detection of the different regions of the map so that we can easily remove those we don’t want (e.g tiny rooms / walls).
Oh man. I don’t watch Breaking Bad or Game of Thrones, but I’m now getting to feel like the friends I know who do! Now I’m behind on my viewing and have to catch up!
This is an extremely useful algorithm video series. Thank you.
As a long term goal I’m hoping to mix elements of accidental noise, fractals, and such with cellular automata. I’m thinking different algorithms will produce different biome kind of effects.
But this video series has given me a jump start in comprehending things, where as these other approaches are quite difficult:
Glad to hear it kuchaku, good luck with your project! I’m currently planning a series on generating land masses with perlin noise as a follow-up to this series, but your idea of combining different procedural approaches sounds intriguing. I’ll do some experimenting of my own
I’ve still got one more episode to make before this series could be considered complete. I do have a few ideas for things I’d like to add to it after that (e.g. choosing good spawn points for doors/treasure chests/enemies and the like), but I might take a break from this series after the next episode to work on some other stuff, not sure yet!
Great séries super usefull ! Just a question thought, have you tried generating big map ? The detecting region code(episode 5) is super slow. When i disable it, it creates the map 100 times faster. How would you go to speed thing up ?