top of page
Operation Phantom
In this project, I set out to learn how to develop a stealth-based game inspired by the mechanics and design of the Hitman series. My primary goal was to understand and implement core stealth gameplay features, including player detection systems, AI behaviors, and mission design that challenges players to navigate environments undetected. This project allowed me to explore the intricacies of stealth mechanics and how to create engaging scenarios that encourage strategic thinking and planning.
Role
Lead Developer
Game Engine
Unity
team size
1 person
Genre
Action Role-Play (Souls Like)
Technologies used
Unity
C#
GIT
Photoshop
Audacity
Trello
Role and Responsibilities
In this solo project, I took on the role of lead developer and coder, focusing on designing and implementing key systems essential for a stealth-based game inspired by the Hitman series. My responsibilities included developing core stealth gameplay mechanics, such as player detection systems that adapt to the player's actions and surroundings, dynamic AI behaviors that respond intelligently to player decisions, and mission structures that challenge players to think strategically and navigate environments undetected.
As the sole developer, I managed every aspect of the project's technical implementation, from scripting stealth mechanics to ensuring smooth interaction between player actions and AI responses. I also worked on designing levels that supported stealth gameplay, incorporating features like hiding spots, patrol routes, and interactive objects. This project allowed me to refine my skills in coding complex AI systems, balancing gameplay difficulty, and creating immersive stealth experiences that reward careful planning and execution.
Design Process
In developing Operation Phantom, I followed a five-step design process, which I will elaborate on throughout this portfolio piece. Each phase was crucial in shaping the game's mechanics, systems, and overall player experience.
1
DESGIN DOCUMENT
prototyping
rought blockout/coding
2
3
refinement of code and level design
4
passover and feedback
5
Design Document
The first step in my design process was creating the Game Design Document (GDD), where I organized all the initial ideas for Operation Phantom and planned out the key features to be included. In this document, I outlined the core gameplay mechanics, establishing a clear vision for how the game would function and what players could expect in terms of experience and interaction. This foundational step helped guide the subsequent phases of development.
link to game design doc : https://docs.google.com/document/d/1oLVK0V9AhDraieMKt-h7z-ZaEuZb6k6NJboI5nn3GzE/edit?usp=sharing
Core Game Pillars
-
Player Detection System
-
Responsive AI
-
Mission Design
Code Example
Guard Script Overview
This script is a key component of a multiplayer game developed in Unity, responsible for synchronizing player-related data across the network. It leverages the Unity Netcode for GameObjects framework to manage player states, inventory, equipment, combat interactions, and more in a distributed multiplayer environment.
Key Features
-
Patrol System
-
Vision-Based Player Detection
-
​Chase and Shoot Mechanics
-
Health and Damage System​
1. Patrol System
-
The guard follows a list of waypoints in a sequential or reverse order, creating a patrol loop.
-
Uses smooth rotation and movement to emulate natural motion.
-
Plays walking animations while patrolling.
2. Vision-Based Player Detection
-
Detects the player within a defined visionRadius using Physics.CheckSphere.
-
Updates the guard's state (isAlreted, playerInvisionRadius) to control behavior transitions.
3. Chase and Shoot Mechanics
-
Chase: Moves towards the player's position, increasing speed and playing running animations.
-
Shoot: Stops movement, rotates towards the player, and fires using a raycast.
4. Health and Damage System
-
The guard's health decreases when hit, triggering an alert state and expanding the vision radius.
-
Plays a death animation and disables the AI upon reaching 0 health.
Code Challenges and Solutions
Guard Script Challenge and Solution
1. Managing Alert Transitions
Challenge: Ensuring the guard transitions smoothly between patrol, chase, and shooting states based on player proximity and alertness.
Solution: Used boolean flags (isAlreted, playerInvisionRadius, playerInshootingRadius) to manage transitions logically.
2. Preventing Rapid Shooting
Challenge: Avoiding the guard spamming shots when the player is in the shooting range.
Solution: Implemented a cooldown using the previouslyShoot boolean flag and Invoke to delay subsequent shots.
Challenges In Game Development Overcome
I faced substantial challenges related to the gurad ai and npc walking. During the development of the Guard AI system for this project, I encountered several challenges related to creating a robust and functional waypoint traversal system and ensuring fluid AI behavior.
-
Waypoint Traversal Issues:
The initial implementation of the waypoint system had logical errors in how the AI handled switching between waypoints. Specifically, the logic for reversing direction when the guard reached the end of the waypoint list was flawed, causing the guard to get stuck. To resolve this, I carefully restructured the logic for updating the currentWaypointIndex to ensure seamless back-and-forth movement. I also introduced safeguards to prevent index out-of-bound errors and adjusted the proximity threshold for waypoint switching to improve responsiveness. -
Overshooting Waypoints:
The guard would often overshoot waypoints due to an overly small threshold for detecting proximity to the target. By increasing the distance threshold and decoupling movement from rotation, I allowed the guard to approach waypoints more naturally while maintaining smooth rotations towards the target. -
Animation Synchronization:
Ensuring that the walking animations matched the guard's movement was another key challenge. I updated the animation triggers (Run, Walk, and Shoot) in sync with the guard's movement state, ensuring a seamless visual experience during patrol. -
Directional Rotation:
The guard's rotation occasionally appeared jerky due to incomplete handling of rotation vectors. To address this, I added a check to ensure the lookDirection vector was not zero before attempting rotation, resulting in smoother and more natural behavior. -
Debugging and Optimization:
Debugging issues with AI state transitions and waypoint traversal required extensive testing. Using debug logs and visual gizmos, I identified and resolved areas where the AI logic was failing. This process also involved optimizing the movement and rotation updates for better performance and fewer redundant calculations.
Through these efforts, I was able to design a fully functional and polished AI patrol system. This not only improved gameplay immersion but also demonstrated my ability to overcome complex programming challenges, debug effectively, and implement scalable solutions.
bottom of page