Sponsored By

Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs.

An outline of the level design philosophy we developed and adapted for Unexplored 2. This philosophy informs our generator and proved to be a great help generating coherent, believable and fun places for the player to explore outside the typical dungeons.

Joris Dormans, Blogger

October 26, 2021

26 Min Read
Image 1 - A generated temple for Unexplored 2

Unexplored 2: The Wayfarer’s Legacy leaves the sprawling generated dungeon of its prequel behind. Its grand adventure takes place in an open world filled with bustling towns, dense forests, ancient ruins, and jagged cliffs. Generating these types of levels calls for a different design philosophy. Where the dungeons of Unexplored 1 took full advantage of the notion of ‘cyclic dungeon generation’, we expanded and adapted the level generator to encompass what we like to call ‘the theory of the place’.

At a first glance the elements that make up this theory seem quite obvious, but for us the structural clarity offered by the thorough descriptions of the elements and their relationships was very informative. In addition, their explicit implementation in our level generator vastly improved the quality of its output.

The Theory

The theory of the place at its heart is an elemental, structural description of level anatomies. It identifies different parts of a level and describes the relationships between those parts much like syntax does for sentences or narratology does for story plots. The theory was tailored for our specific purpose: to help generate sensible and interesting levels for an action-adventure game, but we suspect it’s range of application surpasses that. Certainly, there are other genres within games that can benefit from it.

The descriptions and schematics produced by the theory do not directly correspond with level geometry. They are designed to foreground the structural relationships between the level parts and the patterns that emerge from these relationships. As such, a single level schematic can have an infinite number of executions, just like a single valid English syntactic structure can correspond to an infinite number of sentences. Expanding the linguistic analogy further, the theory of the place describes the deep structure of our level designs, whereas each individual, built level is a corresponding surface structure (link). And just like deep structure and surface structure are critical concepts for replacement grammars and natural language generation, the deep structure described here really helps to generate levels that feel coherent and well-formed.

The theory as presented here is deceptively simple. It might suggest that all levels should follow a singular pattern. However, this is not the intended effect. First, we do not wish to suggest that every level generated in a game needs to follow this structure, although we strongly believe that in a great many cases the theory of the place would be applicable. Second, and more importantly, we feel that the expressive range of this theory is very large. The basic structure might be somewhat uniform, the specific exceptions and variations of each individual implementation ensures that levels can feel vastly different. The theory presented here is very similar to structural theories and design pattern languages found in architecture, software design, and narratology, for example. What all these theories have in common is that they too use a limited palette of common structures to describe an infinite number of possible executions. 

Inspiration

There is a very specific context from which this philosophy emerged. As already indicated, Unexplored 2 moves the action from dungeons into an open world. Dungeons, obviously, are a common trope in fantasy adventure games. The sprawling structure and endless corridors serve the gameplay requirements most effectively, but conceptually they are artificial and weird. In an open world adventure game there have to be many levels that are not dungeons. Even though a couple classical dungeons are expected in a game like ours, the gigantic, 20-level dungeon of its prequel would feel very much out of place.

Instead, the adventure sites of Unexplored 2 have to be smaller, and make more sense in the context of the world. A keep with a crypt below makes sense. A temple complex hidden in a large cave does as well. But that is about as large as sensible ‘dungeons’ can get without falling out of tone. More importantly, a classic dungeon, especially generated ones, are designed to be traversed by a player, even if the game feigns to resist their progress at every turn. The narrow passages and challenged-filled rooms build up to the climactic boss fight at the very end of the dungeon. Often the path leading towards that final room is surprisingly narrow as the player is rail-roaded past the majority of content the game has to offer.

A small ruin on top of a cliff.

Image 2 - Smaller places can sometimes be more effective than large ones.

Trying to impose a similar gameplay structure on levels that are not specifically set-up as traditional dungeons is pretty hard. Doable if you are designing a level by hand, but almost impossible to replicate when you are generating the level procedurally. But ultimately, it is also quite unnecessary. With generated levels it becomes more feasible to create levels that offer multiple trajectories through them: it matters less that the player might miss on some of the content because once the generator is in place, extra content is fairly cheap. In addition, setting up levels that primarily pose a challenge for the player to overcome in any way they can, rather than a predesigned sequence of solutions, plays well into the strengths of the roleplaying and roguelike/roguelite genres. Different approaches and challenges might resonate with the different affordances offered by available character classes, and the vastly different individual trajectories strengthen the unique narratives that emerge from engaging with a level for which cannot exist a predefined play-through.

