top of page

Coop-Horror RPG

This is a current work in progress. This project is made in Unreal Engine 5, and made to be a RPG that has horror elements. Currently the project has the player's functionality, AI and common NPC's to be used as vendors. Each type of character has an Inventory, and uses DataTables to start with certain Inventory Items. The player can pickup items in the world either by holding the button or pressing it depending on the item. Both the characters and the items have an interaction interface to determine what happens when they are interacted with. 

Player Functionality can be broken up into multiple sections; Basic movement and animation, a combat system, an inventory component, a currency system, and an interaction system:

- Since movement and animation is basic for now there's not much of a reason to go into it. The only thing to mention about animation is when the player tries to attack they can continue through their combo if they feel like, and if they do not keep attacking within a certain time threshold they stop attacking and go back to a neutral state.

- The Combat system has a capsule collider that changes based off whichever weapon the player is using at the time. There is a section in the items DataTable specifically for weapons, that change the collider's size and shape to fit the weapon. when a character uses an attack there is a section in the attack montage that checks if there is any form of collision in that time frame, and if there is against an enemy that enemy takes damage. The player has multiple parts of attacks in their combo, and if they click the attack button again closer to the end of the first animation the player continues to attack into the next animation. If the player does not then they stop attacking.

-The currency system is basic for the time being, the player and any NPC has a starting amount of gold. When the player sells an item they gain gold and the NPC loses gold; when the player buys an item from the shop the player loses gold and the NPC gains gold. 

- The Interaction System has a PerformInteractionCheck in the player (currently in Tick function for testing), that creates a trace line from the players eyes to see if they get a Hit on any actor that inherits from the InteractionInterface. If they do then they go through the BeginInteract if the player hits the key to interact with it. The items that are able to be interacted with are lit up with a yellow outline in order to show the player that they can interact with them. 

AI/ NPC can be broken up into a few systems:

- The NPC's are simply made to be shops where the the player can buy or sell items. The NPCs have a starting inventory for basic items they have in their shop, and from there any items the player sells to the shop are added to their inventory.

-AI similarly have a starting inventory, and when they seek out and die to a player, the player has the chance to loot them for whatever items they may want. The AI also has the same types of attacks as the player, but choose decisions based off a behavior tree that take some perception checks into account. 

Inventory Component is made as follows:


- Any character can have an inventory component, and at least for the time being all of them do. If any characters have a starting inventory, it's added to their inventory component to be used or checked later on. 

- The inventory component can be broken up into a few types of functions; Add functions, Find functions, and Removal functions.

    --Add Functions handle adding an item into a characters inventory. it uses a struct to see how much of an item's quantity is actually            added to the inventory, and uses the Find Functions in order to figure out how much should be added. It also takes into account              what the max stack size of an item can be in order to split it up correctly.

   --Find Functions go through the owners inventory component to see if they have an item of the same type already in the inventory, if          they do they tell the Add Function how much to add, and iterate through until either the inventory is full or until the item is gone.

  --Removal Functions remove an item based off the instance of an item from the owners inventory, or an amount of an item in some             instances. 

bottom of page