The Game

You are trapped in a hotel with a terrifying monster lurking around. If you look at the monster, you die! Explore your surroundings with the help of a mirror, as you try to escape the hotel floor.

“A Glass Darkly” is a survival horror game with an immersive surveillance element built exclusively for VR.

Platform

PC

Engine

Unreal Engine

Language

Blueprints

Development Time

4 weeks

Team Size

4 x Designers

5 x 3D Artists

2 x 2D Artists

Platform

Engine

Language

Development Time

Team Size

PC – Oculus Touch

Unreal Engine

Blueprints

4 weeks

4 x Designers

5 x 3D Artists

2 x 2D Artists

My role

AI-behavior

Path Node-system

Art / Effects / Animation-implementation

My main responsibility was to script the AI character, we established early on that it should be capable of patrolling, searching and chasing. We also needed good control over when and how it appeared in the level, I made a flexible system for our level designers to implement scripted encounters.

I also worked with the artists to implement the art, effects and animations for the AI character.

AI States

The AI has four different states.

Patrol: moves to the next waypoint.

Searching: moves towards the position where the player broke the line of sight then takes a few more steps towards the players current location before reverting back to patrol.

Chase: moves towards the player.

Wait: used to create small pauses in scripted encounters or when opening doors.

(Executed in order from left to right based on conditions)

Path Node

When patrolling, the enemy follows these nodes to know where to go next and how to behave when it arrives there. We really wanted the enemy to feel threatening when it had appeared. Not just follow its route and never adapt to the situation. To make this happen the enemy can open doors and also turn back if it encounters a locked door and also go back to doing whatever it is supposed to do when it’s done chasing the player. It ended up being a good mix between having very controlled scripted encounters to scare the player and setting the AI free to be more of an obstacle for the player to avoid and get past.

I made many variables visible in the editor to allow the level designers to easily set up these events for the AI. The system is designed to always leave the AI with an option. It always keeps track of the node before and after the current one and also what to do next after an event such as turning back if it reaches the end of a path.

Animation

A simple system for changing to the correct animation for the current state. Sub-states for “Waiting”-state determines if the monster should idle or play a “knock on door” animation while waiting. I also send its current velocity to allow the legs to blend between walk and idle.

The upper body of the monster has different animations based on the current state.

Monster Effect

The monsters presence can be seen in the area surrounding it, walls become dirty and lights flicker. This was accomplished with a shader that applies these effects based on the monsters world position. When enabling or disabling the monster I added a smooth fade in/out effect to it.

This system can also be overridden to use the effect without the monster. Which was an effective way to scare the player without the monster.

There’s also a sound effect tied to this effect that’s based on the range to the player. This gives the player a warning that the monster is near, possibly before the player can see it.