For inspiration we looked at many dungeon and level designs of other games. Especially table-top roleplaying games, as they often manage to create a similar sense of adventure we hope to inject into Unexplored 2. In particular, the online article on the Alexandrian outlining the design philosophy of Jennell Jaquays proved invaluable (link). Jaquays’ insistence on creating levels that are conceptually consistent, offer multiple points of entry, and multiple trajectories leads to a very practical set of guidelines that can be used very effectively to improve almost any site of adventure.  

The Place & The Vault

Image 3: The place with a vault.

At the core of the theory of the place is the idea that an adventure site is dominated by ‘a place’. The main challenge for the player is to simply reach the place. At the place the player might still need to solve a puzzle, find a treasure, or defeat a boss, but the main purpose of the level structure is to make sure that the trajectory towards the place is possible, coherent, and interesting.

The place itself can be many things: it could be a clearing in a forest, a keep perched on top of a hill, or a treasure room inside a large temple complex. It is possible that the place is subdivided into a number of connected rooms, but even in that case the place should likely be easily recognizable as a coherent whole set apart from its immediate surroundings. 

As the function of the level is to create a traversal challenge for the player, the place is protected by boundaries and likely has only a few points of entry: ‘one does not simply walk into the place’. 

Within the place there might be a room that is even harder to get into which we designate as ‘the vault’. The vault is a good place to store treasure or any type of ‘collectible’ level objective that cannot be nailed down. Frequently the vault is locked and the key into the vault is hidden elsewhere in the place or placed under the protection of a guardian that calls the place home.

The Path & The Environment

Image 4: The path and the environment

Normally, the player does not start a level in the place. After all, it is their objective to reach the place. So the place exists in an environment, and through that environment a path should lead from the level’s point of entrance to the place.

The environment can be many different things: a forest, a city block, a mountainside, or even a more traditional dungeon environment. But it helps if there is some clear contrast between the environment and the place. This helps the player to recognize the place itself, but also can help to explain the boundaries that separate the place from the environment. 

The environment itself can be hazardous, but should be fully interlinked and traversable. This means that the player can ultimately reach any point in the environment from any other point in the environment, even if it requires the player to deal with environmental hazards or lock and key mechanisms. For example: the environment might be a forest with a number of narrow paths leading past aggressive, sentient trees. The vegetation that separates the paths might not be traversable in and off itself, as long as paths lead to any point of interest within the forest that is fine. If a part of the forest is locked off by a barrier that requires a specific key to navigate past then it is important that the key can be found on both sides of the barrier, or that the portion of the forest behind the barrier can be escaped from by other means. This ensures that the entire environment is traversable and interconnected. A good litmus test is to imagine the player to randomly teleport to any location inside the environment and make sure they are not stuck as a result. Even if your game does not have a ‘scroll of random teleportation’ it is surprising how often players manage to replicate its effects with other means.

The path connects the level’s point of entry to the place, and although it is part of the environment, it typically is safer and easier to follow. Basically the function of the path is to lead the player to the place in order to quickly direct them towards the main challenge posed by the level.

Image 5 - A path snaking up to an easily recognizable place.

The Antechamber & Secondary Entrances

Image 6: The antechamber and secondary entrances

In most cases the place is connected to the path through an entrance. We refer to the space or room before the entrance as the ‘antechamber’. Conceptually the antechamber might be part of the place, but it does not need to be. If the place is a castle, and the environment is a light forest, the antechamber might as easily be a clearing in front of the castle or an outer bailey. Structurally it is important that the antechamber is located before the entrance into the place, and as we shall see below, offers the opportunity to place encounters or thematic level features on the obvious path leading towards the place.

The nature of the entrance into the place itself is important. Aesthetically you will likely want to make this entrance dramatic: a big gate or a bridged chasm, for example. From a gameplay point of view the entrance should pose a challenge: it might be guarded, locked, barred, or even not navigable by normal means at all! The options are likely to be dictated by the gameplay requirements of the level. Do you want the player to fight? Scale a cliff? Have a particular skill? Or, acquire a special key elsewhere in the game?

