DungeonMaker
How Dungeons are Created
Dungeon construction works in stages. In the first stage special items are
placed, such as rooms, hand placed wall tiles, and spaces that
must not have any walls built over them. Such spaces can be used
to place NPC's, boss monsters, story hooks, what-have-you. In the next stage,
structural walls are built. These are walls that define the basic geometry
of the dungeon. For instance, you could have a room with doors to the East and West,
and build two walls which leave no openings between the North and South walls
of the room and the outer walls of the dungeon. Such a structure would force
players to pass through the room if they want to cross the dungeon in
East-West direction. Other structural walls can be
used to make sure that the shortest path from the entrance to the exit has a
specific geometry and passes through most of the dungeon. All the
data needed to place these items is contained in the rooms-file used
by the program.
After the first two construction stages have defined the basic dungeon layout,
the remaining walls of the dungeon are constructed in an open-ended series of
stages that normally comes to an end only when there is no more room to build
walls. Here the artificial life methods used to construct the dungeon
come into play. All walls are constructed by WallCrawler
objects - these are small critters that crawl through the dungeon and leave wall
tiles in their wake. After the structural walls have been built (which is
normally
done by a small number of hand-placed WallCrawlers, but structural walls can also
be placed precisely by hand), there are
usually quite a lot of WallCrawlers active in the dungeon, taking turns with
their building and interacting with each other. Here's the essence of what a
WallCrawler will do when it is his turn:
He will look ahead to see whether he can build a wall straight ahead
without blocking an existing pathway. If that is not possible, he will turn
to the side and end his turn, but if it is possible he will step ahead,
leaving wall tiles in his wake. Then he will start rolling dice to see whether
he should turn sideways, and whether he should create any new WallCrawlers, and
then he will hand the instruction pointer to the next WallCrawler.
Any baby Crawlers that are made during one construction stage remain dormant
until that stage is over, and then they are all activated simutaneously. Thus they
come in generations, with the zeroeth generation being those that build the
structural walls. Every generation of WallCrawlers can assign its babies to the
next generation or one specific later generation. The standard output of the
DungeonMaker program displays generational walls, where wall tiles
placed by generation n are marked with the digit n. This makes it very easy to
find a way through the dungeon, and it is necessary to understand the dynamics
of dungeon creation, but it doesn't look good - when you are not designing
a dungeon, you should switch this off by
running the DungeonMaker with the command line option -ng .
In addition to WallCrawlers we have ColumnJumpers, who act
much like WallCrawlers but instead of leaving solid walls behind just leave one
ornate column at the end of every step they take. ColumnJumpers currently
do not play an important part in dungeon creation, because I have mostly
been interested in creating cool mazes. People who want to have
large open spaces in their dungeons should investigate how best to use
ColumnJumpers in their designs.
The parameters that determine the behaviour of WallCrawlers and ColumnJumpers
are contained in the stats-files. Initially it
was my intention to vary these
parameters randomly, but I found that this produces too many dungeons that suck.
The stats files that come with the program have all taken at least an hour to
create, and the files are designed so that statsx works optimally with roomsx
(x = 0, ... 9), but so that the files can also be mixed. This has the effect that
all the stats files included with the program have somewhat similar characteristics.
To show that quite different things are possible I have also included the X-files
(which you can only run through the command line option -rX ).