Multiplayer Stability Thread

pza

Prince
Joined
Oct 20, 2017
Messages
365
I think G (edit: and @davenye, @raphaell666) is doing a good effort to make multiplayer playable, so i thought it's due that we gather feedback on this topic. We can discuss used settings, maps, modpacks and configurations.

Please report your findings and provide as much additional relevant information as possible.
 
Last edited:
Note that the next version should have significant reduction of desync (possibly at a cost of some performance), thanks to yet another wonderful fix from davenye (see the associated GitHub pull request for more informations)
 
I think G is doing a good effort to make multiplayer playable, so i thought it's due that we gather feedback on this topic. We can discuss used settings, maps, modpacks and configurations.

Please report your findings and provide as much additional relevant information as possible.

Don’t credit me. @davenye, @raphaell666 and others are the drivers of this. I just merged their work.

G
 
I was thinking that this was already implemented in 4-30, wasn't it?
I think with "just" he meant "only" and not "right now".

BTW there's not much improvement in the late game, starting industrial, yet, but I've got just one game in so far, I still need to analyze it better.
 
Can anybody explain to me, in layman's terms, what exactly it is that was done on a technical level to improve multiplayer stability? I tried to find out but I couldn't find the right thread.
 
Can anybody explain to me, in layman's terms, what exactly it is that was done on a technical level to improve multiplayer stability? I tried to find out but I couldn't find the right thread.
Summoning @davenye to answer this as he is the responsible for most recent fixes, but meanwhile I will try. The issues in multiplayer that do not exist in single-player are "desyncs" or in other words desynchronization between game clients. The way I understand it is that basically a copy of the game is run on each computer, that tries communicating as little as possible between clients and host. This means that for example random elements with RNG need to be seeded and synchronized between games and have the same result independently, AI (including barbarians) need to have the exact same decisions in every client, and the automatic procedures in all players' clients needs to be the same and occur in the same order, otherwise desynchronizations will occur. Also, all human player actions will have to be communicated. Network instability when communicating will also cause errors, but there is not much that we can do as we do not have access to the netcode. You can find more information on the project's GitHub.

@davenye and @Gazebo have a deeper understanding and can improve my explanation or correct me if I misunderstood.

There are other issues related to the saving mechanisms of the game but we are not sure what is going on with those yet. One tip that I have to avoid desyncs is to be sure that always when you are loading an existing game, it has the AI replaying their last turn before the players. This is the same as loading an autosave. The default save of multiplayer is simply copying/renaming the last autosave and this is the safest option. If when loading a MP game you notice that the AI does not replay their turn before yours, issues will probably arise as this was a "dirty" forced save which can be caused by saving twice and overwriting the same save. I am not sure why saving twice by default causes these forced saves, nor the reason why forced saves cause desyncs, but it is what I have observed.

BTW there's not much improvement in the late game, starting industrial, yet, but I've got just one game in so far, I still need to analyze it better.
What do you mean? I have played ~5 games that got to turns 300+ with the fixes and have only gotten desyncs in a few specific cases that we are already looking into, but when playing normally you should see very few desyncs provided you are using the autosaves and not the forced saves as I mentioned above.
 
There are other issues related to the saving mechanisms of the game but we are not sure what is going on with those yet. One tip that I have to avoid desyncs is to be sure that always when you are loading an existing game, it has the AI replaying their last turn before the players. This is the same as loading an autosave. The default save of multiplayer is simply copying/renaming the last autosave and this is the safest option. If when loading a MP game you notice that the AI does not replay their turn before yours, issues will probably arise as this was a "dirty" forced save which can be caused by saving twice and overwriting the same save. I am not sure why saving twice by default causes these forced saves, nor the reason why forced saves cause desyncs, but it is what I have observed.

Thanks for the explanation! What you're saying about the saving mechanism is quite interesting. Especially in that it conflicts with another issue I sometimes happen to experience. You're probably aware that sometimes when loading an autosave, the AI will not only repeat their last turn, but do two turns after another, skipping the human players. This is usually not such a big issue unless you're at war and get battered. The only way to prevent this double AI turn is by saving twice, essentially creating what you're calling a dirty save.
 
Hi all, to clarify things here is a list of improvements and fixes I have made to better the MP experience over the last few months, unless otherwise noted they are incorporated into the 4-30 version:

- Added code to get Events working in MP
- Added new game option to hide details of unmet civs in the Staging Room when loading MP games

- Fixed bug where the humans players would have their turns skipped in the first turn after loading a game (Thanks to raphaell666 for testing and improvements)
- Fixed bug where the humans players would have their turns skipped in the first turn after loading a game, if not present when Pitboss host starts. [next version]

- Fixed bug in Save Dialog that allowed (potentially buggy) save games when overwriting existing files. This bug was being exploited to avoid the turn skip bug (aka double turn bug) but this should no longer be desired as the issue is resolved.

- Fixed potential desyncs from trade route cache being out of sync
- Fixed desyncs from creating a trade route - routes could have different paths (I feel this was a major cause of desyncs). There still exists a potential for desyncs due to things that occur when opening the create trade route popup, I have a potential/partial fix but have yet to try it.

- Fixed desyncs from auto-exploring (this would have been a major issue for people who auto-explore) [next version]

- Fixed potential desyncs from some turn state not being reset (would affect Simultaneous MP with no AI)

- Changed updating of the tactical map in an attempt to reduce desyncs, although I am not convinced this really helps but AI may be working a little better as a result (need to do some more testing as I still have a suspicion)

