top of page
new_background.png

Mercy

Team Size: 4

Game Engine: Unity

Role(s): AI Programmer, UI Programmer

In this game, you play as a desperate diver hoping to salvage whatever riches they can from the ocean floor. However, the main obstacle stopping you is the local legend that they call "Mercy". Collect as much treasure as you can before you leave, but know that she has an eye on you.

Key Contributions

  • Formed the behavior states for the shark: idle, interested, and threatened with different movement patterns during each state such as moving towards the player and occasional dashing.

  • Engineered a waypoint indicator system in the player's HUD so that the player is aware of the direction and distance of their shark cage, either displaying itself on the edges of the player HUD or directly above the waypoint location if the cage is in the player's vision.

  • Built vision cones and body sensors on the shark to give them awareness of the player's location and affect their behavior state, indicated by gizmos in the Unity Editor for debugging and fine tuning the shark's settings.

screenshot_02.PNG

Game Features

I designed the main mechanic in this game where players must outmaneuver a roaming shark to survive. The shark has three distinct states: "Wandering," "Interested," and "Threatened." When the shark is in its default "Wandering" state, it aimlessly roams the map. When it detects the player either through proximity or vision, it enters an "Interested" state, in which it seeks out the player's approximate location. If the shark senses or spots the player at close range, it enters a "Threatened" state, chasing them directly and eventually leading to a Game Over if the player is caught. As players collect treasure and points, the shark's traits become more aggressive, and the chances of encountering it increase. Players must also keep track of their oxygen levels, which gradually deplete over time and temporarily drain faster when dashing. The game incorporates various UI elements, such as a waypoint that indicates the distance and location of the player's shark cage, a color-changing indicator that communicates the shark's behavior state and distance, and progress bars for collecting items and for knowing how much oxygen the player has left.

Issues and Challenges

The most significant challenge I encountered during this project revolved around developing an AI system, which required a system to quickly edit the AI to achieve the project's desired results. To create natural shark movement, I implemented a mechanism where the shark gradually rotates towards its intended direction before moving directly towards the target node. For the shark's detection system, I designed two vision cones: one for long-distance detection triggering "Interested" behavior and another for short-range detection triggering "Threatened" behavior. Additionally, I incorporated a sphere for body detection, initially marking the shark as "Interested" and transitioning to "Threatened" if the player remained in close proximity for an extended period of time. Fine-tuning these behaviors was something that needed to be iterated on regularly, so I focused on creating visual gizmos to help the team visualize the AI's behavior, enabling us to adjust the shark's passivity or aggressiveness effectively.

 

Another issue arose due to the large map size, which could potentially lead to minimal or no interactions between the shark and the player. To address this, I implemented a system where the shark could teleport within the player's range if they had not been in close proximity for an extended duration. This ensured a constant threat presence for the player throughout the game.

Reflections

Creating the enemy movement in a 3D game was a significant challenge for me, as I primarily work with 2D games. I had to iterate on the shark's behavior many times, but by making tools for Unity's inspector, it made the job easier to adjust the primary characteristics without having to go through the code. Drawing gizmos for the shark was especially helpful, as it provided a better visual of the shark's sensing abilities. This game allowed me to learn new things, and I worked closely with another programmer, sharing the work between the shark AI and the player controller. We built trust and collaborated effectively on every aspect of the project's code. I feel that this project demonstrates my ability to work outside my specialty with confidence.

bottom of page