Cyclic dungeon generation on the example of Unexplored

image






Stop creating branching paths, start using the dungeon cyclic generation. Your levels will become much more similar to manually created ones.



Most often, to generate dungeons in games of the roguelike genre, generated or pre-created fragments of the dungeon are added to the map. The dungeon grows from the starting point like a tree. However, the trees end with branches, which leads to the creation of many dead ends. To get around this problem, most dungeon generators look for places where you can randomly connect branches so that the player can move in a circle rather than constantly returning back.



The Unexplored dungeon crawler uses a fundamentally different approach (see Figure 1). Instead of linear paths, it initially uses loops as the most basic structure. The difference is striking: with the old approach, good and interesting cycles could occur by chance, and in Unexplored they are a planned feature of the result of the generator.



https://i1.wp.com/ctrl500.com/wp-content/uploads/2016/07/basic-cyclic-explantion.png






Figure 1 - cycles against trees.



How does this work? When Unexplored starts generating a dungeon, it starts from an arbitrary starting point on the map. But instead of creating a branch to the target point, it creates a cycle consisting of two paths connecting the input and the end point. Such loops are much better suited to standard level design patterns than linear paths.



Each cycle has a path A leading from the entrance to the end point, and a path B leading back. Depending on the absolute and relative lengths of paths A and B, each cycle can be turned into a design pattern (see Figure 2). For example, when A is short and B is long, you can place a closed door at the end of the cycle, and place the key at the end of B, just before you can return to the main path. This will create a level where the player first sees the locked door, and when he finds a suitable key, he does not need to go far to find the door he is opening. Obviously, this requires that the player cannot reach B directly from the entrance to the cycle, although it may be interesting if he can immediately see B and the key.



Another example that works well with long A and short B - you can place a secret door between the entrance and B, creating a hidden slice. Or B may simply be a riskier route than A, because there is a dangerous enemy or room with many traps on it. There are many possibilities, Figure 2 shows some of them.









Figure 2 - Examples of cyclic design patterns.



The results are amazing. Figure 3 shows the level generated by the Unexplored game. It consists of a large lock-key cycle with a cycle filled with a large chasm. To add a bit of interest, a small gambit loop has been added. The design is simple but effective. In fact, we realized that for most levels a couple of cycles are often enough; already with a couple of cycles, the levels acquire a unique structure and character.



https://i1.wp.com/ctrl500.com/wp-content/uploads/2016/07/the-ring-level.png






Figure 3 - passing the level.



Acknowledgments: The idea of ​​cyclic dungeon creation arose during a research workshop at the Canadian Banff Center . I can’t appropriate the authorship of this idea, so I share this honor with everyone who was in our working group.



All Articles