Once Within a Dungeon Dreary …

New App on the way!

Random Dungeon Creator!

A Random Dungeon

I learnt a lot from reading this article:
https://gamedevelopment.tutsplus.com/tutorials/create-a-procedurally-generated-dungeon-cave-system–gamedev-10099
So if you are interested in the nitty-gritty, go take a look!

So far, it draws a map (as above), with a random number of rooms (4-13) and joins them with corridors. Add a few Doors, and Voila! A Dungeon!

I’ll be writing a Contents generator for it, to add Monsters, Loot, and other features, but that may take a while.

While you’re waiting, I’ll explain a little about how the generator works:

The display is split into a Grid pattern, 60×35 (approx). This grid is held in a two-dimensional array, representing the co-ordinates. Each entry represents a “tile” in the Dungeon. These “tiles” are populated with the different features you may find:

First, Rooms. Without Rooms, a Dungeon is just a Maze, or Labyrinth. We need somewhere for the Monsters to gather, and hoard their Loot.

A simple function picks a random point on the map as the top left corner, and then picks another point to be the bottom right corner. This defines our rectangular room. This is checked against the List of Rooms, to see if it overlaps. We recreate a new room until it does not, and then this is added to the list.

Some rooms

Once we have enough rooms, they are joined together with corridors. Starting with the first room, we extend a short horizontal corridor in the direction of the next rooms, and then vertically until level with the center of the room. Another horizontal corridor takes us to the room.

The spaces to the sides of the corridors, and around the rooms are defined as Solid Rock.

This procedure is repeated until all rooms have been joined.

As we define the Rooms and Corridors, the Array is filled, each Point being set to “C” (Corridor) or “R” (Room) or “V” (Void. Undefined) or “S” (Solid Rock).

Now, we iterate over the Array, using it’s co-ordinates to draw the features. A simple “Switch/Case” statement determines which Tile is placed on the map.

A tip I picked up from Donjon was to always work on Odd numbered grids, leaving the Even numbered columns and rows as Solid Rock or Void. This ensures space between the rooms, and produces (in my opinion) a better map.

Map, with Array values overlaid

The only other tweak so far is to add doors. Each time we place a corridor, the first point is defined as a door

You will note that not all entrances seem to have doors! This is because some corridors run through rooms! In this following example, the corridor from Room 2 to Room 4 does not have a door, as it is actually a corridor from Room 3! “1 to 2” has a door as it leaves 1. “2 to 3” (the lower of the short corridors joining 2 and 3). “3 to 4” has a door as it leaves 3, and then passes through Room 2, turns, and continues to 4.

No door from 2 to 4!

In this way, we build up complex corridors and junctions from some very simple rules. The maps with more rooms have a lot more corridors, that cris-cross each other, and travel through rooms. See if you can trace each corridor in this map (not that it matters, once created. Brave Adventurers may take any route!):

Which corridor is which?

So, there we have it. The result of many long hours sweating over the keyboard, swearing and throwing things!

I will let you know when it is updated with Contents!

Post-Apocalypse Dungeon Crawl

The Dungeon Crawl. Staple of Fantasy Gaming. Enter an underground complex, and raid it for XP/Loot. They can vary from very small (One Page Dungeon) to very large (The Underdark). But how can they be incorporated into a Post-Apocalypse setting?

Ruined Cities are often featured, but focus more on Interiors than Underground. Carefully negotiating rubble-strewn streets to reach Storage Depots, Warehouses or other Loot Drops. With possible snipers on rooftops, the grey/red/<insert Apocalypse here> sky always in view, and many exits, they don’t really have the same feel.

But what if the City IS underground? Not originally-underground, but became-underground. I’m thinking something like Manhattan getting hit with a bigger version of Pompeii’s pyroclastic flow. The streets are filled with rapidly-solidifying ash, covering over 20-stories deep! Buildings are preserved, but access becomes limited. Maybe a lot of the Flow doesn’t penetrate much into the buildings. The rooms are still rooms. And there is Loot to be had! Pre-Fall Loot!

Access would be through the tops of tall buildings (now low buildings with Dungeons beneath!). Areas between buildings is blocked by ash, but could be tunnelled through (and possibly already has!), although the top layers are baked solid, and excavation efforts are hampered by bandits/mutants/radiation/<insert reason here>. Who knows what foul creatures reside in the deeper levels of such places? Mutants with pig-like noses and penchant for cannibalism? Animals escaped from the Zoo, twisted over generations (because Apocalypse)? Rodents over-gorged on food-stores and grown to Unusual Size?

With short sight-lines, melee combat becomes favoured over sniper shots. You’ll need to bypass locked doors and vaults. Maybe previous occupants have laid traps. As this is an expedition away from Base Camp, a medic will be useful.

I’ll be expanding on these thoughts later, but I present this as a taster.

Feedback Appreciated.