Sections:
About
The Museum Heist is a first-person stealth game inspired by genre-defining games such as Dishonored, Hitman and Thief. It features stealth mechanics such as evading AI guards and security cameras to avoid detection and level layouts that give players multiple options for sneaking around. It was the first game I made without strictly following a tutorial.
Design
Highlights
Gameplay
The core game loop of The Museum Heist centers on players frequently evading guards and security cameras as they work towards completing their current objective and successfully carrying out the heist. The guards are the player’s biggest threat, as getting caught by one will result in a game over and the player will have to restart from the most recent checkpoint. However, the player has a few different options when it comes to dealing with them:
To encourage players to be stealthy, I made running generate a lot of noise, making walking and crouching more effective for avoiding attention. As a result, players are generally inclined to use running only when absolutely necessary. In addition to the guards, players must watch out for the cameras, which monitor key areas and alert the guards of suspicious activity in the area. To avoid them, players have to pay attention to their movement patterns and stay out of their sight range.
AI
The guards are all controlled by separate instances of the same behavior tree, which has a few main states. These states include patrolling, investigating suspicious activity, and chasing after the player. I tried to find a good balance between making the guard AI aware of their surroundings but also a little dumb so that sneaking around them wasn’t overly challenging.
I did this by giving the player a brief period of time to lose the alerted guard's attention when initially detected. The guard will get suspicious when they see or hear the player, but they won’t outright chase after the player until their detection meter is completely filled. Even when the meter is completely filled, the player is given an audio cue and a brief period of time to react before the AI comes charging at them.
Level
The level design played a crucial role in reinforcing the stealthy playstyle I aimed to guide players toward. With good timing and a little patience, players will generally find completing the game to be much easier than trying to brute force their way through all obstacles.
For example, consider this room, which is monitored by a single camera covering the entire area. Technically, the player could just run through the room haphazardly and deal with whatever consequences come their way. However, the room contains multiple carefully placed displays that provide the player with the opportunity to hide from the camera’s view.
The museum’s design in general is mostly centered around this principle of rewarding a stealthy playstyle by making it easier to avoid threats when players sneak around effectively. This design approach also makes it easier for players to recover from being detected, as they have plenty of spots to hide from alerted guards until they are no longer suspicious.
Programming
Highlights
Since this was my first time making my own game in UE without strictly following a tutorial, I used this project to get very familiar with the editor and coded most of the project in blueprints. One of the biggest aspects of this project included programming the AI guards and tweaking things so that they would work as intended.
One thing that was a bit challenging to get feeling good was the guards’ patrolling movement. The blueprint function on the right (split in two parts) shows how I approached this specific feature. To put it simply, I created a blueprint that allowed me to create spline based paths, which are then referenced in the corresponding guard’s blueprint through a custom component. When the patrol task is called in a behavior tree, it is able to reference the relevant path from the guard’s blueprint, use it to move the guard along the spline and then have the guard wait at specific rest points for a specified amount of time before continuing.
Another interesting part of programming the guards' movement was making the guards rotate when they reached their resting points so that they would not be staring in an awkward direction. To achieve this, I created an event in the guard blueprint that would smoothly interpolate from the guards current rotation to the desired rotation using a timeline while the rotation animation is being played. The function also calculates which way would be most natural for the guard to rotate based on the delta (rotator) function.