I am working on creating an RPG game that will work in similar fashion to games like the old-school Final Fantasy and Golden Sun games where I will have a main character that the player controls, but they will have party members along with him/her when going into battle.
I’ve been trying to figure out how to create a party system to where the game recognizes each character as a specific class while also being able to add them to the party or dismiss them and replace them with others like FF9 or Golden Sun to be specific as the type of class system I want to use in my game.
I came across a forum post, an old one but still was helpful, that talked about using Inheritance with the classes to make a base class then have each class or type of fighter (warrior, mage, etc.) be the sub class that inherits off of the main base class script. I’ve looked it up and still researching on how to use inheritance, but I wanted to see if my base understanding of the inheritance system is correct.
So, the way I see it is that the base class would work almost like the Wretch from Elden Ring. Even stats across the board, nothing special. Then each of the other classes (Samurai, Bandit, Warrior, etc.), are all the sub classes that would inherit the base class and then modify their stats based on each of their unique scripts and modify the stats accordingly, lowering the unused stats and raising those that the class is proficient with. I obviously realize that this probably isn’t how Elden Ring works considering each class is a different level and all, it was just the easiest thing I could thing of as an example mainly looking at the stats and variations.
Is this a correct understanding of how inheritance works or have I missed the mark somewhere in how Inheritance works?