Mechanics follow from goals

There were a couple of technical challenges I had to overcome in my new game SubTerrex, the first was to create a

realistic rope simulation and the second was to be able to include dynamic lighting effects. Interestingly, both the lighting based mechanic and the rope-based exploration evolved from my goals in the game rather than being an intrinsic goal that I had at the outset.


This blog post talks about how the two mechanics came about. In follow up posts I will talk about how they were implemented.

Goals of the Game

In developing SubTerrex I wanted to build the game around the gradual exploration of a mysterious system of caves. There are many different kinds of exploration but in this case I wanted to focus on giving the player a gradually evolving understanding of the cave, peppered with moments of surprise where  the player would think that they were, for example, crawling along a narrow ledge and then suddenly realise that they were in fact an the edge of a giant cavern.

There were a couple of levels that I wanted the exploration to work on. On the simplest level, I wanted the player to be able to explore a single cave but I also wanted to enable the exploration of the system of caves as a whole. This means that the player, or rather players, should be able to find interesting caves with unique features and be able to share those.

To meet this second goal I needed a lot of caves and so it was a fairly early design decision to go with procedural generation. Generating caves automatically would allow me to have a large number of difference caves and if the generation was rich enough, there should be some that had truly unique features.

Mechanics Following the Goals
Once the goals of the game were clear the mechanics of the game began to flow. I quickly was able to build a procedural cave generation system and it yielded nice looking caves. Each cave had a number of chambers and these were interconnected with tunnels.

Even at this stage though it was clear than two things stood in the way of the goals of the game. The first thing was that in 2D plan-view the cave was too easy to explore. The player can move around freely and cover a large amount of space. This means that the player is constantly moving to a new chamber and after a while the fact that the cave is really homogeneous starts to become obvious. The player will quickly stop caring about the space and the exploration will be limited to the contents of the chambers and not the cave itself.

The second issue is that the player can easily see his immediate and future surroundings in the 2D view and so there is almost no element of surprise. In zoomed out view the player can see the ground ahead of him clearly. By zooming in you can reduce this but then the understanding of the cave is much reduced as you can never see the walls of the chamber you are in.
The rope mechanic and vertical 2D presentation was introduced to address the first issue. Just going to vertical 2D improves matters but this alone would drive the game into a Metroid-style platformer. However, it would be hard to ensure that the caves were truly explorable using this approach alone. Adding ropes (and a limited quantity) forces the player to explore gradually, thinking about where to use ropes and where to travel by foot.

Even with this change though, there was still no element of surprise in the gameplay. It still felt like an obstacle course rather than an exploration. Adding dynamic lighting was the natural solution. I made the cave completely dark and then force the player to place lights to illuminate the path forward.

Halo Versus Fog Versus Light

Having settled on the need for light to reinforce the sense of exploration I had a few options. In general, a light-mechanic implies that the user has reduced visibility and this can be realised in three ways,

  • Introducing a halo around the player. The play area is dark except for a halo of light around the player. In general this works best for short times in 2D because it can be irritating for the player that they have to continually scan an area to build a picture of the game area. It is best used as a constraint mechanic where the player feels excluded and at risk from things they cannot see.
  • An alternative is a fog (fog of war). This works the same way except areas that the player has visited remain visible. It feels less constrained and introduces exploration without the need to continually scan the area.
  • The final option is true dynamic light. By true light I mean that the lit areas should include shadows so that a light put in front of a large rock shelf will reveal some areas but cast a shadow in others. In contrast to the fog approach, the shadows create uncertainty because what looks like a wall or an impassable area turns out not to be when you place a light in the right location.

I really wanted the game to capture the feeling of surprise when you crawl through a narrow space and gradually realise that you are standing in a cathedral-like cavern and so the decision was clear to go with true dynamic lighting.

What is interesting is how the type of mechanic flowed from the goals of the game. If I had wanted the player to feel like they were fighting against the environment rather than discovering it then the other light choices might have been good. For instance, if I included creatures that would attack the player then the fog probably would work well because you are going to be surprised when you find a creature hiding in the darkness.

However, I wanted the player to be surprised by the cave and for that I needed the shadows to play a role.