DungeonMaker

Determining the Dungeon Layout
(rooms-file reference)

There is an auxiliary program called "writeroomsfile" that can - you guessed it - write a rooms-file, prompting you for input. You can also take an existing rooms-file and edit it in a plain text editor (not a word processor which inserts formatting codes). The rooms files must be named roomsx with x a single digit integer in order for DungeonMaker to be able to work with them. Let us go through an example file:

The first line of the rooms-file reads
Dungeon dimensions - dimX = 100; dimY = 100.
You can enter different dungeon dimensions here. The point (0 , 0) is at the top-left corner of the dungeon, and the x-axis runs from top to bottom, the y-axis from left to right. The second line reads
numRooms < 5; numOpen < 1; numClosed < 40; numColumns < 5; numCrawlers < 3.
Change the numbers to fit your needs... in the example above, you can have at most 4 rooms, no open squares, 39 hand-placed wall tiles, 4 hand-placed columns, and 2 initial WallCrawlers.

Next come a series of lines that places rooms, for example:
div: 12; Xdiv: 6; Ydiv: 6; width: 6; lTC: 23; tC: 0; rTC: 0; rC: 1; rBC: 0; bC: 1; lBC: 0; lC: 0; style: 1; delay: 5
This takes some explaining - first, div stands for divisions, and 12 divisions means that the dungeon area has been equally divided into 12 parts along the x-axis and along the y-axis. This defines 13 points along both axes, with Xdiv = 0 being at the very top, and Xdiv = 12 at the bottom of the dungeon. Xdiv and Ydiv determine where the center of the room will be placed. This scheme was introduced because it allows placement of rooms independent of dungeon dimensions. All rooms are square, and the width of a room is counted from the middle on out, without counting the center square. A room with width 6 thus has (2*6 + 1) (usually open) squares between the left and right walls. This is to ensure that all rooms have a well defined center, which is necessary for placement of center doors. The next 8 parameters have the following meaning: lTC = leftTopCorner, tC = topCenter, rTC = rightTopCorner, rC = rightCenter, ... and so on in a clockwise fashion. The values assigned to these parameters mean the following:
0 = do nothing here;
1 = place a door here;
2 = start a Crawler here that leaves no opening;
3 = start a Crawler here that leaves an opening at the end of its run.
If a Crawler is placed in the center of a wall, that Crawler's Forward and Direction members (described here) will both point straight away from the wall. For Crawlers started on the corner of rooms, things are a bit tricky - to the values given above one of the following values must be added:
10 = Forward and Direction both face in the direction of the x-axis, i.e. up for the upper corners , and down for the lower corners of the room;
20 = Forward faces in the direction of the x-axis as above, Direction faces straight away from the room on the diagonal;
30 = Direction faces away on the diagonal, but Forward faces in the direction of the y-axis, to the right if the corner is on the right side of the room, to the left otherwise;
40 = Forward and Direction both face in the direction of the y-axis.
This is a bit of a hack - I first had Forward and Direction assigned randomly, but found when actually designing dungeons that this would not do, so I put the multiples of ten in there. To recapitulate, Crawlers in the center of rooms need a value from 0 to 3, but for corner Crawlers this is illegal - they need one of the values from 10 to 40 added to that.

The style of rooms is determined through the following additive parameters:
1 = room has walls (all rooms with even style numbers lack walls!)
2 = corner doors are large
4 = corner doors are extra large
8 = center doors are large
16 = center doors are extra large
32 = corner doors have their center filled (making 2 smaller doors)
64 = center doors have a Crawler in their center
128 = there is a row of columns behind each center door in the room
256 = there is a row of columns parallel to each center door
512 = center doors have decoration type 1 outside
1024 = center doors have decoration type 2 outside
2048 = corner doors have decoration type 1 outside
4096 = corner doors have decoration type 2 outside
8192 = room has center pyramid
For example, a style value of 8337 = (8192 + 128 + 16 + 1) means that the room has enclosing walls, a decorative center pyramid, and columns behind its extra large center doors.

