skeletonzombie Posted September 15, 2019 Report Share Posted September 15, 2019 I've just read through the discussion for ticket https://trac.wildfiregames.com/ticket/1088 Isn't loading a multiplayer saved game equivalent to setting up a new multiplayer game? All players choose there slots, and when complete, the game will start, but instead of generating a new game, the one from the save is used. The parameters and world data is transmitted from the host (has the save file) to the other players, and then the game will start as usual. Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 15, 2019 Report Share Posted September 15, 2019 Well IIRC it doesn't work for AIs. I'm not even sure you can replay a game with an AI as the commands it sends are not saved anywhere. Then there is the issue of rejoining. Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 But singleplayer save games work with an AI, right? And it doesnt do a full replay on loading, or does it? The thing I'm wondering most about is, I would expect that the game could be frozen at a turn-wrap, even for multiplayer games. Then that state is encoded and saved. For the AI it should be sufficient to save the states of the RNGs + where all units are etc Quote Link to comment Share on other sites More sharing options...
bb_ Posted September 15, 2019 Report Share Posted September 15, 2019 replays work with AI, since the AI is completely deterministic, however their simstate isn't saved when serializing, so rejoining (and saving) isn't supported. For singleplayer games AI's work after loading a savegame, but might act a little different compared to how they would act without the save/load (think of the AI being brainwashed). Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 1 minute ago, bb_ said: For singleplayer games AI's work after loading a savegame, but might act a little different compared to how they would act without the save/load (think of the AI being brainwashed). I don't understand why it would act differently. What details are not saved for the AI making it non-deterministic in this respect? Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 15, 2019 Report Share Posted September 15, 2019 The attack plans and general plans. So it only has the current state but not the new movesplanned for the next turns. 1 Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 (edited) Ok. Is this strategy-data very complicated/large? Or is it just that nobody has written the serialization code so far? -- Does every unit has its own AI? And not just the AI-Player has its AI? Edited September 15, 2019 by skeletonzombie Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 15, 2019 Report Share Posted September 15, 2019 I'd say the latter. Yes but the UnitAI is different and properly serialized. Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 1 hour ago, bb_ said: however their simstate isn't saved when serializing, so rejoining (and saving) isn't supported. For singleplayer games AI's work after loading a savegame, but might act a little different compared to how they would act without the save/load (think of the AI being brainwashed). But then a loaded multiplayer savegame could also just start with 'brainwashed' (==new) AIs in the respective player slots, like for a single player save game. And rejoining human players would be solved by 2 hours ago, skeletonzombie said: Isn't loading a multiplayer saved game equivalent to setting up a new multiplayer game? All players choose there slots, and when complete, the game will start, but instead of generating a new game, the one from the save is used. (so the game does not start/continue before all human players are available), where the large part to do is 2 hours ago, skeletonzombie said: The parameters and world data is transmitted from the host (has the save file) to the other players, and then the game will start as usual. Or do I miss sth? Quote Link to comment Share on other sites More sharing options...
GunChleoc Posted September 15, 2019 Report Share Posted September 15, 2019 8 minutes ago, skeletonzombie said: But then a loaded multiplayer savegame could also just start with 'brainwashed' (==new) AIs in the respective player slots, like for a single player save game. If it doesn't get the exact same brain washing on all computers, it will start doing different things or each client, so the game start will not be the same for all players any more. Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 4 minutes ago, GunChleoc said: If it doesn't get the exact same brain washing on all computers, it will start doing different things or each client, so the game start will not be the same for all players any more. ... and transmitting the AI parameters/state requires to serialize it. Ok, now I understand that part, too. Thanks Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 Oh wait ... then currently playing multiplayer with AI is not possible? Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 15, 2019 Report Share Posted September 15, 2019 It only works the first time. Rejoining is not supported. (it's also laggy,) Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 15, 2019 Author Report Share Posted September 15, 2019 Then the initial AI state is somehow synced from the host to the other human players? Or is it just the same because the initial seed for the AI is the same always? Quote Link to comment Share on other sites More sharing options...
bb_ Posted September 15, 2019 Report Share Posted September 15, 2019 One can play multiplayer games with AI, since indeed the initial state is the same. Rejoining is not possible since the rejoining person will have a brainwashed AI, while all other players will have the normal AI. Maybe, loading a savegame on two machines gives the same state (as the AI gets brainwashed on both ends), but it has never been tried. Feel free to hack it somehow (there is no such gui ingame), but no promises if it will work... Quote Link to comment Share on other sites More sharing options...
skeletonzombie Posted September 16, 2019 Author Report Share Posted September 16, 2019 (edited) Subsuming as I have understood it so far: on every computer, a complete simulation of all aspects of the game is run. all 500ms this is synced checked for being in-sync between the computers. what happens in between the sync is called a 'turn'. while a turn is being simulated, each player can accumulate new commands. but these commands do not affect the current turn, they are synced to everybody on the next turn-wrap, and only after that they affect the simulation. currently the AI of AI-players is a set of deterministic scripts which is just run on every computer, so syncing is not needed for their commands. currently the state of the AI-players' AI itself is not saved in savegames. even the AI's initial state is not synced between the computers, it is just the same everywhere because it is seeded in the same way everytime. Question: It is possible to rejoin multiplayer games (without AI). Does the game halt while somebody is disconnected? Because if the game would continue without the player, the game-state would have to be completely synced-in from another player on rejoin. (since all players have the same simulation, it doensnt matter who would send it) actions - replay, all non-deterministic information, like human players' commands, has been saved, so that the whole game can literally be resimulated. since all commands for all players are already available, the whole thing can be acted out on a single computer, making turn-wraps trivial. - savegame, loading this should behave as if it was the first turn of a new game, but with initial state already prepaired, i.e. loaded from the savegame instead of being generated. [this currently misses the state of the AI-players' AI] - syncing on turn-wrap - check whether simulation is in sync, this is needed - against cheating or bugs - because fpu operations can differ depending on hardware architechture - everybody sends his commands for the next turn to everybody else, so the simulation stays exactly the same on all computers. - start game - communicate initial parameters/state to all players, so the simulation is in sync for the first turn [How is this currently handled? e.g. at least the winning conditions must be somehow synced?] - resolve out-of-sync, [not implemented] e.g. by syncing the state of the host to everybody else or similar - rejoin (see question above) Edited September 16, 2019 by skeletonzombie Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 16, 2019 Report Share Posted September 16, 2019 5 hours ago, skeletonzombie said: It is possible to rejoin multiplayer games (without AI). Does the game halt while somebody is disconnected? Because if the game would continue without the player, the game-state would have to be completely synced-in from another player on rejoin. (since all players have the same simulation, it doensnt matter who would send it) Yes it's possible. The rejoining player just downloads the commands.txt replay file from the host. Quote Link to comment Share on other sites More sharing options...
smiley Posted September 16, 2019 Report Share Posted September 16, 2019 (edited) The server sends a compressed state of the entire simulation. And all the commands from the point the rejoin was requested. While the rejoined client is executing those commands, the game would be locked in the current step. What you are asking of is actually very simple. Conceptually at least. (Assuming the AI serializes all it needs). All the prerequisite code is already present. None of the state changing math is floating point btw. It’s all fixed point. So, just integer operations. Since you seem to be somewhat interested in engine design, I suggest reading up on the lockstep architecture. It’s not entirely the best engine design today, but it came from a time when bandwidth was rather precious. Edited September 16, 2019 by smiley 1 Quote Link to comment Share on other sites More sharing options...
Ceres Posted May 2, 2021 Report Share Posted May 2, 2021 On 15/09/2019 at 8:18 PM, bb_ said: One can play multiplayer games with AI, since indeed the initial state is the same. Rejoining is not possible since the rejoining person will have a brainwashed AI, while all other players will have the normal AI. Maybe, loading a savegame on two machines gives the same state (as the AI gets brainwashed on both ends), but it has never been tried. Feel free to hack it somehow (there is no such gui ingame), but no promises if it will work... Hello! This thread is already older, and I rather stumbled over it. I am especially curious about the second paragraph (loading a multiplayer saved game on two machines). How can this be done without the possibility in the GUI? Thank you! Quote Link to comment Share on other sites More sharing options...
Ceres Posted May 17, 2021 Report Share Posted May 17, 2021 @GeorgeGarrett Hello! Useful in which way? How have you resolved the problem? Quote Link to comment Share on other sites More sharing options...
Ceres Posted May 24, 2021 Report Share Posted May 24, 2021 *bumbp* On 17/05/2021 at 3:40 PM, Ceres said: @GeorgeGarrett Hello! Useful in which way? How have you resolved the problem? Hello! Useful in which way? How have you resolved the problem? I would really very appreciate your feedback on this. Thank you! :) Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 24, 2021 Report Share Posted May 24, 2021 It's most probably a spambot. 1 Quote Link to comment Share on other sites More sharing options...
Ceres Posted May 24, 2021 Report Share Posted May 24, 2021 Oh, snap, and I tripped over it. Quote Link to comment Share on other sites More sharing options...
streamer_bett Posted August 3, 2021 Report Share Posted August 3, 2021 I found that thread after reading that write-up - https://tamashii-yusaburuyo.work/21_0326 Really, the multiplayer saved game equivalent to setting up a new multiplayer game players are choosing slots, loots etc, and when complete, the game will start Then will be started saved session with a last chacracteristics and parameters. So It's ok Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.