henvu50 wrote: ↑Sat Jun 05, 2021 9:05 pm
Just curious, why would someone use this character stat code (1st post) :
viewtopic.php?f=51&t=47911#p476350 , instead of yours? Your way simply wraps Character, while in the post I linked, it seems to extend Character?
You do want to be careful keeping a distinction between defined game *configuration* and conditional game *state*. It can be a subtle concept to grasp, but the most important point is: what do you want to happen if you release an updated version of the game while somebody has a game in progress? Which pieces of information should come from the game file (like dialog, NPC names, quest prerequisites) and which should come from the in-progress save file (like current hit points, relationship status, quest progress)?
Character objects are usually *configuration*. If you change the character's name in development and publish a new version, you expect that character to just be called "Bob" now regardless if some player loads up an in-progress save file. If you decide Bob needs to be stronger, probably that should overwrite, too, or if you want to change their dialog text style or something. But you would *not* want a new version of the game to overwrite the player's progress in making Bob love them -- that's game state.
I would suggest keeping configuration and game state character data in separate objects, each having weak references to the other if you need them. (By weak references, I mean a permanent unique id like "bob", and a way to look up get_Character("bob") and get_NPCState("bob"), when you need them. If you record the Character bob as a property of bobstats, then the Character will get written to the save file, and weird things will happen when you update.)