Post feature RSS About the dungeon generation

Learn how we handle dungeon generation, the procedural approach used and how we control it to have a well-design game.

Posted by on

About the dungeon generation

The core of the game is a dungeon crawler, and because of this the size and shape of every floor in the dungeon is very important as they drive a concept that we want to emphasize a lot: exploration.

The dungeon shape can go from very small and contained to huge and expansive.





The last one looks like a huge grid, but not all rooms are connected with each neighbor, it more like a maze, with loops, dead-ends, and interconnections:


A Loop set of rooms.


A Dead-end room, it has just one door.


An interconnection has two or more doors.

This means that even if a dungeon has a grid nature and layout, the actual exploration is different, with various paths and rooms connections, making the floor feel more interesting.



In this image the green dot is the start, the red dot is the exit, yellow boxes are doors and red lines represent the paths you can take. As you can notice the south part of this dungeon is less interconnected than the north part.

If you are interested in learning the details of the dungeon generation in a more programming oriented way you can check this talk by Omar Rojo, it is in Spanish though:

Controlling the procedural generation

Yeah, this is a good one. We all know what happens when you leave your procedural generation run loose and just create stuff unchecked from game designers: you start to get a soup of varied things but without any flavor, without any purpose or goal.

In our case, we can create all kind of dungeons and even control how many loops, dead ends and interconnections we want, but if all these are just generated without a direction you will get bored real soon, and that is no good. For this reason, we have created The Director, a game component that will pick and set different types of goals and narratives for a given procedural generated dungeon. This is still in an early stage and is constantly being tuned and improve but the overall concept is as follows:

Let’s say we want a narrative to be "an exit guarded by enemies with increased difficulty as you get closed to the exit", how do we create something like this with the elements of the dungeon? Well, let’s start by saying that the Exit Room must be at the farthest dead-end from the Start Room and no room before it is interconnected. This would mean we have a line of rooms, from the start to the exit, like a serpent from head to tail. This by his own is somewhat boring so let’s say we also want some dead-ends outside the main path, leading to some treasures and that we want some strong enemies at the end of the dungeon and some weaker ones at the beginning. This will create a dungeon with the following kind of shape.



If you follow from the green dot to the red dot you will see there is one single path, you will find enemies following this path, each time harder, but if you go into another path it will lead to a dead-end that may have a treasure. The amount of each can be a percentage of the total room count so if the dungeon has more rooms you will have more of everything in the same proportion, and because the shape and sizes change in each room and you don't have access to the whole map from the beginning, then the feeling of going through it will be different each time, especially if you are not sure what narrative you are playing.

So what does this mean? This is only an example of a Guarded Exit narrative, but what if now I want a floor full of traps and no enemies? Or a single well-protected chest with a very good item on it? Or a town floor with mushroom citizens and quests? Or an open field with a more free exploration? Each one of these can be translated to a narrative with a specific goal, and if they are selected from a whole pool of narratives, with some added mixing and noise, you can have a fully random generated dungeon with well-designed goals to complete, making it not only unique in size and shape, but also in gameplay experience.

Seeds

The final point I want to mention is seeds. I guess this is a given, but all narratives and dungeons are seed generated. Currently, we are showing the seeds in the GUI and there is no in-game way to re-entering one. We are wondering if that should be something the player could do, what do you think?



Thank you for reading. All feedback is welcome! Smiley

Social Media

Keep up with all our daily updates, post, and giveaways on our social media!

See you soon shrooms

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.