Page 1 of 1

[0.12.0] Multiplayer Desync

Posted: Sun Jul 19, 2015 10:15 am
by Fatmice
Hello,

I have a new multiplayer desync to report. This time it is around fluid and is somehow associated with my mod. Desync happens when fluid in pipe is very low and due some changes to the fluid characteristics, I think there is some sort of oscillation.

This desync was present in 0.11.22 and persist to now. I can reproduce this either with two local instance of Factorio or over the network with a friend.
Desync-Fluid.png
Desync-Fluid.png (4.19 MiB) Viewed 4132 times
Load the save game. Remove the fuel assemblies from the chest. Wait for a little bit while the fluid superheated-dry-steam is consumed. Desync should commence once the fluid starts to oscillate.

Savegame
Mod

Re: [0.12.0] Multiplayer Desync

Posted: Sun Jul 19, 2015 7:15 pm
by Rseding91
This is an issue with the way you've written the mod and not the game :)

On line 7 and 9 of your mod's control.lua you're setting local variables which are used to alter the game state in the on_tick event.

Player 1 loads the game: tickingA is set to 59.
Tick 1 happens: tickingA is reduced by 1 (now 58)
Player 2 connects to the game: tickingA for player 2 is set to 59
Tick 2 happens: tickingA is 58 for player 1 and 59 for player 2 - desync.

Re: [0.12.0] Multiplayer Desync

Posted: Sun Jul 19, 2015 7:48 pm
by Fatmice
Okay, good to know, how do I go about fixing it? I was going to rewrite the ticker but don't have a good idea yet.

Now that I think about it more. If what you said is true, then why doesn't the desync happens immediately upon client connection? I've let the simulation run days with my friends and no desync will occur. It only happens when fluid starts to oscillate.

Re: [0.12.0] Multiplayer Desync

Posted: Sun Jul 19, 2015 11:39 pm
by Fatmice
Big Thank You to Rseding. I've fixed this bug.