Scary Game - FreetimeStudio/Adventure-Kit-Public GitHub Wiki

Header

Starting point for first person horror games like Amnesia or Outlast.

Character

The character is the central game play element in this example. It holds a lamp item and can interact with lockers and closets. It also takes care of Post FX to indicate damage.

Oil Lamp

Oil Lamp

The only item the character has. The lamp has a point light component with an animated light function. While in use the amount of fuel gradually drains and the lower the fuels the more the lamp flickers until the flame finally dies.

Hiding Spots

Locker

Locker

The player can use lockers to hide from enemies. If the player uses a locker it becomes the character's current zone and the enter animation is played. Hitting the use key again will exit the locker. Lockers are zones that restrict the character's movement completely and fix it to a specified orientation. The player can still look around, though.

Closet

Closet

The closet is a skeletal mesh with enabled physics simulation. The two doors have hinge joints to be movable. When the player wants to grab something a trace is executed to find what the player is looking at. A scene component is attached to it to dynamically store the location where the player put their "hand" and a physical force is applied to that location taken from the mouse movements.

Enemies

Enemy

Though they look like floating orbs, they are actually regular characters, but withouth a skeletal mesh and a particle effect in its place. The enemies are controlled by a behavior tree. While not sensing the player character they choose a random point on the map, go there and then do a 360 degrees turn to look around. If they see the player they will start to pursuit and move to the last seen location. When in range they will start to shoot the character. In case the player entered a locker and the enemy saw it it will throw the player out of the locker. If the enemies lose sight of the player they will estimate the taken path roughly by adding the last known speed and direction to the location where the player was last seen.

⚠️ **GitHub.com Fallback** ⚠️