This game is a stealth game where the goal is to reach the end of this maze while only being able to use set camera angles which will allow the player to only see some of what is coming.
This game was created in order to showcase a variety of skills which I have acquired throughout my time in my Advanced Unity class. The game incorporates many elements from stealth games as well as some from speed running games.
One of the main features which this game has is the restricted camera angles. The idea for this feature came from one of the scenes in The Legend of Zelda: Ocarina of Time where young Link is tasked with sneaking through the castle courtyard without being caught by the gaurds. That scene also used fixed camera angles and I thought that they would be perfect for this game as well. The angles were chosen in order to make the game feel as if it is becoming harder without significant change in the AI behavior. In the photos on the left you can see several of the angles which are shown throughout the game, notice how some reveal much more information about the current gaurd locations than others, this was intentional.
An issue which presented itself early on was that the player was moving in reference to the world instead of the camera, and because of this the controls felt awful to use as no button ever made the player move in the "correct" direction even though the player was technically moving correctly. To solve this issue I needed to create code which would change the direction that the inputs moved the player in respect to the camera. In the code to the right you can see the x and y movement values being read in as well as modified toward the bottom. The equation at the bottom takes the input values and uses trigonometric functions to say which direction the player should move given the rotation of the camera.
This game utilizes a behavior tree system in order to control the actions of the various guards located throughout the maze. This system is easy to understand and easily modifiable. This tree uses a base class called nodes which are then expanded to represent actions, sequences of action and eventually trees.
The code for this tree is shown on the left and is very simple. If the guard can detect the player it will begin a sequence called "Chase" in which it will pursue the player until it can no longer see the player, it will then resume it's normal patrol by locating the closest point to itself and then starting it's patrol from this point.
One feature of this game that is fairly simple, but makes the game more interesting is the saved times mechanic. The concept started out as a simple timer which would show the player how long the current game has been running, but quickly evolved into something more complicated. One of the most notable features is the addition of "splits" for each notable room cleared. These splits can be fully controlled by me and automatically create a list of times for the user. Upon clearing a level, the user's times will be saved if their total time is better than their previous total time or if there are no saved times. The images on the right show the UI when the player has previously saved times. Green numbers mean that the time is better than the saved time and red means that it is worse than the previous time. I found that all of this lead to the game being a little more enjoyable as it encouraged me to push my time down as low as possible.