Finally, a delay of 5 means that all Crawlers attached to this room will be created with an age of -50, which means they will remain dormant for 50 iterations, which gives Crawlers with lower delay a chance to build their walls first. Placing rooms is a convenient and largely foolproof way of creating dungeon structure, but it gives less control than is possible through individual placement of wall tiles and Crawlers. For instance, all Crawlers placed as part of a room must have the same delay. The program is written in such a way that (barring bugs) it is impossible to block off part of the dungeon by placing a room, with one exception: If you start off two Crawlers at adjacent corners of a room, these Crawlers can join and block off the dungeon - this happens with a substantial likelihood when both Crawlers head in the same Direction, and with a very small likelihood when one of them heads in this Direction and the other off on a diagonal.

In the above example it is possible to enter data for 4 rooms, but a smaller number is OK also - however, rooms input must end with the lines:
div: 0; Xdiv: 0; Ydiv: 0; width: 0; lTC: 0; tC: 0; rTC: 0; rC: 0; rBC: 0; bC: 0; lBC: 0; lC: 0; style: 0; delay: 0
div = 0 is not a room but indicates the end of room input


Next come a series of lines that position hand-placed guaranteed-to-remain-open squares, wall tiles, and columns, which is straightforward:
Open square at ( 70 , 70 )
Open square at ( 0 , 0 )
(the value (0 , 0) is not an open square but terminates the series)
Wall tile at ( 47 , 58 )
Wall tile at ( 47 , 59 )
Wall tile at ( 0 , 0 )
(the value (0 , 0) is not a wall tile but terminates the series)
Column at ( 10 , 10 )
Column at ( 13 , 10 )
Column at ( 0 , 0 )
(the value (0 , 0) is not a column but terminates the series)


Next the initial WallCrawlers are placed. This method of placing Crawlers allows for more flexibility and precision than the automatic placement on the outside of rooms. It is of course possible to hand-place Crawlers on the outside of room walls using this section of the rooms-file. Their starting location is given with precise dungeon coordinates, which run from 0 to (dimX - 1) for x, and 0 to (dimY - 1) for y - thus in our 100 x 100 dungeon, a Crawler at (99 , 50) starts in the middle of the bottom wall. Crawlers place no wall tile at their starting location and are normally placed on top of a wall tile. The lines for placing Crawlers look like this:
A Crawler starts at (x , y) = (99 , 50)
and this crawler will head in direction 14 with delay 0 and termination 1.
A Crawler starts at (x , y) = (0 , 0)
(the value (0 , 0) is not a crawler but terminates the series)
The "direction" parameter is the sum of two parameters that determine Forward and Direction; the second digit determines Forward according to:
1 = right, East, larger y-values
2 = down, South, larger x-values
3 = left, West, smaller y-values
4 = up, North, smaller x-values
The first digit determines Direction according to:
+0 = same as Forward
+10 = 45 degrees to the right of Forward
+20 = 90 degrees to the right of Forward
+30 = 45 degrees to the left of Forward
+40 = 90 degrees to the left of Forward
+50 = Direction = 0 (no preferred direction)
In our example, the value 14 means that this Crawler initially faces North, and that its intended direction is NorthEast (which implies that only North and East are legal values for the Forward heading of this Crawler during its entire life).

A delay of n (n = 0, ... 9) means that the Crawler will remain dormant for n * 10 iterations, during which other Crawlers can claim the dungeon space for their walls. Since a generation lasts for 100 iterations, a Crawler with delay 9 will at age 10 face competition from all the numerous Crawlers of generation 1, which will spring into action at that time. A delay value of 10 is also legal, and means a random delay between 0 and 9.

Finally, the termination value can have the following meanings:
1 = leaves an opening at the end of its run
2 = leaves no opening
3 = is the first of an open/closed pair
4 = is the second of an open/closed pair
Open/closed pairs must always follow each other in the sequence of Crawlers, and the program determines randomly which one of them is open (= leaves an opening at the end of its run) and which is closed (leaves no opening). Open/closed pairs and random delays are interesting and powerful options for dungeon design, and are discussed in greater detail later.

Last (and probably least) we have the line
Outside walls sports 0 protuberances.
These are ornamental structures placed along the outer dungeon walls, which have two purposes: Some stats files create dungeons where there is a tendency to have a clear pathway along the outside dungeon wall. Protuberances disrupt Crawlers that try to crawl alongside the outside wall, and can be used to alleviate this problem. Also, they are handy and good-looking starting points for WallCrawlers.

This concludes the discussion of the rooms-file.
...and about time too...

previous page            contents            next page