[0.14.3] [0.14.2] Desync

Desyncs in modded game will be ignored most of the time, until it is clearly proven that the desync is not caused by scripting.
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

[0.14.3] [0.14.2] Desync

Post by bk5115545 »

Some friends and I are trying to do a huge modded play through but we're getting desyncs.

The desyncs aren't consistent and they only happen after the game has progressed a little bit. I can always reproduce the desync by playing enough to research Automation 1. People can sometimes connect at the beginning but can't connect after a short while.

I've removed quite a few of the mods that we thought might be it (Research Queue, Handy Hands, and more) but we're really just shooting in the dark. Any help would be appreciated.
The attachment desync-report-2016-09-03_00-34-36.zip is no longer available
mods.zip
Mods
(45.2 MiB) Downloaded 187 times
donn_test.zip
save
(2.47 MiB) Downloaded 139 times
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by orzelek »

You can try bisection of mods:
Remove first half and test, then other half and repeat the test.
It's the quick way to find out at least approximately which mod it might be (if it's mod related).
Loewchen
Global Moderator
Global Moderator
Posts: 9282
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by Loewchen »

Did you mention 2 versions in the title because you had desyncs in both versions in general, or is there something specific that makes you think the same issue got into 14.3 as well?
The report you uploaded, is it from 14.2 or .3?
Thx.
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by bk5115545 »

Loewchen wrote:Did you mention 2 versions in the title because you had desyncs in both versions in general, or is there something specific that makes you think the same issue got into 14.3 as well?
The report you uploaded, is it from 14.2 or .3?
Thx.
We first tried 0.14.3 and the desyncs were constant until the desync limit kicked people. Then we tried 0.14.2 and they are less constant but people cannot join after a little while. I usually play up to the first couple of researches before I open the map to public because my friends don't enjoy the super slow start. No one can join after the first research has been completed. I don't think it's related to research because we removed those mods but it serves as a time after which everyone desyncs on join. If they were there the whole time (since the map was created) they're fine but if they disconnect they can't rejoin.

It's also probably mod related because if I pause the game, have them download, and wait for them to catch-up zero actual ticks (or 1 or something like that), then they still desync without me unpausing the game.

The issue might be in 0.14.1 and 0.14.0 but those versions have so many fixes that I didn't test them.
orzelek wrote:You can try bisection of mods:
Remove first half and test, then other half and repeat the test.
It's the quick way to find out at least approximately which mod it might be (if it's mod related).
That's a good idea. It'll still take me and another guy 3 to 5 hours since we have to get to the first research to see if someone can join us but it's a lot faster than removing a few and then testing. Thank you.
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by bk5115545 »

Thanks to auto-hotkey and some input mimicking, I tested 5 different servers (with the same world seed) all at the same time.

It's one of the below mods. I'll report back when I find out exactly which one.

bobtechsave_0.14.0
filtered-deconstruction-planner_0.4.7
ItemCount_0.0.5
NatrualTreeExpansion_0.2.0
StrangeMatter_0.1.2

My guess is either StrangeMatter (because I changed the version requirements for it to load) or NatrualTreeExpansion (since it changes the game after a short while and probably relies on randomness).

Edit: It's not bobs or itemcount
Edit: It's not filtered-deconstruction-planner or StrangeMatter which means it's NaturalTreeExpansion.

I'll go post on that mods forum entry about the bug.
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by bk5115545 »

Alright since I know what mod it is, I looked at the source code and found an instance of math.random().

Is math.random() synced? The mod worked fine in 0.13 and I assume it's because of the lock-step determinism. If math.random() isn't wrapped by the game and if os.random() relies on time then mods that rely on math.random() MIGHT not work on 0.14.

Does the modding API provide something like game.random() or script.random() that provides a "random" number that is based on the tick number instead of time? I found an old reference to map.random() (from 2015) but map isn't even an object anymore.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by orzelek »

bk5115545 wrote:Alright since I know what mod it is, I looked at the source code and found an instance of math.random().

Is math.random() synced? The mod worked fine in 0.13 and I assume it's because of the lock-step determinism. If math.random() isn't wrapped by the game and if os.random() relies on time then mods that rely on math.random() MIGHT not work on 0.14.

Does the modding API provide something like game.random() or script.random() that provides a "random" number that is based on the tick number instead of time? I found an old reference to map.random() (from 2015) but map isn't even an object anymore.
math.random() is remapped to internal implementation thats multiplayer safe.
Try looking for local variables that are kept between ticks and/or initialized in places like on_load or other events.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.14.3] [0.14.2] Desync

Post by kovarex »

If its a mod error, we will not fix it.
Post Reply

Return to “Desyncs with mods”