SaveGame/Load For Clients Bug

Hello. I have a question I have been struggling with for a few days now and have not found a solution.

I have a save/load system using the savegame object with various slots for each player’s account. This savegame stores the individual’s stats including health, maxhealth, strength level, location, rotation, etc. When loading from a save, it load all the stats correctly except there is a caveat with health. It looks like it loads health from the save because the health HUD widget accurately depicts the health that was stored from the save. If I saved at 50/120 health it loads at 50/120. However, as soon as I take 5 damage let’s say, it then displays 95/100 because 100 is the default amount for health and maxhealth.

Another part of this bug that might better explain the issue. If i load from a save at 50/120 health and try to eat food to heal up, it fails to eat because the debug print string states that the player has 100/100 health (too full to heal anything) even though the HUD widget accessing the same variable correctly says 50/120.

My prediction to the issue is that when loading from the save its essentially creating another instance of health and maxhealth and when accessing it the bugs occur because there are two values for the same variable. These bugs DO NOT happen when playing as server. This only happens for clients.

Any ideas shoot them my way!

So i set up a couple debug print strings. By pressing “O” it prints the health variable. Pressing “O” returns a value that matches my healthbar widget. I have this input action event in my player controller.

However if I press “O” and have that trigger a custom event that runs on server, then from the server event print the health value as a string, it returns 100. So the server is not getting the value set when a character loads. At first I thought, maybe I had my load event set to run on client by mistake, but nope, all loading events and functions are run by server

Why can the health get updated just fine when taking damage, but it cannot get updated when loading it from the save (for clients)?

If anyone runs into a similar bug and is curious as to what may be wrong, after 3 days and ~16 hours of work I have corrected my entire system to work properly. The KEY THING that was wrong is that all my login, saving, and loading logic was in my game instance because any data/logic in the game instance can be carried across levels. .HOWEVER, anything in the game instance is NOT replicated. That is why there were so many bugs, the server and client had a different idea of what was being saved and loaded. So i had to re -create all that logic in the player character blueprint. Now, a player first connects to the server from the main menu, joins the main world, is given a character but is not given control of it until the log in. When they do log in, the save slot is loaded for their account on a server event, the variables in the savegame are all replicated, and it properly loads all their stats and items. No bugs. If you have any questions on this comment or send me a PM.

Cheers,

Dalton