Loading client save ?¿ best pratice ? Client To Server

Hi !

i’m trying to load save for a multiplayer game. I test my game in local with my self and everything work well. But when i try to play with someone else distant, i get some errors. Server attempt to find local client save and find nothing because the server check on his local folder whereas save is on client computer. How can i send local client save from client to server ?

I’m testing with hamachi.

i tried a lot of things and nothing works. I want to do something like that :

but it didn’t work, of course server don’t receive the save object ! I need some help on this :slight_smile:

I’d like to know the proper method of this also, player saves do need to be loaded from client in most games unless their saved on a server.

I’m agree with you. I would like to play in local, save my character and join some friends on hamachi. Actually, as u said, a tons of games saved client’s save on server side and if the server are not online u can’t play with your character.

Someone tell me to take a look on outsite database. but i’m not sure how it’s work with blueprint only. It seems to be hard to use with blueprint. There is a nice free plugin Va Rest Plugin " that makes REST server communications simple to use with full Json query support "

still as complicated for me even with the plugin.

I am doing it this way:

Create RPC server only event SendSaveData() inside Player Controller, Input parms use custom UStruct SaveData thats holds values from your save data.

Inside RPC SendSaveData() → On server use SaveData to whatever you need. Mine was spawning actor with special properties thats stored inside client save file ( level, character, weapons etc ).(You can use find player start from game mode to determine spawn location) SpawnActorFromClass, then initialize some properties, and then posses this pawn with player controller. I do use DataTables and storing only keys to assets inside save file, this way it easier to reconstruct object using smaller data size.

Create RPC client only event RequestSaveData() in Player Controller.

Inside that function Load Save and extract its values to SaveData UStruct → Call Send Save Data and pass along extracted data as a UStruct.

Inside Game mode:

Override PostLogin → Cast PC and Call RequestSaveData on passed along player controller.

Override CanRestartPlayer to return false, or use some custom bool variable to determind if player can spawn ( i use Parent player can spawn and bSaveDataLoadSuccess variable in my Player Controller, this way it prevent player from auto spawn right after joining,giving you time untill save data arrived from client)

1 Like