
Eclipse Temple
AI PROGRAMMER & GAME DEVELOPER
2025
A temple-themed action game built as my final project for Artificial Intelligence for Games.
I built an enemy AI system where giant guardians independently patrol, investigate sound, pursue the player, attack, enter a probability-driven Rage state, and respond to the environment through NavMesh navigation.
Solo developer · Unity · C# · AdvancedFSM · NavMesh
Finite-State Enemy Behavior
Each giant uses the same AdvancedFSM logic but runs it independently, allowing multiple enemies to react to the player based on their own perception, position, and health.
State transitions are driven by sensory input, distance checks, health, and probability.
PATROL
Move between assigned waypoints.
INVESTIGATE
Navigate to the last position where a sound was detected.
CHASE
Pursue the player after gaining visual detection.
ATTACK
Perform a melee attack when the player is within range.
RAGE
At low health, has a chance each second to enter a more aggressive state.
DEAD
Remove the enemy and drop the shard required for progression.

PATROL
/ \
SOUND SIGHT
⬇ ⬇
INVESTIGATE ➡ CHASE
⬇
ATTACK ➡ RAGE
⬇
*DEAD
*Any active state can transition to Dead when health reaches zero


Sensing the Player
The giants use three different forms of perception, allowing the same enemy to react differently depending on how the player reveals their position.
SIGHT
Detection uses field-of-view and range checks combined with line-of-sight testing, so walls and other environment geometry can block vision.
SOUND
Player actions generate sound events that contain a world-space position. Giants store that location and enter Investigate behavior rather than immediately knowing where the player is.
TOUCH / PROXIMITY
Close-range detection handles the transition into melee combat.
(Pictured: The enemy's Senses component showing editable distance settings for each sense, paired with an in-game view of an enemy with Gizmos visualizing their respective ranges.)
Sound as Information
Sound detection is not just an on/off alert.
When the player generates a sound, the event passes a Vector3 world position. A giant stores that position as the last heard location and navigates toward it through the Investigate state.
(Pictured: Script for the player noise emitter.)


Probability-Driven Behavior
Low health does not immediately force a giant into Rage.
Once the low-health condition is reached, the AI has a chance each second to transition into a more aggressive state. This introduces behavioral variation while still tying the decision to the giant's current game state.
(Pictured: Script for the enemy rage state.)
Navigating the Temple
Enemy decisions are executed through Unity's NavMeshAgent system over a baked NavMesh.
The level also includes two dynamic navigation objects and a custom-cost area in the second room, allowing the environment to influence how agents move through the temple.
I designed the temple layout myself using modular assets from a Unity Asset Store environment pack, building the level around a temple-raiding concept inspired by Indiana Jones.
(Pictured: The game map with the walkable NavMesh turned on, and a video of one of the dynamic objects.)



Making AI Behavior Readable
I exposed the AI's decisions through the HUD so the player could understand how enemies were reacting.
The Sense HUD displays which sense is currently detecting the player and the nearest giant's current state. Combat UI also communicates player health, successful attacks, incoming damage, and whether enough shards have been collected to use the altar.
(Pictured: Gameplay displaying the high-cost area and the enemy that relies on sight.)