Log In  

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


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!

P#61963 2019-02-16 23:53 ( Edited 2019-02-16 23:54)

1

This is great!

P#61968 2019-02-17 01:37
3

Well presented :)

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

P#61979 2019-02-17 13:44

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?

P#62019 2019-02-18 06:32

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
P#62020 2019-02-18 06:51

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.

P#62048 2019-02-18 20:59

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

P#88779 2021-03-10 11:08 ( Edited 2021-03-10 22:57)

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

P#139933 2024-01-10 05:49

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 13:17:36 | 0.015s | Q:29