How to save the Match Data when using listen server

Hi guys, I have a question I’d like to get some advice on.

In case of a game (with 2 players) that uses listen server (so not dedicated just to clarify), what is the best approach to save the match data like GoldAmount, Score etc.

The goal is to create a ‘system’ that saves both players match data every few seconds, so even if the host leaves the game the client would have the data to calculate his XP etc.

My first thought would be saving these match data variables in the Game Instance for both players, but that would raise concerns of storing such important data on client side.

The game uses the Steam OSS and it is possible to store some variables on Steam (I am not sure about the process tho) and query those variable any time but as far as I know the types you can use is limited and this just doesn’t seem to be the right approach for me.

So the question is, how should the game ensure that even in the case of the host leaving the game the client would still have the match data and able to calculate his XP in a ‘network secure’ way.

Is it possible without any form of ‘dedicated server’ that anyone can access and save the match data there?

I am definitely not a programmer, so the answer might be obvious :stuck_out_tongue:


I don’t think the GameInstance is replicated to the remote machines so I’m not sure to understand the problem with using it?

Hi, thanks for your answer.

No, in my understanding it is not replicated but lives both on the client and the server. Being not so familiar with networking sometimes I am confused, so my problem might not make any sense at all. Basically my problem that if the host leaves the game (destroys the session) the client gets dropped, so he is no longer connected to the host. But I want to get some variables for the client that the server has/had (gold, score etc) in order to calculate his XP. Without having to save the value of these variables locally to the client’s machine, how can I ensure that in the moment of disconnection the client will get them and won’t be able to manipulate it?

Can someone clear this up plesase?

You can do an emergency save using the event “End Play” I believe.

When a PlayerController ends play, save some data.

When the GameInstance disconnects, save some data.

But it seems to me that the client will indeed be able to manipulate data so that does not solve your problem.

EDIT: Ideally if you care about cheating you will most likely have a dedicated server, that server should handle the disconnect problem (when a Controller leaves play, he sends data to the GameInstance that will not be shut down since it’s a dedicated server).
If you’re working with one of the player being the host, I think you shouldn’t care about people being manipulating datas since one of the player will be able to do so anyway.

EDIT2: But as you can see I’m nowhere near to understand every details & roots of this problem, I’m just sharing my brain matter with you :wink: