Refactors Galore

Refactors Galore

Its been a few months since my last update on the project. So here’s an update on the progress so far.

The Refactoring

Moves

Before this refactor I had the 1 move implemented in a way. That being the persona attack skill use ability. When attempting to implement the guard move for a party member I found that the old implementation was far too limiting. So I refactored it. The new setup uses an interface for the logic shared between each move and a class implementation of every move the user can have. I managed to refactor the move I had before in to this new setup and implement a guard move without any issues which was good. Since then I’ve started implementing other moves such as the support skills.

using CarterGames.Common.Events;

namespace Gameplay.Actions
{
    /// <summary>
    /// Implement to make a new move in the game for a party member or enemy to use.
    /// </summary>
    public interface IGameMove
    {
        /* ————————————————————————————————————————————————————————————————————————————
        |   Properties
        ———————————————————————————————————————————————————————————————————————————— */
        
        /// <summary>
        /// The type of action the move is.
        /// </summary>
        GameMoveType ActionType { get; }
        
        
        /// <summary>
        /// Raises when the move is completed.
        /// </summary>
        Evt MoveCompleted { get; set; }
        
        
        /// <summary>
        /// Any ctx for the move to use.
        /// </summary>
        object ActionCtxData { get; set; }
        
        /* ————————————————————————————————————————————————————————————————————————————
        |   Methods
        ———————————————————————————————————————————————————————————————————————————— */
        
        /// <summary>
        /// Performs the move when called.
        /// </summary>
        void PerformMove();
        
        
        /// <summary>
        /// Resets the move when called.
        /// </summary>
        void ResetMove();
    }
}

Slot Navigation

While its still not fully complete, I’ve also refactored the slot navigation system to be more flexible that it was. Beforehand it was a bit of a mess with the whole wildcard solution, honestly it was a bit over-engineered. With this refactor the system is much better, but while writing this post I noticed some bugs with the wild option, so there is still some work to do there.I was also able to use this system in the persona skill select display as well. Before I as using a different setup for that which felt a bit dumb.

Minor Bits

Some extra refactors, not full systems but some improvement include:

  • Target Manager > Sorted the resetting when selecting skills, as skills like support skills can target the party instead of enemies.
  • Turn Manager > Updated the turn manager to track complete turns and the ability to loop around to the start again.

Party Buffs

In Persona you can buff or debuff combatants in Critical chance, Attack/Defense/Agiligy & reflection walls to repel single attacks. I wrote a system to support this on combatants in the last month. The system took a bit of time to implement properly but I was able to get it working eventually. I also sorted the UI for the setup which appears over the combatant when they have any buff or debuff applied. These buffs are also set to only last a number of turns and will expire on the turn when there are no uses left.

And yea, there are some UI bugs and missing art on the character stats now…. Lots of little bits to fix 🙂

Project Cleanup

Behind the scenes I’ve also been doing a lot of cleaning up. There were a lot of prefabs and old art in the project that wasn’t being used anymore. I managed to clear up all the old prefabs and improve the structure so there is a prefab for the model as is for menu’s etc. While the other is for the actual persona model for the game scene when summoning the persona.

I also renamed all the assets to match a naming convention I use a work which is mostly for the art side but with some extra conventions for prefabs and scenes. The convention below if you’re interested:

That’s about all the big news I have for now. I’ll still be working away at this project when I get the time. But I am taking at-least 1 day off a week to just chill and do nothing game dev related. With an extra day off for the rest of the year more or less I’ll be taking that fully. I’ve been slowly getting through Person 4 Golden on those days so far, been good fun. Held off on Persona 3 Portable once Persona 3 Reload was annouced officially as that’ll be much more engaging to play when it comes out next year. Its looking awesome so far, really looking forward to playing it on release day, may even take a day off to play it xD