Log In  


Cart #pugafufahi-0 | 2019-02-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
44


Inspired by an idea from JW of Vlambeer, I built this dungeon generator.

In short it adds a bunch of rooms on top of each other and then moves them randomly around until they don't fit any longer. Usually this makes for some very nice and organic looking scenes. This version also has a bunch of other parameters like wider door ways, interconnectedness, and decoration among others. The example in this thread randomises these parameters but in the code it is fairly easy to set them up to whatever.

I've tried to document it to a degree, so hopefully it can help out if someone wants to dive into my implementation. It should be said though that I primarily wanted to visualise the process and to look nice, not necessarily be the most efficient data structure. ;)

Have fun and let me know if there are any questions!

44


1

This is great!


3

Well presented :)

Adding a room is like watching a drunk architect that keeps forgetting where things are!!!


trying to figure out what's going on with the little indicator at the top left... is it like the types of rooms shown?

maybe it's explained in the code and I haven't looked yet?


Thanks for the positive feedback!

Kavukamari, it is a representation of the parameters that is fed to the generator.

  • chance for big rooms
  • chance for wide doorways
  • chance for additional doors
  • chance for room decoration
  • amount of pre-generated blocks
  • size of pre-generated blocks

This is great! I'll definitely have a read through the code tomorrow as I still haven't decided how I want to implement procedural generation for the 7DRL challenge, but this looks like a simple yet effect approach.


Fun to watch. I tried adding more rooms but at least one was disconnected. Maybe you could implement a few corridors? Great otherwise!


I'm totally printing this Code to study it! Thanks for your work!!



[Please log in to post a comment]