Enemies were designed with multiple behaviours: patrolling when unaware, chasing when the player was visible, attacking when in range, and checking their surroundings if the player was lost. These state changes were handled through Unity’s NavMesh system and custom C# scripting, forming the foundation of the game’s stealth mechanics.
AI Maze Game
A top-down stealth game created in Unity, focusing on AI-driven enemies. The player navigates a maze, eliminating enemies who patrol, chase, and communicate when spotting the player. The project was designed to demonstrate practical AI programming skills in Unity.
-
AI Detection and Player Search
To make the AI more dynamic, I implemented a “last known position” mechanic. When enemies lost sight of the player, they would move to the last location, rotate 360 degrees, and only return to patrol if the player was not found. Early versions had issues with spinning too fast, which I solved by adding a rotation speed multiplier.
-
Enemy Communication System
Enemies could alert each other when spotting the player. Initially I attempted a constant update check across all enemies, but this was inefficient. I replaced it with Unity’s physics overlap sphere, which collected all nearby AI within a radius and called their listening function, making enemy collaboration smooth and efficient.
-
Player Combat and Stealth Mechanics
The player could engage enemies directly or attack from behind for double damage, encouraging stealthy play. This combined with enemy patrols and communication created a layered challenge where players had to balance speed with strategy.
-
Persistent High Scores Across Scenes
The game included a timer for players to complete the level as quickly as possible. To carry times across scenes and display best scores on the main menu, I implemented a singleton object that preserved variables between scene loads.
-
Unity Version Control for Cross-Device Development
During development I had to switch between PC and laptop, which created issues transferring files. Using Unity’s version control system solved this, allowing me to reliably sync project changes and avoid data loss.