- Fixed a number of errors in deal valuation code where the active player was incorrectly being used as a party in the deal. This meant that deals were being both valued incorrectly and also differently on each machine, causing desyncs.
- Fixed desync after non-host human had war declared on them after giving a "mean" response to AI
- Fixed desyncs from sharing opinion with AI


- Fixed CTD when accepting deals
- Fixed erroneous "counter offer" notification accepting human-human deals
- Fixed lack of notification when proposing human-human deals
- Fixed unnecessary withdrawals of proposed deals by AI (due to error in logic)
- Reduced withdrawals of proposed deals by AI by allowing them to change the proposed deal instead of just withdrawing
- Fixed blank name in deal withdrawal notifications
- Fixed orange background on proposed deal notifications - now has proper background of proposing civ [next version]

- Fixed wrong or missing civ icons in MP Staging Room after loading other games
- Fixed runtime error in in-game MP player list when observer present, causing the list to not be displayed
 
Last edited:
You're probably aware that sometimes when loading an autosave, the AI will not only repeat their last turn, but do two turns after another, skipping the human players. This is usually not such a big issue unless you're at war and get battered. The only way to prevent this double AI turn is by saving twice, essentially creating what you're calling a dirty save.
This has been fixed in the latest versions of the VP mod, and does not happen anymore. You can safely load autosaves during wars now.
 
Hi all, to clarify things here is a list of improvements and fixes I have made to better the MP experience over the last few months, unless otherwise noted they are incorporated into the 4-30 version:

- Added code to get Events working in MP
- Added new game option to hide details of unmet civs in the Staging Room when loading MP games

- Fixed bug where the humans players would have their turns skipped in the first turn after loading a game (Thanks to raphaell666 for testing and improvements)
- Fixed bug where the humans players would have their turns skipped in the first turn after loading a game, if not present when Pitboss host starts. [next version]

- Fixed bug in Save Dialog that allowed (potentially buggy) save games when overwriting existing files. This bug was being exploited to avoid the turn skip bug (aka double turn bug) but this should no longer be desired as the issue is resolved.

- Fixed potential desyncs from trade route cache being out of sync
- Fixed desyncs from creating a trade route - routes could have different paths (I feel this was a major cause of desyncs). There still exists a potential for desyncs due to things that occur when opening the create trade route popup, I have a potential/partial fix but have yet to try it.

- Fixed desyncs from auto-exploring (this would have been a major issue for people who auto-explore) [next version]

- Fixed potential desyncs from some turn state not being reset (would affect Simultaneous MP with no AI)

- Changed updating of the tactical map in an attempt to reduce desyncs, although I am not convinced this really helps but AI may be working a little better as a result (need to do some more testing as I still have a suspicion)

- Fixed a number of errors in deal valuation code where the active player was incorrectly being used as a party in the deal. This meant that deals were being both valued incorrectly and also differently on each machine, causing desyncs.
- Fixed desync after non-host human had war declared on them after giving a "mean" response to AI
- Fixed desyncs from sharing opinion with AI


- Fixed CTD when accepting deals
- Fixed erroneous "counter offer" notification accepting human-human deals
- Fixed lack of notification when proposing human-human deals
- Fixed unnecessary withdrawals of proposed deals by AI (due to error in logic)
- Reduced withdrawals of proposed deals by AI by allowing them to change the proposed deal instead of just withdrawing
- Fixed blank name in deal withdrawal notifications
- Fixed orange background on proposed deal notifications - now has proper background of proposing civ [next version]

- Fixed wrong or missing civ icons in MP Staging Room after loading other games
- Fixed runtime error in in-game MP player list when observer present, causing the list to not be displayed
That's so cool! I love you guys!
 
Hello, im inactive some time, xD, the last version more stable (multiplayer) i know its 7-20-17, before its all 2-3 turn desync barbarians, and 15-30 turn without barbarian, i can upload logs and tests with 2 friends and i. We don't play trogether a long time ago because well the latest version i know don't work in mp. But we still plaing sp. If somebody can, i ask if this its a experimental stable version mp, please upload de mp_modpack, update the old. https://forums.civfanatics.com/threads/dlc-modpack-and-43-civ-version-repository.609278/
For 2 reason, for player its dificult to create de modpack, and for player can't create the modpack. Thanks
I search if somebody upload any with 4-30, but not ;/ i will test and upload anything you want just like time before. Bye
 
@davenye, @raphaell666 that's a lot of great fixes, especially the annoying turn skip bug! And it makes sense that I haven't really noticed some of these since I have yet to start a game with the 4-30 version. That's great work, well done and thanks a lot for putting in the time and effort!
 
  • Like
Reactions: pza
Played 4-30 with 3 players, with events and barbarians on, and in 100+ turns got only couple stray desyncs, great job!
 
3 players newest version (4-30-4?)
First desync after 57 later 2 before 100 an maybe each 25 turns another one
Barbarians and events
thanks
 
After 4-30-4 version the mod was working very well with the multiplayer. Now after the latest release (5-20-3) desyncs are back again. It is desyncing constantly like once per 5 turns or something. 5-20-2 version was still working ok.
 
I've managed to play to turn ~80 or so with only few desyncs with a friend... After that desyncs got much worse. Which would be bad, if it wasn't for the fact that he was on 5-20-2 and i was on 5-20-3. I never thought that was possible at all. No wonder the desyncs!
 
I never played MP, so this may sound silly. If the seeding is the same, AI logic should always give same results, shouldn't it? Bad connection issues I don't know if can be solved, but can't it be double checked? Like when you download a file, getting also the MD5 sum. (If clients can request something different that it is already coded to server, that is).
I assume seeding is the same, so no new seed on reload, but can reseeding happen unexpectedly?
 
Top Bottom