By Joris Dormans (November, 2022)
This is a blog about our development of Unexplored 2: The Wayfarer's Legacy. This game features state-of-the-art content generation, generative storytelling, emergent gameplay, adaptive music, and a vibrant art style.
The past few weeks I have been working on improving traps and hazards in Unexplored 2. And if you know me a little, you should know that I like to approach this type of thing from a structural perspective: I like to distill generic components and focus on the various ways in which they can be connected. A structuralist approach plays very well with the content generation we do in Unexplored 2, but hopefully it also allows you to apply these ideas to other games quite easily.
The traps and hazards we had in Unexplored 2 definitely could do with a little love. They were mostly designed in isolation and pretty early during development. Reed Lockwood's recent talk for Roguelike Celebration prompted me to have a fresh look at them again. It nudged me in the right direction, but also Brian Walker's approach with 'machine rooms' in Brogue should be mentioned as a direct inspiration, even if I researched that years ago.
Filled with generated ruins to investigate, Unexplored 2 is an excellent vehicle for sophisticated traps.
The first thing you have to consider is that a trap is not a single component. It actually consists of two things: a trigger and a hazard. Even when they are directly related it really helps to design and consider both components individually. It was actually the biggest mistake I made when I was first adding traps during the early development of Unexplored 2: I quickly cobbled together an invisible pressure plate that would explode when you step on it. And for some reason we never reconsidered its design until recently.
It is a lazy and poor design. It doesn't create interesting situations and it basically feels very unfair: how was the player supposed to know it was there in the first place? Lockwood called out exactly this design as flawed. To my defense, it's actually quite surprising how often you see them. Sure there might be a place for a trap like that, but simply throwing them into generated rooms at random is a very bad idea.
In this case the trigger is exactly the same thing as the hazard. They are both invisible, and once triggered, the hazard deals immediate damage. Considering the trigger and the hazard in isolation and having a closer look at their individual attributes really helps improve this design.
An early trap design in Unexplored 2, at least in this case the trigger wasn't hidden...
The first design rule should be: the trigger may be invisible or the hazard may be invisible, but they cannot be both. A simple improvement on this design is to simply make the pressure plate obvious, but leave the hazard invisible. Another would be to make the hazard visible, and here it helps to separate the trigger of the hazard: what if hazard is a clearly visible magic turret that dominates a dungeon room? At least its presence may make the player aware of the possible presence of a hidden trigger.
There are more attributes of the trigger and the hazard to consider here. How quickly does the hazard activate after triggered for example? If the turret takes time to power up before firing you at least give the player a chance to avoid the hazard after triggering it. In fact, maybe, just maybe, you can get away with an invisible trigger and an invisible hazard, but only if the hazard does not trigger instantly. The tables below list some important attributes of both triggers and corresponding hazards.
Trigger Attributes | |
Visibility | Is the trigger visible or invisible? Is it partly hidden? Can the player perform actions to reveal hidden triggers? |
Avoidability | Can the player avoid the trap? Can they jump across it, or does moving slowly prevent it from triggering? |
Times | How many times can the trigger activate the hazard? Once? A fixed number of timers? Or can the hazard be triggered indefinitely? |
Cooldown | If a trigger can be activated multiple times, is there a cooldown period in which it cannot be triggered? |
Delay | When triggered does hazard trigger immediately or is there a delay? |
Activation Time | Once triggered, how long does it activate the hazard? Indefinitely or only for a specific period? |
Reversibility | Once triggered, can the trigger and the hazard it triggers be deactivated? |
Readability | Are any indications near the trigger that allow the player to predict what might be triggered? |
Tinkering | Does the trigger allow the player to tinker with it? Is it possible to disarm the trigger? Or to modify it in such a way that it can only be triggered by enemies? |
Hazard Attributes | |
Visibility | Is the hazard visible or invisible? Is it partly hidden? Can the player perform actions to reveal hidden hazards? When it activates is the visibility affected? |
Delay | Once activated, is it active immediately or does the hazard need time to 'warm up'? |
Threat | What is the nature of the threat? Does it cause damage? Does it blind the player or impose other negative status effects? Does it summon or alert enemies? |
Period | Once activated, is it constantly causing a threat or is the threat periodic somehow? |
Tinkering | Is it possible to tinker with the hazard? Can it be disarmed? Or changed in a way that it only affects enemies? Can this be done when it is activated or when it is not activated? |
Progressive | Does the threat increase or decrease every time the hazard is triggered? |