Ee Xuan En, Arvin
The Amusement Haunted House
Game Engine: Unity 5
Platform: VR
Scripting Language: C#
It is an escape room game with a ghostly theme where using light as the weapon against it. Hence, the player is arm with a light bomb and lightsaber. The game also requires the player to find "keys" in the form of photographs to advance the game as it tells some narrative.
The Amusement Haunted House is a VR game project for my programming module. The game is made with thestonefox's VRTK. It was developed in around one and a half months. Other than VRTK, programming of custom interactions collision and game design is done by me.
I would also like to credit and thank those that provide me with the art and sound assets.
Below are the level designs,
The player would be tasked to find a hidden photograph, which is hinted by a figure sitting on the sofa. Enemies will spawn when the photograph is picked up, which defeating them will clear the level.
The third level shows the window panes experiencing a huge wind. Once the player interacted with all of them, the wind effect will stop and instead of the wind blowing from the window, it is in the opposite direction. The wind will blow all the papers in the house towards the windows and reveal the photo, waiting for the player to pick it up. As usual, enemies will spawn then.
This the first level which is in the living room. It starts with a moderately lit environment with some old pieces of furniture. The player is tasked to investigate the room.
The item of focus is the calendar. When it is interacted, the house will change and it will start echoing the sounds of the past such as the clock and television. The exterior lighting would also be dimmed.
The second level is a bedroom, which will start the raining audio when the player pushes open the door. The level tests on the player observation where water droplets will drip from the ceiling. Focusing on it will lead the player towards the second photo. Enemies will spawn when the player finds the photo.
Scope of Work:
-
Designing the levels, the mechanics of the game and the UI.
-
Setting up the animation controllers, using script to control animation.
-
Programming the custom interaction with the book: flip pages, custom set-ups.
-
Programming the custom interaction of the rapier: use when charged effect, damage on collision with the enemy.
-
Programming of the light bomb, stunning enemies when explode and light up an area.
-
Programming of various game design events.
-
Programming of enemy object pooling, spawning, and simple AI behavior (chase, idle, attack).
-
Programming of player damage and health.
Mechanics
LightSaber:
It is the main attack weapon of the player. It will register players' swinging of it. If the player swings hard enough on the enemies, the damage will be dealt. Each attack also charges the weapon shown by the glow, once used, it increases players speed, while slowing the enemies.
Light Bomb:
Secondary attack weapon which will stun enemy on collision. It can help player light up the environment when thrown to see more of the darkened environment.
Health indication:
Player's health is shown by the spatial darkness around the player's eye, thus it gets darker when the player is more damaged. Health will recover.
In-game screens, using book as pause and title
Programming
Pseudo Code for enemy spawn
//Spawn Coroutine
//checks whether it reached the last amount of enemies to spawn
//if it reached, exit the coroutine
//if not, get an inactive enemy game object, based on the type specified in the inspector, from the object pool using the game manager's function
//set it to true and set other variables such as speed and health using the init function of enemy
//while the current enemy has not died, yield return null
//if it has died, go back to check if the amount of enemy has been reached
Pseudo Code for enemy AI
//OnStateChange function
//calls when state changes and starts the respective coroutine, based on the changed state, using a switch case.
//Idle Coroutine
//while state is Idle
//checks for player in range,
//if in range, change state to chase
//yield return
//Chase Coroutine
//while state is Chase
//moves towards the player using navmesh
//if within attack range (ranged enemy has greater range, it is even greater if it has high ground), change state to attack
//yield return
//Attack Coroutine
//while state is Attack
//plays attack animation, and prevent addtional attack calls using boolean
//yield return
//End attack function
//called from animation event, that ends the attack and change state to chase