Page 1 of 1

[Pending] Chain Desyncs in MP

Posted: Wed Jun 08, 2016 4:49 am
by ikiris
So Sub runs a dedicated server with a handfull of mods, and players frequently get stuck in desync loops. This is a desync report after I experienced it tonight and we're playing on bleeding edge experimental for once. Is it possible to just get which mod is the culprit easily? If not I completely understand and don't worry about this before .13 is out and it can be revisited.

EDIT: almost forgot. The mods are avaliable here: https://github.com/subnitrates/Oxynitrate

Re: Chain Desyncs in MP

Posted: Wed Jun 08, 2016 7:12 am
by Rseding91
Does the desync loop happen without the mods? If so, then it's one of the mods causing it and you'd need to contact the mod(s) author(s) about fixing the mod(s).

If you can reproduce it without the mods please upload the save file.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 7:00 am
by ikiris
I'm almost positive it's mod related, and no I haven't tried without mods, because this is a public dedicated server which I do not run. If you guys think the answer is to guess randomly and contact all the developers of 20+ mods, then I really don't know what to tell you, and lost a bit of respect in the process.

If you (or the user) can't identify which event has caused the desync, and ideally what addon caused that mismatch from the output, that's a problem with the platform itself, not the individual mods running on that platform.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 7:53 am
by Rseding91
ikiris wrote:I'm almost positive it's mod related, and no I haven't tried without mods, because this is a public dedicated server which I do not run. If you guys think the answer is to guess randomly and contact all the developers of 20+ mods, then I really don't know what to tell you, and lost a bit of respect in the process.

If you (or the user) can't identify which event has caused the desync, and ideally what addon caused that mismatch from the output, that's a problem with the platform itself, not the individual mods running on that platform.
We can't 100% fix people writing bad code so at best we spend a bunch of time, identify what's going wrong with which mod and tell them to fix it. Maybe they do or maybe they don't and then it happens again with the next mod.

We *can* fix bad code with Factorio (desyncs with no mods) and they won't happen again because we can write a test to ensure it stays fixed. If we spent hours (and sometimes days) hunting down every problem with every mod we would never get any work done on the game its self.

That leaves the mod bugs to the mod developers to fix.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 9:00 am
by DaveMcW
kovarex mentioned a plan to make mods desync-proof, but that won't happen until at least 0.14. http://www.factorio.com/blog/post/fff-141

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 9:20 am
by Rseding91
DaveMcW wrote:kovarex mentioned a plan to make mods desync-proof, but that won't happen until at least 0.14. http://www.factorio.com/blog/post/fff-141
I'm also highly skeptical that it can even be done since I've never seen anyone do what he wants to do.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 11:05 am
by Loewchen
Rseding91 wrote:
DaveMcW wrote:kovarex mentioned a plan to make mods desync-proof, but that won't happen until at least 0.14. http://www.factorio.com/blog/post/fff-141
I'm also highly skeptical that it can even be done since I've never seen anyone do what he wants to do.
Would it not be possible to write a script that checks if variables are handled correctly by a mod and mbe combine that with a Multiplayer compatible tag in the new Mod Portal? I would imagine this being less time consuming.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 8:39 pm
by ikiris
Rseding91 wrote:
ikiris wrote:I'm almost positive it's mod related, and no I haven't tried without mods, because this is a public dedicated server which I do not run. If you guys think the answer is to guess randomly and contact all the developers of 20+ mods, then I really don't know what to tell you, and lost a bit of respect in the process.

If you (or the user) can't identify which event has caused the desync, and ideally what addon caused that mismatch from the output, that's a problem with the platform itself, not the individual mods running on that platform.
We can't 100% fix people writing bad code so at best we spend a bunch of time, identify what's going wrong with which mod and tell them to fix it. Maybe they do or maybe they don't and then it happens again with the next mod.

We *can* fix bad code with Factorio (desyncs with no mods) and they won't happen again because we can write a test to ensure it stays fixed. If we spent hours (and sometimes days) hunting down every problem with every mod we would never get any work done on the game its self.

That leaves the mod bugs to the mod developers to fix.
Factorio developers shouldn't be involved in chasing the desync. The game should clearly indicate what is unsynced, and ideally what caused the difference. Humans shouldn't be involved in the process except to make the platform indicate the problem as more than a basic "general protection fault"

If the above were true, I wouldn't be here asking, I'd be chasing the specific mod that is the problem either for a fix, or for replacement. Fix the platform and you won't have to waste time fixing the mods that use it.

Re: [Pending] Chain Desyncs in MP

Posted: Sun Jun 12, 2016 9:12 pm
by Loewchen
ikiris wrote:Factorio developers shouldn't be involved in chasing the desync. The game should clearly indicate what is unsynced, and ideally what caused the difference. Humans shouldn't be involved in the process except to make the platform indicate the problem as more than a basic "general protection fault"

If the above were true, I wouldn't be here asking, I'd be chasing the specific mod that is the problem either for a fix, or for replacement. Fix the platform and you won't have to waste time fixing the mods that use it.
kovarex wrote:
Loewchen wrote:
kovarex wrote:Well, after inspecting it, there really seems to be a lot of mods, and I bet that one of these is causing it.
That is quite disheartening. From the perspective of someone looking in from the outside its seems, that those desync-reports do not provide you with the information necessary to troubleshoot. I would ask you to consider developing a more capable system that would enable mod developers or even users themselves to use, as this would save you time spent looking into mod caused desyncs and would help improving stability of the base-game and mods.
kovarex wrote: The easiest way to test it is to try to remove some mods and see if it still happens, and find out which mod (or mods are causing it).
This approach is not viable since a simple restart of the server would "fix" the problem until it is put in the everyone-on-the-server-can-play-fine-but-everyone-joining-will-desync-instantly mode again (see linked post for more info).

Greetings Loewchen
The problem with mods is, that they are written in lua, and lua doesn't provide proper serialisation of the state of the script, so if the modder doesn't know what is he doing, he can cause desyncs.

If we had enough resources and time, we would probably make our own scripting language that would solve these and other problems natively, but it is not the current case.
There could be also other ways to check that mods are doing the same on different computers, but it would cause the execution of the lua code to be much slower.
The plan we have for the furture is, that once we have the mod portal integrated, the statistics of desynchronisations will be processed, so statically, it will be easy to guess which mods are causing desyncs.

Re: [Pending] Chain Desyncs in MP

Posted: Mon Jun 20, 2016 4:40 pm
by schnitz
Hi there

i like to play factorio it is really a great game. It have lot of nice stuff in it, and keep me and my friends playing for days and days ... days

So we got also an desync error. After version changeging and map convert everything seems fine.


One day another friend tries to connect and we all get desync error and server stuck into it.
I fixt it workaround with copy+paste old savegame ...

Is it possible to fix it, that he can connect to also?

Re: [Pending] Chain Desyncs in MP

Posted: Mon Jun 20, 2016 6:34 pm
by Loewchen
schnitz wrote: So we got also an desync error. After version changeging and map convert everything seems fine.
Is it possible to fix it, that he can connect to also?
You seem to be playing the base game, make a new bug report and link your desync-report (in the archive folder in your application directory)