top of page

Emergency Protocol

ROLE

Lead Programmer

DESCRIPTION

Emergency Protocol is a 1st person horror game where you are stuck on a space station and need to repair the ships system to escape, while avoiding a blood thirsty monster thats on your tail at every turn.  If your flashlight starts blinking, hide. If you can't, run!

TIP: Hover over images to play videos

Project Length

6 of Weeks

GENRE

Horror/Puzzle

PLATFORM

PC

HOW THE A.I. WORKS

A.I. Overview

The A.I. has 5 states:

  • Patrol

    • Overview

      • When patrolling the enemy will find the nearest patrol point and do a check. Each patrol  point has a search chance that can be configured. If the check returns true, the enemy will head to that patrol point, if not it will find the next closest patrol point and keep checking until one return true. Because the A.I. was designed with hallways in mind, patrol points that are a 100% chance needs to be patrolled before the enemy A.I. 's patrols are reset for that room/hallway.  If 3 25% chance patrol points aren't checked but all the 100% chance ones are, the room will reset still. The A.I. was designed to favour hallways, and make room checking less than a 100% chance.​

    • Transitions

      • Seen​

        • If the player is inside the FOV gameobject's trigger, a raycast will be shot from the enemy's eyes to see if the enemy has a direct line of sight to the player. If it does, initiate the Chase state​

  • Chase

    • Overview

      • The enemy will chase the player.​

    • Transitions​

      • Seen

        • If the player breaks line of sight the enemy will go into the agitated state.​

  • Agitated

    • Overview​

      • The enemy will go to the players position, just like in chase​

    • Transitions​

      • Seen​

        • If the player breaks line of sight the Timer transition will begin​. If the player re-enters light of sight, the Attack state will be triggered again, and the Timer transition will be reset.

      • Timer

        • If the timer reaches 0, the enemy will enter the Search state​

  • Search

    • Overview​

      • This works the same way as the Patrol state, but instead only check a set amount. Once the enemy gets close to a locker, its searching animation will play, and if the player is in a locker that it checks, the player will be killed.​

    • Transitions​

      • Seen​

        • The enemy will go back into the Attack state​. If the enemy saw the player go into a locker, it will still search that locker, and go straight into the Attack state

  • Attack

    • Overview

      • If the player gets too close to the enemy its game over, the enemy will attack the player.​

Issues

Looking at the video above, used to show how patrolling works, you may have noticed that sometimes the enemy will Patrol to the closest point that is in a room that it has to walk past other patrol points to get to. Considering that the player rarely sees the enemy, this isn't noticeable when playing, so I focused my development time on other aspect of the game, but to fix this I would have to do a wall check, or instead of searching from the closest position of the Patrol points, I could check the navmesh agent's travel distance to a point for the closest few Patrol points, and check them in order of travel distance. 

Speed set to 0 for chasing, patrolling and agitated

bottom of page