Issues with updating party member stats in my RPG

Hello! I’m creating a Turn based JRPG, and im nearly finished with my battle system, however I am having issues with character stats “saving” and updating between Battle game mode/ Battle mode and the Field system/Field game mode. I’ve been at this for this past week and I’ve been stumped.

My party members are grandchildren of the unit base actor and in the actor lies the HP, and MP while the base also carries the combat component which has the Unit Level, and XP and other stats (atk,def,etc.)

I have been trying to utilize the my instance (Called JRPG instance) and im still having issues. what is the best way to go about this or would i need to re-work the stats and place them somewhere else?

Hello, your save system must save the stats of every desired child actor independently (party members) before loading a new level or whenever a battle ends. Some games don’t allow saves during a battle, so if you’re defeated and respawned, you restart with your initial stats. Some games only save stats at checkpoints. If battles have phases, I’ve seen games saving the partial progress to prevent players from starting all over.

2 Likes

so trying to code in a system where the stats save to the instance is moot? I don’t have a save system at all at the moment and its my first time dealing with this exactly (fresh out of college lol). I figured that if i tried to save the stats, before the level is over, to the instance and then somehow load that variable from the instance to the field game mode or something like that It would work but that’s a bust (or Im just not fully understanding something)

These variables are called “non-persistent” between levels. To make them persistent, you want to use save games. Each actor needs to be included in the save game files, saved to disk. If you want to save the state of pickups, such as chests, special loot, etc, there is a special workflow for that.

For RPG stats, you’ll find many tutorials in the community session or YT, for example:
Universal RPG stats and Saving/Loading | Epic Developer Community

For saving the state of interactable items, there an older video that is still valuable:
Unreal Concepts - Persistent or Saveable Objects ( UE4 )

Blueprint Runtime Saving and Loading: Introduction - Blueprint Runtime Saving and Loading | Epic Developer Community

1 Like

oh yea i got the inventory and currency down they’re good to go! but the whole non-persistent thing is news to me! I assumed the save game stuff meant for literally saving the game like going to a save point but I guess its for both saving some information on top of that? (still learning some things my bad, just trying to make sense). interesting though how the actors behave differently compared to the inventory/currency (structs and integer).

Correct, everything you want to pass in to different play sessions and levels must be included in a save game file. Also, you want to be protected from game crashes, therefore saving periodically is an important factor to consider. I know rogue-like games don’t save your inventory and loot, so you’ll loose everything and restart from the beginning by design.

If your game is multiplayer, it’s a different monster, there are more advanced topics to consider.

okay cool! ill go ahead and look more into this! for now i’ll leave this thread open for a bit just in case if i have more questions (reduce redundancy in the forums) but ill close it by the end of the day , thank you sm!

No problem, best of luck.

1 Like