Just A Simple Farming Game

Project Type:
Farming and Souls-like

Role:
Gameplay Developer

Language:
C++

Engine:
Unreal Engine 5.1

Date:
April 2024

Just a Simple Farming Game is a Souls-like farming game where the plants are trying to kill you. The project was developed using Unreal Engine 5.3 and Microsoft Visual Studio Enterprise 2022 Preview 17.10.0 Preview 1.0. As the Team Lead, I helped my group setup Perforce, verify Software conformity, debug fringe case issues, manage Jira, and maintain weekly productivity. As a gameplay developer I was able to blueprint a multitude of systems, such as: the player attack system, player weapon system, dodge rolling, target lock, day and night cycle, hit and hurt boxes, and more. Most of these systems required animation integration like: notifies for weapon hurt box activation, invulnerability frames for dodge rolls, and contextual blend spaces based on player activation of the target lock system.

The attack system was designed with modularity in mind. Based on the hold time of the attack button (Left Mouse Click) and the player’s movement status (Jumping, Sprinting, etc.) an Attack Request is sent by the player’s weapon to the animation class using bound events. If the attack request is granted, a customizable amount of resources (Stamina, Ammo) is consumed. This was accomplished by overriding the Use Item method of the Item base class that each weapon is derived from.

Each weapon sets animation references for their attacks when equipped, allowing for customizable attack patterns. Using this system as a base, I was able to implement an attack system in which the player could charge, jump, sprint, and light attack.

Attack and Weapon Systems

This system was also used in the animation of the crop planting system to provide an immersive, multi-step process to the placement of crops.

Dodge rolling was accomplished by checking the velocity of the character to determine the dodge’s direction. If the length of velocity was ~ 0.0f then the character would perform a backwards roll. From there, the IsDodging bool is set to true and the Tick event of the character is enabled. On Tick the character is moved in the dodge’s direction at a modified speed until the end of the animation. At the animation’s end, the Tick is disabled and the IsDodging bool is set to false. During a portion of the dodge animation notifies were set to enable character invulnerability as seen in most Souls-like games.

Dodge Rolling

By tracing for actors of the EnemyBase class an array of actor’s is formed when the Lock On key is pressed. If there is currently no known enemies then the first traced enemy is added to the array without comparison. If there is an existing array of enemies, each newly traced enemy is compared to the current list and the already known enemies are filtered out. The newly known enemies’ distance from the player is compared to the current list of enemies and sorted into the KnownEnemies array by shortest distance to player. By ensuring proper incrementation of the KnownEnemies array, the player is able to cycle their current target without repeating the same target over and over.

To ensure a proper camera angle per enemy type, a scene component was developed and the player’s camera is angled towards the component on Tick event. This was added in the case of extremely large enemies.

Lock On

In Just A Simple Farming Game, hitboxes are sub actors that can be placed in another actor’s scene and attached to skeletal mesh bones and handle the transfer of damage information from weapons to hurt boxes and therefore other actors. This implementation was chosen to allow designers to customize damage multipliers at the hitbox level. For example, a sword that deals more damage at the tip of the blade only has to add the extra hit box at the tip and then set the multiplier to a higher value than the hitbox that represents the rest of the blade.

Hitboxes

The counter part to Hitboxes, Hurt Boxes handle the receiving end of damage. By comparing the raw damage value and damage type of the incoming damage packet to the armor type of the hurt box, the resulting reduction in health is applied to the hurt box owner’s health component. Keeping the armor type at the hurt box level allows for the mixing and matching of armor types by the player on item equip. So, if a player is hit in the legs with a leather armor equipped, they would take more damage than a player with metal leggings.

Hurt Boxes

Next
Next

Eejan Rizzler and The Order of Drip