Refactoring and Starting Combat


I'm preparing to build a tutorial level to replace the current test level.  The two major systems I need to build for this are combat and cinematics. I have started to build the combat system. Clicking the left mouse button or pressing X on a gamepad will enter combat mode. Currently, this shows a (very) placeholder sword and shield. It also blends the idle combat animations into the movement animations. After 6 seconds since the last time you pressed the attack button, the game will exit combat mode.

Most development time since the last update has been spent refactoring the codebase. The player object is getting fairly large so it is difficult to navigate all of the components. To address this, the player object has been broken down into several smaller objects that handle specific concerns like movement, combat, and abilities. The updated player object root only contains the kinematic character controller and interaction controllers as these components depend on the player collider.

I also removed the UnityEvents from the interaction controllers. These have been replaced with a new Events assembly that exposes an events system singleton.

The pattern for component fields has been updated to use Odin foldout groups instead of headers. I added tooltips to each field exposed to the inspector because the codebase is getting large enough that sometimes I forget what a particular component is supposed to do. I also added validation attributes where appropriate.

While implementing these refactors, I found a few places where the wrong timescale was being used. This has been corrected which should make the gameplay more reliable if framerates fluctuate.

One final minor change was replacing the cylinder primitives used for the coin collectibles with unique 3d models.

I have lowered the priority of all features that will not be included in the tutorial level. The tutorial level will take place in an abandoned fort. The fort will be divided into two sections that are joined by a courtyard.

Features still required for completing the first section of the tutorial level:

  • Cinematics (an entrance closes behind the player, the player acquires a new spell)
  • Interactables (switches, chests, etc.)

Features still required for completing the second section of the tutorial level:

  • Combat (sword and shield)
  • Enemies (basic and one boss)
  • Health Pickups

General features that will be implemented as the tutorial level is constructed (more stretch goals than requirements):

  • Improvements to Health UI (health gain feedbacks, buffered health feedbacks, health UI scaling, low health feedbacks, hiding the health UI when it's not relevant)
  • Collectibles UI (shows how many coins the player has collected, similar to health UI)
  • Creation of a Debug Scene (a scene that contains all mechanics in a small space for more quickly testing features)
  • Save System
  • Facial Animations for the Player and Enemies

Files

vaults-and-vampires-webgl.zip Play in browser
Version 2024-02-03-0dbf204 Feb 03, 2024

Leave a comment

Log in with itch.io to leave a comment.