Bumpy Dungeons, Magma-filled Caves and Secret Fountains


Although I had already implemented varying elevation in surface maps a long time ago, I had not bothered using this feature very much in dungeon levels, instead leaving them flat. I finally decided to experiment with how to make them work underground and I landed on two possible algorithms which can be used during level generation: one just creates height maps based on perlin noise, the other determines height based on distance from a wall, so that the further a cell is from any wall, the lower it is. When buildings are added to the level, they flatten out the land beneath them, which can cause surrounding land to either be lowered or raised.

I decided to only use variable elevation for maps centered on a large open cavern, since I thought on more closed in maps they just made the whole thing too busy. My traditional way of placing lakes didn't really work in these maps, so I came up with a new way where all the areas at the lowest elevation would be filled with liquid (water, acid or magma).

Earlier I had added caves with vents that continuously pumped in either smoke or freezing vapour. These caves contained a key to another room somewhere on the map. Smoke blocks vision and prevents breathing, so a player can die from staying in areas with thick smoke for too long. Freezing vapour does not block vision or prevent breathing, but causes a lot of cold damage each turn. To allow the player to navigate these gaves, I added that a special magic fountain would always be placed somewhere nearby, usually hidden behind a secret door. For freezing vapour, the fountain grants cold resistance, so the player can walk in to get the key without getting harmed. For smoke, the fountain grants apnea, which removes the need to breathe.

Following that, I added caves filled with magma, but with a small island on the side opposite the entrance where a key was placed. For these, a nearby hidden fountain was added that grants either heat immunity or flight.

Of course, for all of these situations, the player have many other methods for obtaining the key:

- the player may have a blink spell, allowing them to blink to the key location (if visible) and then blink away

- the player may have a ring of telekinesis, allowing them to grab the key from afar

- the player may have a potions that grants cold resistance, heat resistance, flight or apnea

- the player may have a 'phase rock' spell to pass through the walls at the back of the cave to obtain the key

- the player may have a wand of digging or scroll of vaporize rock to destroy the walls near the key

With that I decided to also create the possibility for keys to be carried by certain monsters on the level. For some specific monster types, usually those who are uncommon and intelligent, I gave the KEY_MASTER flag. When keys are being placed on a level at the end of level gen, there is a chance that they can be handed out to any monster who is a designated KEY_MASTER, as long as they are standing within a part of the map that is generally accessible (I don't want the key holder to generate inside the room behind the locked door the key is used for). In the case that a monster is holding a key, this will be visible to the player on the sidebar.

In some cases, a key may be given to a peaceful monster, which can put the player in a conundrum. They might attack and kill the monster anyway, but attacking peaceful creatures might displease their god, and attacking a peaceful NPC around a town could turn the whole town against the player if detected. The player could instead try stealing the key, but some gods don't like the idea of stealing either, and getting caught will also turn the creature against the player. It is also possible for the player to use a vial of sleeping gas or sleeping darts in such a way that the player is not detected to put the creature to sleep and then take the key.

But maybe I'll just add a way for the player to buy the key from the creature peacefully!

Get Sunlorn

Leave a comment

Log in with itch.io to leave a comment.