So far, the set-up is strictly linear. However, this can be easily changed by allowing secondary entrances leading into the place from other locations within the environment. They might not be safe or easy to use, they might be guarded or well-hidden, but their existence immediately expands the number of player trajectories through the level. 

How easy, reliable, or safe a secondary entrance is probably depends on the overall design of the level. If the environment is dangerous to travel and the secondary entrance is located deep within the environment, the secondary entrance itself can be relatively safe and easy. If the main entrance is actually not traversable, then at least one secondary entrance needs to be reliable as it possibly becomes the only way to enter the place. The specific challenge of secondary entrances in relation to the challenge posed by the main entrance is an important design decision. It could even be that the secondary entrances are only viable options for characters that have specific skills, knowledge, and backgrounds. For example, the side door into an underground city might need a special map, a key passed on for generations, and the services of a well-trained burglar to offset the challenge posed by the dragon keeping watch over the main entrance.

Image 7 - several entrances leading to the place (central room) possibly including the tunnel accessed on the right...

Populating The Place

The structural designations suggested by the theory of the place really help to dress and populate a level in a sensible manner. To start with, as already mentioned, it is important that the player can easily identify the place: it helps if there is some contrast between the natures of the place and the environment respectively. But also placing a landmark or a weenie in the place or possibly the antechamber will help players finding these locations.

When the place is inhabited by enemies, it makes sense for them to have their main camp inside the place, guard the entrance or the antechamber and possibly patrol the path or the environment. Depending on the nature and difficulty of secondary entrances these might be left unguarded. If there are two warring factions it makes sense for one faction to dominate the place and the other the environment, with the antechamber in either hands or the locust of the current conflict. 

Depending on how things are connected, a secondary entrance might allow the player to bypass any encounter or challenge located in the antechamber. In contrast, an encounter located in the place itself is much harder to avoid, and any encounter located in the environment is quite likely to be missed by the player entirely. Basically, how optional you want an encounter to be should dictate where you put it.

Image 8 - Enemies camping in the place and guarding the antechamber

Readability

One quality of the levels generated using this structure is that they, to a certain extent, create ‘readability’. There is a certain logic to navigating these levels that the player will likely pick up quickly enough. And where you might intuitively think this would expose the underlying structure and quickly grow stale, we suggest it actually does the opposite: it enhances the gameplay and bolsters player agency.

As the path is typically easier to navigate than the environment and the place and antechamber are clearly marked, it is very likely that the player travels the path first in order to check out the main challenge. This introduces the opportunity to foreshadow content and the challenge along the path. The existence, and nature, of the environment likely hints at other possibilities, but poses an interesting choice: is it worth trying to avoid the main challenge and seek out an alternative route? And if that route can be found, can the player use it at all, is it even worth the risk?

For a game like Unexplored 2, these considerations are part of the core experience, and if the level structure helps the player to uncover the nature of the challenges, it helps the player to make an informed choice. The game might strongly suggest certain approaches, but ultimately it is up to the player to make the choice. The level structure dictated by the theory of the place facilitates a strategy for the player to uncover the options before committing to any of them.

Furthermore, a clear and consistent structure invites player anticipation in a very similar way as a structured plot invites reader anticipation in a novel. That doesn’t necessarily mean that the player needs to know what will happen exactly. The level should still be allowed to throw a couple of curve balls once in a while. This is where the variations described below come into play. But the very notion and existence of these curve balls strongly implies readability and the possible, intentional encouragement to misread a level.

Variations

There are many possible variations on the base structure of the theory of the place. The variations discussed below are just a few examples. We suspect that there are plenty more, especially as variations take into account the specific nature and mechanics of the game.

  • The environment might hide gameplay opportunities designed to help overcome specific challenges posed by the place, antechamber, or secondary entrances. It is up to the player to brave the challenges of the environment (if any) to find them. It might even be possible to hide a key item that is needed to gain access to the place or the vault in the environment like this. It might even be wise to mark such a sight with a secondary landmark, or possibly use secondary landmarks as red herrings luring the player into a hazardous area.

  • A secondary entrance might be an escape route rather than an actual entrance. Either it is impossible or very hard to use it to gain access to the place. Such an escape route creates the possibility that the main entrance can only be navigated once to gain entrance. Creating a new and unexpected challenge of finding your way out again.

  • A secondary entrance leading directly into the vault creates an opportunity to bypass any encounters in the place. That is if the entrance can be navigated in both ways. Perhaps the player is trapped in the vault, but has access to its treasure in order to deal with the challenges offered by the place itself.

  • The place might actually be isolated from the environment, or a part of the environment might be isolated from the rest of the level. This implies that these parts of the levels are connected to other levels in some way and works best if the player can see the isolated parts. 

