Page 1 of 1

[posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Wed Aug 14, 2019 3:28 pm
by CynAtom
Tried to run 5-10 mods at a time. Everything worked. When we run around more than half of the mods, we catch desync.
Mod pack and desync report: https://drive.google.com/open?id=1NE90_ ... TJ6dMMxmDo
The desync-report was made at all enabled mods.

Re: [0.17.64] Multiplayer desync / too much mods?

Posted: Mon Aug 19, 2019 1:40 pm
by posila
Thanks for the report.
Internal IDs are different, which should not happen. The person who desynced was running on Windows 7, what operating system does server (or person who hosted the game) use, can you post any Factorio log from the server computer?

Re: [0.17.64] Multiplayer desync / too much mods?

Posted: Mon Aug 19, 2019 1:54 pm
by CynAtom
Of course i can, because i was host :)

Re: [0.17.64] Multiplayer desync / too much mods?

Posted: Mon Aug 19, 2019 2:03 pm
by posila
You were trying this with two instances of the game on the same computer?

Re: [0.17.64] Multiplayer desync / too much mods?

Posted: Mon Aug 19, 2019 2:12 pm
by CynAtom
Run two versions of the game on different computers with absolutely same modpack, not LAN, on version 0.17.64 was launched.

Re: [0.17.64] Multiplayer desync / too much mods?

Posted: Tue Aug 20, 2019 7:59 am
by posila
Ok, I was able to reproduce it - if on host I sync mods and mod settings with the save, then on client sync mods with host the desync happens after connecting, and mod settings file on client doesn't match the one on server.

Re: [posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Wed Aug 21, 2019 12:06 pm
by CynAtom
This mean what i should give mod settings file with all changes to my friends and start new game?

Re: [posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Wed Aug 21, 2019 12:52 pm
by Adamo
CynAtom wrote:
Wed Aug 21, 2019 12:06 pm
This mean what i should give mod settings file with all changes to my friends and start new game?
What I do is zip up the entire mods folder into a mods.zip file and distribute that to the players who want to connect, just to be sure everything matches perfectly.

Re: [posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Wed Aug 21, 2019 1:21 pm
by posila
CynAtom wrote:
Wed Aug 21, 2019 12:06 pm
This mean what i should give mod settings file with all changes to my friends and start new game?
After further investigation it turned out not to be problem with mod settings. ZAdventure end up with non-deterministic data stage, somehow. I am trying to figure out how.

Re: [posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Thu Aug 22, 2019 2:54 pm
by posila
I am giving up on trying to fix this. Instead I've added prototype checksum, so that difference in prototypes is detected even before connecting. The problem is serializing table that contains functions (even though the only function that causes the nondeterministic behavior seems to be no-op: function() end) in ZAdventure ... the issue seems to be deep rooted inside the Lua interpreter.

Re: [posila] [0.17.64] Multiplayer desync / too much mods?

Posted: Thu Aug 22, 2019 3:00 pm
by Adamo
posila wrote:
Thu Aug 22, 2019 2:54 pm
I looked for this a bit in the ZAdventure code, because I had experienced a problem that sounded similar when reading functions from a metatable. But the code was too big for me to just figure out in an hour, and since you were on it, I figured you'd do a better job than I could, and since it was data phase, not control phase, I figured it was probably unrelated. But now you mention it's related to serializing functions, which makes it a bit more similar. When I had my problem, I ultimately found that the issue was in a print that was being sent out that referred to different locations of the same function, and was also printing a message that depended on the reference value, so the print was coming out differently for different clients. This probably isn't helpful, but, on the off chance, and since I saw that ZAdventure is doing a bunch of logging even, IIRC, during the data phase, I mention it.