## Monday, April 10, 2017

In the post on guaranteeing that a randomly-generated dungeon is non-linear (contains loops,) the first technique I mentioned was to start with a dungeon structure that already contains these loops, then generate rooms and additional corridors that connect to that structure. I call that technique "pre-loading". The predefined structure is a tunnel template which you then modify with dice rolls.

A long time ago, I toyed with the idea of leximorphs: using letters of the alphabet as if they were geomorphs. This could be used for a tunnel template. Assume that your dungeon is divided into sectors, for example four quarters. If you randomly select a four-letter word or character string, assign one character to each quarter, and draw them on a map so that each character touches the adjacent characters, you wind up with a network of tunnels. Some letters have loops built into them, for example "A", "B", "D" and "O". This guarantees at least a little bit on non-linearity. The loops can be drawn with curves or as angular shapes, as in the example image. Other curved strokes can be straightened or turned into angles as well, as desired.

There are a couple sources for random word generation, for example the random page feature of Wikipedia. But one quick option is to use this d10-based table:

 Roll (d10) Letter Pattern 0 R 1 A 2 D 3 T 4 Q 5 L 6 X 7 P 8 B 9 lowercase g

I chose mostly letters with loops in them, although I did include three letters that do not contain any loops (T, L, and X,) just for variety. Roll a d10 once for each sector on your map. Optionally, roll a d4 for rotation of each letter (1= normal, 2= turn 90 degrees clockwise, 3= turn upside down, 4= turn 90 degrees counterclockwise.) Make sure each letter touches the adjacent letters, so that there aren't any disconnected lines. This is your base tunnel template.

At every corner or junction between letters or within each letter, roll to see how the two tunnels connect (d6).

1. Ordinary Junction
2. Trapped Junction
3. Trapped Junction (disabled)
4. Minor Obstacle (debris, pool of liquid)
5. Door
6. Room

Finally, check both sides of the tunnel every 60 feet for doors or branches (d8).

1. Blank Wall
2. Blank Wall with Secret Door
3. Branch/Side Passage
4. Two Diagonal Passages
5. Blocked Passage
6. Door
7. Pair of Doors, side by side
8. Stairs

I am assuming here that you are using tables borrowed from Appendix A or another random dungeon generator to roll for size and shape of rooms, type of door, what's behind each door, or other details as needed.