It is important to see the large expressive range the theory of the place has. We started implementing this structure more than half way through development, but so far there has not been a level template for which it has not been applicable in one way or another. On the one hand this is because many typical fantasy adventure levels fit right in. Castles and ruins are the prime examples used to illustrate this article, but the place can as easily be a clearing in a dense forest, or a rocky outcrop in a swamp. You can even make a classical dungeon, by setting up the place as a treasure room in that dungeon, with the environment being the sprawling dungeon itself, and the path likely to be hazardous or well guarded.

On the other hand, the structure is intended to be flexible, with a lot of opportunities to come up with interesting variations. These variations might be very specific to a particular game and its mechanics, or could hint at more generic patterns that might be applied to a variety of games. The theory of the place as presented here is not set in stone, but rather a starting point for the exploration of level design and generation spaces. One that we found very fruitful for our game, but one we believe would benefit other games just as easily. 

Implementation

One reason the theory of the place has proven to be very effective for us is that it plays really well with the way we have set up our level generator. Without going into too much detail, Unexplored 2’s level generator makes use of a series of transformation steps using transformational grammars to generate levels from predesigned templates. These templates indicate the structure a level should have, can specify gameplay features to be placed in the level, and suggest themes the level generator can use to flesh these things out. In short, the level templates are a direct reflection of the structures described by the theory of the place.

The structure, gameplay requests and themes are passed to the generator as a set of instructions. For example, the structure might look something like this:

Structure: MediumSize + PlaceIsCentral + PlaceHasVault + EntranceByBridge + PathLeadsSouthAndDown + BuildHazardousEnviroment 

Request: RoomIsPlace + AddFortifications + AddLandMark + RoomIsVault + TreasureChest + RoomIsAntechamber + SpawnGuard + RoomIsEnvironment + AddOpportunity 

Themes: Forest + SnapRootTrees + SecretPaths 

First the structure creates the rough outline for the level. It generates a place in the center of a medium sized level by activating specific transformational grammar rules to that effect. It then adds a vault to it and connects it to an antechamber via a bridge. Next, it creates a path south and places the entrance at the level’s border, and creates an environment branching out from the path and possibly looping back at convenient places. All parts of the level are marked with their respective structural roles.

Next, the request indicates the specific locations within that structure (‘RoomIsPlace’) and can activate rules to decorate and populate the level to specification. Finally the themes are used by the level generator to fill in the other details. In this case they serve to make sure the environment and its hazards are made to fit with a forest theme with dangerous trees and secret paths.

The actual templates we use for Unexplored 2 are more complex and detailed. Most importantly, they allow for some randomness as well. Instead of specific instructions we can also specify a range of possible instructions at any place in the lists. And given the generative grammar approach we take to generation, it is actually quite easy to generate these instructions from dedicated grammars themselves!

Figure 9 - The place is a ruin in a hazardous forest

If you want to see more about the specifics of template design for Unexplored 2, we can recommend you check out our dev channel on Twitch. In particular, the live design session we did to create additional variations in a level generation template should give you ample opportunity to see the generation pipeline (link).

Chaining & Nesting Places

In general the places we have been discussing thus far are relatively small. A single place with a few optional challenges and one of two encounters. Although, we have learned from experience that in many cases there is much merit to these smallish places, there are cases where we want the levels to be larger. Rather than expanding the place structure described above, we found the solution in chaining and nesting these structures into larger wholes.

Image 10 - A small place which function simply is to provide access to the next level.

Chaining levels is relatively simple. The place of a level that might contain a passage to the start of the next level. In fact, the whole reason the player wants to reach the place might be because they want to continue to the next level. Linking levels in this way can easily create chains or branching trees of levels. But Unexplored 2 wouldn’t be a worthy sequel if we didn’t come up with a way to include multiple connections and cycles in this structure as well.

Image 11 - Chaining two levels

