Page 1 of 1

[1.1.60] Desync bug

Posted: Sun Jun 12, 2022 9:20 am
As per instruction by Bilka

I have a desync issue that is caused from the beginning of the game but is rather hidden for some time until a crc check is done by game internals.

Steps to reproduce:
1) Enable Constructron-Continued (any version)
2) Load a fresh multiplayer game
3) /c game.force_crc()

Desync report: ...


Discord conversation 12/6/22 in Mod-making..

Bilka: The Constructron desync doesnt happen in 1.1.50
[7:04 PM] Bilka: Just make a bug report
Bilka: The difference is that the desynced save says the mod was removed and readded once, while the reference save does not say that
[6:41 PM] Bilka: my guess was that the mod does reload_mods() or something, but I couldn't find anything like that in the code
] Illisis: Desyncs with mods category Bilka?
[7:11 PM] Bilka: no, normal bug report
[7:11 PM] Bilka: if you put it in desyncs with mods, nobody will look at it
[7:12 PM] Bilka: + you make it look like the mod is the cause, which is rather unlikely given that the desync is that one of the saves thinks the mod was removed and then added again
[7:12 PM] Illisis: fair enough
[7:12 PM] Bilka: that's not exactly something a mod can cause, especially not without calling reload mods or reload script

Hornwitser's desync tool output:

Code: Select all

python3 -m hornwitser.factorio_tools desync

level_with_tags.dat differs

replace   ref[1:2] -> des[1:2]
<scenario-history> pos=8608972
ref: b'\x06'
<scenario-history> pos=8608972
des: b'\x07'

insert    ref[99:99] -> des[99:116]

ref: b''
<scenario-history> pos=8608972
des: b'<scenario-history-step>\x02<scenario-history-change-item type=2>\x02\x16Constructron-Continued<version>\x01\x00\x05</version>\xc5\xf5{\x98</scenario-history-change-item><scenario-history-change-item type=1>\x01\x16Constructron-Continued<version>\x01\x00\x05</version>\xc5\xf5{\x98</scenario-history-change-item></scenario-history-step>'

Re: [1.1.60] Desync bug

Posted: Mon Jun 13, 2022 3:28 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.

Re: [1.1.60] Desync bug

Posted: Mon Jun 13, 2022 11:05 pm
Thank you!

Any idea why this seemed to effect only my mod?

Re: [1.1.60] Desync bug

Posted: Mon Jun 13, 2022 11:40 pm
by boskid
Its not specific to your mod. This is basically a continuation of 102253 which was fixed by using vector of ModID's that is sorted not by a mod name but by a dependency order. This later caused other issues like 102526 and now this one. There are vectors of ModIDs which are sorted either by a mod name lexicographically, or ModIDs sorted by dependency order. All mods with names which compare lower than string "base" (which includes all mods starting with capital letter as yours, or mods with lower case letter "a" at the beginning and "ba" + letter before "s") and have a dependency on the "base" mod are affected because in the dependencies order they compare second but using names order they compare first. During load the ScenarioHistory was given 2 vectors which were sorted differently and the logic started adding new history step for the observed difference. Fix for this bug report should fix this throroughly because usage of names-order was reduced a lot and the ScenarioHistory no longer cares about order of ModIDs inside of a vector.

Re: [1.1.60] Desync bug

Posted: Thu Jun 23, 2022 10:25 am
by Thiske
Not that it really matter but it also happend to me using 1.1.59 with aai-signal-transmission