OpenRA / OpenRA

Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.
https://www.openra.net
GNU General Public License v3.0
14.36k stars 2.63k forks source link

Multiplayer save and load #19241

Open raptor opened 3 years ago

raptor commented 3 years ago

Motivation

Given the programming difficulties with rejoining a multiplayer game after a desync, this feature would be a possible solution. It would also help with long games where a player may want a break.

Proposed solution

Multiplayer loading/saving could be implemented as done in older games like Empire Earth and would work as follows:

Saving Ideas:

Loading

  1. A player (admin?) loads a multiplayer save file from the multiplayer menu
  2. The lobby appears like it does on 'Create' new multiplayer game
  3. Original players can join. if their identity matches one found in the save game file, they are placed in that spot with the same starting parameters. Parameters cannot be changed
    • Bonus: allow an AI to take the spot of a missing player if desired
  4. When all have rejoined, 'Start Game' will load and sync all players to the time index in the game file
  5. Play!

Side effects

Managing saved games on dedicated server may be a bit tricky; a first pass might only allow it for local multiplayer hosting.

CyberHead commented 3 years ago

Great!

muramasatheninja commented 3 years ago

This would be a really useful feature. Following.

IceReaper commented 3 years ago

If (and i understand that this is a HUGE task) the way the replays work is refactored this could work out pretty nicely. Basicaly a solution to quickly diff the state of the whole world with all its actors, traits, activities per frame could be useful here. First replays would not be a real replaying of the game, but the game basicaly applies snapshots on top of eachother. Secondly replays could also be scrolled backwards just for the case you oversee something. It just needs a snapshot to be like "change X from A to B" so a reverse knows to change "B to A". Additionaly this applies to spectators too then. They could examine "what happened here" by going back x frames. Now coming to multiplayer: When a client has dropped, and he rejoines, he can simply send a packet "hey i was up-to-date till frame X" and the server pauses the game, sends him all the frames he missed till "now" and continues the game. Additionally it would allow for a feature to ask players "client X re-joined. continue here or reset to the frame where he dropped?".

ben132 commented 4 months ago

I might as well bump this up with another advantage of having this. If someone was to create a Multiplayer RPG-like map, like the RPG maps for games like Warcraft 3, then Saving would be userful not only for the long session, but also have a way to go back if someone messes something up. This could also relate to the idea I had about loading multiple maps #20565, Saving the map state to be loaded later on.