A while ago I started working on a megadungeon map generator which documents every step of its growth using a little picture, and every one of these pictures links to a rendering of said map using Gridmapper for debugging purposes. The actual “result” is simply the link from the last image.

Give it a whirl!

I’m interested in ideas for improving the generated maps. I already have some vague ideas:

• Having the algorithm prefer growing new corridors into sections that are “less dense.” But how does one define that?
• If that doesn’t eliminate dead ends, have some sort of estimate of whether the corridor will end up in a dead end and abort these outgrows. Or eliminate dead ends after the fact.
• Placement of statues, altars, treasure chests, tables, beds, open pits and traps.
• Agressively trying to add more “starting” rooms for levels that are “done” but aren’t “dense enough”. All of these terms need decisions to be made.

When I started the project, the first thing I did was draw the kind of dungeon elements I expected to find in a simple generated megadungeon map.

Next, I drew a map using the elements I had identified. I also started looking at corridor lengths and the like. That’s what the numbers are for.

And finally, I tried to identify some simple statistics to build a simple table of probabilities, a bit like a Markhov chain.

Some thoughts: What about using a census of the region the proposed feature is going to go into, maybe up to 3 or 5 squares away, and the census values fall off by distance (1 square = 2, 2 squares = 1, 3 squares = 0.5, etc), and then if the value is above a figure you set the generator instead chooses a new location? Maybe you could use a random feature generator, something that works like the AD&D DMG dungeon generator, for traps/statues/chests/etc? It looks like you’re using something already, as I see that the generator will throw in the occasional portcullis or statue.

Frotz 2017-06-27 13:46 UTC

The way the generator works is that it places elements and based on the element it just placed, it randomly chooses appropriate next steps. The way to describe it right now would thus be something like this:

2. a big room has an exit
3. a big room has a 70% chance for another exit
4. a big room has a 20% chance for another exit
5. a big room has a 20% chance for a spiral stair case
6. a room exit goes in a random direction and looks for a wall to place a door
7. a door out of a room will connect to a corridor that is about 60ft long
8. at the end of a corridor, there is a 20% for a big room (back to #2)
9. or a 30% chance for a settlement
10. or a 50% chance for small room
11. and so on...

To add a feature, I’d need to hook into this process and say, for example, that a big room without a stair case has a 30% chance of having an altar, and a 30% chance for a statue, and thus an about 10% chance for both.

Or, in a settlement, the last small room has a 50% chance of containing a chest.

– Alex Schroeder 2017-06-28 06:50 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.