I am trying to make a JRPG style game using Unity. See this image below to get a sense of the "feel" of the type of game I am making:
http://www.juicygamereviews.com/uploads/3/0/5/0/30501048/9185639_orig.jpg
Currently I'm struggling to find a good way to organize the data in my game.
Referring to the image above, see how each party member has stats, as shown in the UI? I'm sure the monster also has the same kinds of stats, just hidden away. Hence, I want to make a struct called Stats, that both PartyMembers and Monsters contain a reference to.
To summarize what I'm saying so far:
Right now I'm pretty sure I want two classes - one called PartyMember and one called Monster, both of them deriving from a common class - I'll call it TurnTaker - that takes turns during battle. In the TurnTaker class I want a reference to a struct called Stats, which contains HP, MP, Attack, Defense, etc.
The problem is, for player data I want the Stat class to be [Serializable] because I want to save player progress in a binary format, yet for Monsters I wish to make the Stat class inherit from Scriptable Object (SO) for easy development and editing.
Is it possible to make Stats both serializable and derive from SO in Unity? (Note: a struct cannot derive from SO; only a class can. Should I change my stats from a struct to a class? Seems a bit of a waste, just for the inheritance functionality.)
Further, I'm thinking party members have data specific to themselves (equipment, total EXP, character class, etc), as do monsters(drop items, movement type, etc.)
Should I make these two "things," I'll call them PartyMemberSpecificData and MonsterSpecificData
- separate classes altogether
- separate interfaces that attach themselves to PartyMember, Monster, or Stat
- classes that derive from Stats
(I think I want PartyMember to contain a reference to PartyMemberSpecificData and Monster to contain a reference to MonsterSpecificData.)
Any help appreciated!