Today I’m here to talk about how I approached the labyrinth section. In the second act/chapter of the game, Teresa will find herself wandering through dark tunnels and narrow passages, looking for a way out. This is where the “labyrinth” part comes into play. That’s not really a labyrinth like the ones we are used to seeing in puzzle magazines, but more of a chain of intersections and corridors that, experienced from the inside and not from above, make it more difficult to find your way out. It has been the first time I tried my hand at the logical construction of a labyrinth in Unity. I decided, during meshes modelling, to avoid creating a single object, but to model several pieces: corridors, intersections, tunnels, and to assign to each of these pieces a name and a code for each exit, so that I could create a modular labyrinth that could be modified at will.
To make it clearer I did it this way: A corridor will have the name “burrow1” and its 2 exits will be called “burrow1A” and “burrow1B”. A junction will have the name “burrowcross1” and its 4 exits will be called “burrowcross1A”, “burrowcross1B”, “burrowcross1B”, “burrowcross1C” and “burrowcross1D”. A crossroad will be named “burrowcross1” and its 3 exits will be “burrowcross1A”, “burrowcross2A” and “burrowcross3A”. And so on for each module that will make up the maze. After having drawn a map on a sheet of paper, I created my list of rooms, exits and entrances, so that when the character enters a room, he gets a string variable with the name of the place where he is. He brings with him the string until the next room; in this way I always know the starting place of the player and, making a query on the string variable, I can present the correct room that he will find after the previous one. This choice gave me the opportunity to reduce the time devoted to modelling, allowing me at the same time to obtain complex and modifiable mazes.
Thanks to the light and sound effects inserted in the right places, the result it’s, in my opinion, pretty good. The player finds himself wandering in dark areas, only helped by the faint light of his lighter, offering an entrancing and in some cases claustrophobic setting.
See you in the next update, in the meantime if you are curious and want to try the first part of the game, you can download the executable file from here:
p.s. the game is developed in Italian and for now temporarily translated into 4 languages (EN,FR,SP,DE) with automatic online translators, so it’s likely you’ll find some translations errors, but it should be possible to make sense of the story.