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.
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,
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.