Dungeons!

Last week I implemented dungeons, or at least their skeletons. Right now just big rectangular rooms are being dug out, but the dungeons go all the way down to the bottom layer connected by ramps. It doesn’t look too exciting right now, but eventually, each of these skeleton rooms will get a special room painter to dig out a cavern or a troll den or a dwarven bedroom or other interesting things for the kobolds to explore.

Dungeon Skeleton

The skeleton of a dungeon in a mountainous region

 

This skeleton is generated using the subdivision method, which takes the whole area and repeadedly slices it in two until the desired room size is reached.

Diagram of dungeon subdivision

Next, a start and end room are selected. Preferably they are very far apart. An A* path is used to link the rooms together between start and end. After that, all other rooms are linked to these rooms

Link rooms together

Now you can stop here if you want boxy square dungeons. If you don’t, some of these rooms need to be pruned. The next part is hard to show with such small diagrams. Basically calculate all the room “tendrils” that grow from the main path. In the diagram below, the main path is yellow. We want to keep that. The tendrils are orange. Start pruning these tendrils from the ends until the desired number of rooms is reached.

Prune dead ends

The result of this is a basic dungeon shape that can now be decorated any way you like.


This entry was posted in Dungeons, Lair Of The Kobolds. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.

1 Trackback

  1. By BitGriffin Cavern Painters on October 1, 2012 at 10:49 pm

    […] Last Week I showed how the skeletons for the dungeons in Lair of the Kobolds are formed. This week I worked on painters to make these dungeons more varied, and the rules that govern the painters. There are currently three kinds of painters: a painter that makes a rectangular room like the basic rooms shown in the last post, a painter that carves a windy cavern corridor between a room’s connections, and a painter that carves a blobby cavern in the room. A dungeon using room painters […]