By adding connections between levels from other locations within their structures it becomes possible to replicate the base structure of the theory of the place on the level of a collection of levels in addition to the level of each individual level. For example, if a castle (place) harbors a staircase into a crypt (second, linked level), it might be possible to create an extra passage somewhere from the environment of the castle to the environment of the crypt. In effect this creates the functional equivalent of a secondary entrance into the castle itself.

Each connection itself might also be expanded into a complete level in and of itself. For example an underground tunnel level might create an alternative connection between the environment and a place as is illustrated in the castle level below.

In the grander scheme a third level, reachable from a secret room (the place) within the crypt, fulfills the same structural role as a vault. Especially if the crypt also hides a special key mechanism that is required to enter the secret room.

Conversely, the theory of the place might even be applied within the confines of a single room, where the room itself might be the environment, a platform on the far end room could be the place with clearly marked path flanked by columns leading up to the platform.

Image 12 - Structure for a castle level

Extended Example

The level playthrough described below illustrates how all these things come together. It is castle level generated for Unexplored 2. The level includes a number of ‘encounters’: there is a nest of ‘skiders’, a monster particular to Unexplored 2. There is also an inoperative magic gate, and some treasure hidden inside the castle. All three encounters are placed in the level individually and independently of the level’s template. Each could be a reason for the player to explore the castle.

Image 13 - The castle’s exterior

  • You enter the level at (A). 

  • First you encounter some Skider eggs (1). 

  • Next you discover the castle's main gate is broken (2). 

  • Skiders at (3) guard a cave entrance (B).

Image 14 - The castle’s tunnel

  • The entrance takes you into a cavern where you run into more skiders (4), deal with hazards (5), and some more skiders (6). 

  • You discover a secret door (7) leading to a room with a locked door (8) and a staircase leading up (C).

  • The stairs take you to the castle's main court (9). 

  • Here you encounter the skider broodmother and number of skider eggs that can hatch any moment. 

  • A flight of stairs leads you down to another court with an inoperative magic portal (10), 

  • and a building you can enter (D).

Image 15 - The castle’s interior

  • Inside you find a shrine to deity Raaf with some more skiders and two chests (11). 

  • One of them contains the key for the door at (8). 

  • Now you can enter the locked room down in the cavern (12) where some treasure might be found.

A few alternative routes exist through this level. If you have a powerful enough spell item you might have been able to smash your way through the gate. Or possibly you could have used a teleportation device to make your way into the place. A difficult climb inside the cavern would have allowed you to bypass some of the skiders and the secret door. A more dramatic trajectory might have started as the player enters the level through the magic gate right at the heart of the castle!

In this set-up there's a couple of variations that can drastically change things. For example, the main gate could also be open, locked with the same key used for (8), or opened with a lever from within the courtyard. The magic gate might be located inside the building. Or the building and the tunnel might be connected directly. Either instead of or complimentary to the stairs leading up to the courtyard.

Different encounters could also put a spin on things. If bandits occupied the castle, they might have set up their camp in the court, and guarded the cave entrance, but not the inside of the cave. Or the main objective might have been a larger treasure located at (12). With a party of competing fortune seekers camping in the castle or at the cave entrance.

Conclusion

All in all, we are quite happy with the theory of the place. As I hope to have illustrated, it helps us generate levels that create interesting challenges for Unexplored 2. Even though the structure itself seems to be quite obvious, it turns out that it is very, very important that our level generator is able to work with its elements deliberately. It leads us to conclude that a level generator can only be as good as the design philosophy it implements and/or is able to express.

We strongly believe that the value of the theory of the place is not restricted to the generation of levels for our game. Its ideas can be easily incorporated into other level generators, but also inform hand-crafted level design. We have found that the schematics create a very efficient shorthand notation for level ideas. It has already proved to be quite invaluable to keep track of the template designs and the structural variations each template encompasses. 

In addition, we have been harvesting and brainstorming level design patterns using this notation and theory. It certainly seems to adhere to the original philosophy behind design patterns in that, according to Christopher Alexander, design patterns need to be informed by a theory about what constitutes quality in the domain of the pattern language. In our context: level generation for an roguelite action-rpg, the theory of the place definitely performs wonderly well!

Unexplored 2 is available as an early access title on Epic Games Store. You can also wishlist it on Steam. 

Figure 16 - Quick notes to capture a level design  

Read more about:

Featured Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like