We started this world a couple of days ago and played the first few hours without any problems. All of a sudden we started having desync issues. There was no specific thing that caused the desync and it happened at random times, sometimes on connection, other times not for 10 or 20 minutes.
We have tried going through disabling mods and have been unable to figure out which mod is causing the issue, if a mod is causing the issue.
I have attached our mod list and a link to the desync report.
https://drive.google.com/file/d/1oOk8v_ ... sp=sharing
[Fixed][0.17.79] Desync using Mods in Multiplayer (Endless Resources)
-
- Manual Inserter
- Posts: 2
- Joined: Mon Feb 03, 2020 10:40 am
- Contact:
Re: [0.17.79] Desync using Mods in Multiplayer
Thanks for the report.
In desync report, primary differences are around crude-oil resourceAmount and secondary differences are around fluid amounts. I managed to narrow this desync down to one mod: "Endless resources". This mod is flawed as it has variable "tick_counter" that is stored outside of "global" variable so will not be saved, client will start with different(default) value and so it will desync.
In desync report, primary differences are around crude-oil resourceAmount and secondary differences are around fluid amounts. I managed to narrow this desync down to one mod: "Endless resources". This mod is flawed as it has variable "tick_counter" that is stored outside of "global" variable so will not be saved, client will start with different(default) value and so it will desync.
- Philuminati
- Inserter
- Posts: 35
- Joined: Sun Aug 05, 2018 1:04 am
- Contact:
Re: [0.17.79] Desync using Mods in Multiplayer
Thanks for the notification. I am the author of the mod and first of all, I don't know much about Lua or the specs of Factorio's API. I was using this counter to make the mod UPS friendly but I understand the problem with it. Could you please explain to me how the global tick counter works and how I access it via Lua, so I can fix this issue.
Re: [0.17.79] Desync using Mods in Multiplayer
In control.lua, line 1 you have:Philuminati wrote: ↑Tue Feb 04, 2020 9:22 pm Thanks for the notification. I am the author of the mod and first of all, I don't know much about Lua or the specs of Factorio's API. I was using this counter to make the mod UPS friendly but I understand the problem with it. Could you please explain to me how the global tick counter works and how I access it via Lua, so I can fix this issue.
Code: Select all
tick_counter = 17700
You may want to set initial value of "global.tick_counter" inside callback for script.on_init and then use it inside script.on_event.
Btw, for performance it is better to use script.on_nth_tick rather than catching every tick and counting ticks by yourself.
-
- Manual Inserter
- Posts: 2
- Joined: Mon Feb 03, 2020 10:40 am
- Contact:
Re: [0.17.79] Desync using Mods in Multiplayer
Thank you so much for the reply, really appreciate the help!!
- Philuminati
- Inserter
- Posts: 35
- Joined: Sun Aug 05, 2018 1:04 am
- Contact:
Re: [0.17.79] Desync using Mods in Multiplayer
I changed the script to use the "on_nth_tick"-method you mentioned. Please tell me if it works without desyncs now. The new version is for 0.18 at the moment so tell me also if you need a version compatible with older savegames.
Re: [0.17.79] Desync using Mods in Multiplayer
Hello Philuminati,
I've just learned that you've created a fix for 0.18. A friend and I are playing multiplayer on 0.17.79 (current steam version) and suffer from desyncs, where I guess (from the desync-report diff) that the endless resources mod may be one of the troublemakers.
Could you be so kind and provide a 0.17 update as well?
Thanks a lot!
Cheers,
MagSun
I've just learned that you've created a fix for 0.18. A friend and I are playing multiplayer on 0.17.79 (current steam version) and suffer from desyncs, where I guess (from the desync-report diff) that the endless resources mod may be one of the troublemakers.
Could you be so kind and provide a 0.17 update as well?
Thanks a lot!
Cheers,
MagSun
- Philuminati
- Inserter
- Posts: 35
- Joined: Sun Aug 05, 2018 1:04 am
- Contact:
Re: [Fixed][0.17.79] Desync using Mods in Multiplayer (Endless Resources)
Sorry for the late answer, I didn't get a notification for your message... You can easily modify my latest version to work for 0.17 by editing the "info.json" file in the mods folder. Just edit the part:
to:
The mod doesn't use script mechanics that didn't exist in 0.17, so it shouldn't be a problem. If it is though, feel free to write me in the discussion section of the mod...
Have fun,
Phil
Code: Select all
"factorio_version": "0.18",
"dependencies": ["base >= 0.18.0"]
Code: Select all
"factorio_version": "0.17",
"dependencies": ["base >= 0.17.0"]
Have fun,
Phil