Ghosts in the Graveyard
Project Type: University
Project Duration: ~5 months
Group Size: 5 people
Software Used: Unreal 4.26
Languages Used: C++, Blueprints
Primary Role(s) : Lead / AI Programmer
About:
Ghosts in the the Graveyard was developed during my junior year at university. It is a first-person horror game. The player finds themselves in purgatory where they will come across other ghosts who are stuck. The player must help other ghosts and find away out of the maze to leave purgatory.
Feel free to download and try our game: https://m0rt0r16.itch.io/ghost-in-the-graveyard
If you would like to take peek at our project: https://github.com/DavidJones011/GhostInTheGraveyard2
Contributions:
-
Patrol Waypoints System
For our game, we wanted to create an AI enemy that was threatening to the player. Our solution was to have the enemy AI cause tension for the player. For a first-person horror hide-and-seek title, the enemy must be close to the player most of the time. Inspired by games like Alien Isolation we had a system that would track where the player is and the AI enemy would be inclined to hang around nearby.
I extended the Unreal editor by adding my own simple waypoint editing tool. Creating the tool was very useful for the production of our game because level designers were able to just add patrol paths with ease. The AI also was given multiple ways of switching patrol paths for various scenarios. In some cases, we would want the AI to play catch-up and walk from one patrol path to another. In other cases, we want the enemy to teleport.
Below are some videos of the waypoint tool being used.
-
Enemy Behavior
The enemy AI was implemented using Unreal's default behavior tree. The enemy is broken down into three main behaviors; pursuing, investigating, and patrolling. The majority of tasks are implemented in c++. Some of these tasks are for updating the enemy's current followed patrol path, changing speed, breaking a wall, etc.
We also made use of the built-in perception system that Unreal provides. We use it for the enemy to sense the player through sight and audio. There are hiding spots littered throughout the map the player may hide in and there are many traps that can cause noise, luring the enemy. Some of these traps consist of bear traps and lamps that pop when the player is within proximity.
Below showcases the use of the patrol path system in conjunction with the breaking barricades functionality. The AI may be teleported to specific locations placed by designers to force the enemy AI to break the wooden barricades.
-
Dialogue System & Inventory System
In Ghosts In the Graveyard, the player encounters ghosts who are stuck in some form of purgatory. The player is given the chance to talk to and get items from these ghosts. The ghosts provide the player with lore and an understanding of the world they find themselves in. The items are used to solve simple key and door puzzles.
Each player owns a Dialogue Component that runs a simple state machine, keeping track of what the character should say at a given moment. It also needs to remember what to say when the player leaves and comes back.
The dialogue state machine consists of three different nodes: a sequence node, a branching node, and an item node.
The sequence node is very simple. It just runs a series of dialogue text/audio from the beginning to the end. Once it runs out of dialogue to run, it will automatically go to the next node.
The branching node requires player input. We mainly used this for Yes and No questions. However, this could be used for an arbitrary number of inputs. The next node that will be run is based on said player input.
The item node simply gives the player a certain item from the item database. In the game, when the player exhausts the dialogue for many of the ghosts, they receive an item to progress the game.
Below is the database used to grab items. Our team ended up using the UDataTable to store all the items.