Forest of Tails: Arena is a real-time action arena game that pits you against bugs, animals, and even other mice. Fight your way through waves, gain new skills, and loot powerful equipment to fight your way through progressively more difficult levels. Death doesn't mean the end for you; pick yourself back up and continue from your last checkpoint with all your skills and equipped gear in tact.
This is a solo project i've developed from the ground up. In this project I created all aspects of the game from AI, combat, animation to game balancing and data management. The goal was to create a project that would allow me to experiment and try new things while working towards a product I could release. Many features of the project didn't make it into the final product but allowed me to try to create fun and unique features.
I created a full combat system from the ground up for the game. The user has strength, dexterity, health, and armour statistics. The user has 3 weapon options: one-handed, two-handed and bow weapons they can switch between. To accomplish this, I created a basic state-machine for the player which also lends itself to other states such as jumping and carrying items.
Weapon colliders are driven by animation events which enable and disable as needed through the attack animation of the player. Damage is applied to the enemy by referencing weapon data which is a class on the weapon object.
The player can be poisoned, pinned, slowed, and other states as needed based on the abilities of the enemy. The controller will check for negative statuses and amend the character controller as needed.
On the other side, enemies can also be affected by these states. Weapon perks are applied onto the enemy which affect how they function. These same weapon perks can modify the player controller and give the player damage boosts, healing effects, and other abilities.
AI was created using a standard state-machine structure. Rather than handling the states through monobehaviour scripts, I leveraged the mecanim animation system to handle the states through their state machine behaviours. The state machine behaviour references a generic enemy script that has utilities for checking for visible enemies, whether it can move, if it's stunned, or otherwise. This allows the states to determine when to move to another state (ie. Idle to Chasing). For unique situations, such as unique enemy abilities, I just inherit this class and create the unique functionality in the inherited class. This can be seen with the spider enemy using their web and leap abilities.
Enemy attacks are handled through animation events as well. When an enemy attacks, the animation sends an attack signal which is picked up by an attack manager class. This class knows which colliders to enable for that attack and any associated effects and damage to apply. This allows the reuse of animations and colliders for multiple attacks and allows me to create attack combos without any additional work required.
I created an inventory system to try and break away from the standard mold for RPG games. What I created was a physics-based inventory system that requires the user to manage the space in their inventory. When you open your inventory, a spherecast is sent out and checks for any items that can be viewed in your inventory. For every object within range that's eligible, a 2D repesentation of that object will show up in your inventory based on its position relative to your player's location in the 3D world. If you move that object into your bag or equip the item, then the 3D representation is removed. If you remove an item from your bag, then a 3D instance of the object is made and tossed into the world.
I based the game around a perk system. When loot is dropped by an enemy, it randomly selects an item from a loot table and generates a rarity level. Depending on the player level and the rarity of the item, it will generate anywhere from 0-5 perks. The weapon damage and armour defence scales with the player level with a bonus being added for rarity.
There are currently 13 perks for weapons and armour, with much more being added towards release. This doesn't include player selected perks from levelling. Sample perks include bleed, poison, spawn vines, heal, slow, and much more. A singleton pattern was used to allow multiple systems to access what perks the player currently has.
I created a character customization for Forest of Tails: Arena. The characters body features two meshes, the body and the ear, and each feature two materials to represent the main colour and a opaque detail layer. The details material uses a white albedo which I leverage to allow the player to customize the colour.
The armour meshes are hosted in the resources folder and loaded as needed. To attach the armour to the player, I created a script to transfer the bone weights from the armour object to the player. Although my script requires that the armour have the same bone hierarchy as the player, the benefit means I have no limit on how many armour pieces I bring into the game. This allows me to connect the armour at runtime rather than have all of the armour hidden and taking up space in memory.
To accomodate the occasional clipping of the characters body through the clothing, I created a masking function that takes in a mask image and hides parts of the characters body that could potentially cause a problem.
Forest of Tails: Arena features saving and loading of various characters. To accomplish this, I leveraged Easy Save to create and retrieve the JSON data for the application. From there, I manage the data using a Save Manager that is initialized when you select a save file on the main menu. Due to how the inventory works, the challenge was initializing and equipping items through my inventory system which is primarily physics based and relies on the colliders.