Alex Schroeder let me know in a comment on yesterday’s random dungeon post that he’s looking for additional dungeon generation algorithms for Text Mapper. The method I described in that post was really aimed at being simple and easy to remember for humans. What would I do if I were exploiting computer power instead? What does Text Mapper actually need?
The 5- and 7-room dungeon algorithms are already pretty good for mini-dungeons. One thing I noted, though, is that it rarely creates a Jaquayed dungeon, as Jason Alexander describes. The structure is almost always linear with maybe one or two dead-end branches, although I did get two 7-room dungeons with internal loops after several reloads. And since they are mini-dungeons, there’s an obvious underrepresented dungeon type: megadungeons, or at least sprawling underworlds. I did do a couple old posts about random dungeon generators and non-linear dungeon generation, although I think they are unusable for a computer algorithm in their current state. Still, there’s the seed of a couple ideas for new additions to Text Mapper: an underworld wilderness map, a ruined underworld city generator, and a themed dungeon sublevel generator used as part of the underworld city generator or by itself to generate a mid-sized dungeon.
Here are some hypothetical steps we could take for the third and most important generator:
- Start at the Top. Randomly select a theme and basic tunnel structure that includes loops and nodes.
- Each Node is a Substructure. Generate a more specific theme within a node and its own tunnel structure with loops and subnodes in the same way as Step 1.
- Each SubNode is Either a Room or a Room Cluster. Theme determines which (Mazes tend to be more tunnels and isolated rooms, Tombs are like Mazes but with tunnels connecting room clusters, Ruins have more room clusters, and Fortified Areas have shorter, fewer tunnels.)
- Generate a Room Shape and Exits.
- Select Room Theme. For example, Storeroom, Torture Chamber, Kitchen. Specific theme from Step 2 determines list of room themes to select from. Room Theme specifies general room contents, including containers present.
- Add Room Occupant, if any. Determine if occupant starts in a hidden state and what the trigger is (vermin can emerge from crates if disturbed. Spirits can be summoned by touching a holy/cursed object.)
- Add Container Contents, including possible treasure.
- Add Secrets, including secret exits or containers.
- Repeat Steps 4 to 6 for Each Room until SubNode is complete.
- Repeat Step 3 and following steps for next SubNode until all SubNodes in the Node are finished.
- Repeat Step 2 and following steps for the next Node until all Nodes are finished.
This work is licensed under a Creative Commons
(CC BY-NC-SA 4.0) license.