Save game files data copied to other players?

A few of us are new to VR and attempting to make a small co-op game in UE4. After playing around with various database and server options, we’ve decided to have one player host the game and act as a server for the other players (up to 3). Streaming the level maps shouldn’t be an issue, since the game requires that the players all stay in fairly close proximity. Eventually we’ll use Steam to let players connect online, although we’re sticking with LAN for now to dev/test.

After trying and failing to connect external databases to UE4 to host player information (inventory, stats, quest progress, location, etc), we’ve decided to have all the data stored internally via data tables (with all available item info, stats, etc) and save game files by the host. However, we want to make sure that data is copied to the other players save game files, so they can retrieve it even if the host player is offline.

Will this work using save game files alone? The UE4 savegame documentation doesn’t really explain how it works in terms of sharing the data among players.

For example, the host player will create a character and load up the game. The other players then create their own characters, that info is stored locally for them, then shared with the host once they log into the game. The host can then save a copy and send that data to all other players so everyone sees the same thing. For individual inventories, only the player needs to see what items they are holding, so this doesn’t need to be shared between all 4 players. But other information will do, such as player location, current buffs/debuffs, stats for the medic to heal, etc.

We’ve wasted several months trying and failing different methods, so want to make sure we’re on the right path before going down another rabbit hole! Not looking for a step-by-step of how to do this, just confirmation that the above is accurate. Although if anyone has any docs/tutorials then that’s great! : )

Hi Sudo-Ku

My first piece of advice is that if you plan on hosting the game with dedicated servers through Steam, start with that implementation now instead of using a listen to server approach. Trust me, you don’t want to be changing the core architecture three quarters of the way through the project.

To answer your question, yes you can achieve what you are intending with the USaveObject system. However, the server and clients will need their own save objects if you want them to run offline.

The server should create the “master” to save the object which contains all the relevant information. When clients connect, they should ask the server for a copy of this data and then save it locally.

What you will need to put thought into is how often these save objects get written and how often the data gets pulled down by clients.

I would not have the clients collecting and saving the data themselves as their save objects could end up being out of sync with the server.

Good look with your project.

Alex

Thank you for the advice, although I perhaps explained the Steam part wrong. There won’t be dedicated servers (at least not until we are making money to afford them), but just using Steam to allow the other players to find a hosted game via the internet (rather than using the IP address). From what I understand, Steam allows players to do this once a game is ‘greenlit’ (or via Steam Direct, which I think is the updated version). One player will still host the game and the other players will connect to that game. It just seemed like a better way than requiring the host’s IP. Ideally, we would use a dedicated server if we had the money, but we’re unemployed students and have zero income so that’s just not doable right now. I know AWS offers a year free, but once that runs out we’d be back to square one again. If you know of any permanently free dedicated servers, then great! ; D

In regards to the save game limitations, it’s an open world rpg so we hadn’t planned any specific ‘save points’. The map plots are just streamed in/out as the group travels across the world, so there are no fixed ‘levels’ as such. So I guess the triggers to save the game would be quest progress updates, streaming a new map (so new character location), changes to XP, skills, professions, etc. I guess we can save individual info for all four characters on the server, even though other players won’t need to view what another character has in their inventory (for example).

Thanks again for your help!