Listen Server, saving?

Hello,

I had a few quick and pretty direct questions. I want to use a listen server for a game and I wanted to know if each individual person should save there progress on there own system or if there is another way to save it.

My second question is, If I use the first method (Saving to individual clients systems) should I still do a “Has Authority” check for setting important variables i.e. Stats, levels etc? (Since the host would be another players computer)

Should individuals save their own progress on clients or is there another way to save it?
Let’s assume you have a save event that will dump the game state to disk already written.
There’s no reason you can’t trigger that save event from the host.
The reason why this isn’t generally featured in games is more because usually you want to give the player the option to choose a save file or to select some save options.
If a game is silently saved by the host and all the clients also save up, this could be very annoying.
A save will probably cause a framerate drop, right?
Unless the game saves asynchronously, which would still require copying the gamestate to somewhere in RAM temporarily, you probably want the game to pause during saving.
If the host keeps saving, causing everybody to pause their game, they might get annoyed.

Regardless of whether the server or the client triggers a save, you would not necessarily need to check the has authority flag for clients.
You may still want to check the authority flag just in case you make changes in the future.

To illustrate the just in case…
Take Sins of a Solar Empire or Age of Empires as example: anybody who saves temporarily becomes
“server-like” because they need to know everybody else’s resources and the positions of all the AI units.
(I don’t know the source behind these programs, but let’s assume for a moment that not everybody has all the game information at all times [which they probably don’t based on what little experience I have with RTS games, there is too much data to share it all all the time])
If the clients don’t know all this information, then they can’t save the game properly without the server’s help.
If they do know all this information, save it all without regard to authority and you should be good to go! :slight_smile:
If you end up changing this in the future such that the clients don’t know all the information, you’ll be glad you have the has authority flag so you know where to look to request a packet of the most up to date information from the server.

Ok I think I get it, but to kinda clarify, has authority isn’t really necessary unless I’m getting information from other players that its directly accessible? And I think ideally that I’ll want each individual player to be able to save there own character to there system, but how would I handle saving the world state? The best way I can think of it is the host saves the world (of course you would need the host to host the world later) and then add the functionality for the player to start host a new game or join a game. (Kinda like how minecraft does it)

If the client has access to all the game state, then checking for authority shouldn’t be necessary. For the other bit, it really depends on what sort of game you’re doing. If your world can undergo a lot of change, like in Minecraft, you might have to save the world. But if your world is largely static, usually the world isn’t saved. Say your “world” is a landscape with a bunch of object on it. If you want to, you can save the landscape, but a landscape is a static mesh that shouldn’t change during gameplay so it wouldn’t make a difference to save the current landscape rather than reload the existing landscape. Chances are, you won’t need to save the world. If there are object around the world that the player can pick up, you might want to save whether those objects are still there.

Alright, I think I have a better idea of how to handle saving in listen-server based netowork games. Thank you so much!