[0.15.9] Desync - Multiplayer Scenario

Desyncs in modded game will be ignored most of the time, until it is clearly proven that the desync is not caused by scripting.
Post Reply
Oarc
Fast Inserter
Fast Inserter
Posts: 100
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

[0.15.9] Desync - Multiplayer Scenario

Post by Oarc »

Here's my logs: https://www.dropbox.com/sh/su1j239zralf ... nA0ma?dl=0
(let me know if the link doesn't work)

Here's my scenario code:
https://github.com/Oarcinae/FactorioSce ... layerSpawn

All players desync'd at once. No idea what the cause is. I realize there's a chance that I'm doing something weird in my scenario code, but I have no idea how to debug a desync.

Server: 0.15.9, Ubuntu 64 bit, Headless, Custom scenario, 10 player max. Had around 10 players at time of deysnc.

For what it's worth, my server and another one that runs the same scenario have been seeing a lot of desyncs since 0.15 came out. I haven't changed much of the core code of the scenario since 0.14 though, just updated what I needed to for 0.15 and added a few minor features.

Also, my client that I use to join my server failed to rejoin. It got stuck redownloading the map (with limited server upload speed a desync like this kills the server as everyone tries to rejoin and nobody can as they all compete for download bandwith). Had to force close factorio to play again.

Thanks,
Oarc

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.15.9] Desync - Multiplayer Scenario

Post by Klonan »

Thanks for the report,

Unfortunately, we don't have much spare time to try and diagnose scripting related desyncs,
Even if they may be caused by some API interaction

If you can narrow it down to some specific game API command with some simple steps to reproduce,
We should be able to fix it quickly

Until there is some more evidence this is caused by the game,
I will move this to 'Desync with mods'

Oarc
Fast Inserter
Fast Inserter
Posts: 100
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

Re: [0.15.9] Desync - Multiplayer Scenario

Post by Oarc »

Can you point me to any guides to figure out how to track down and understand desyncs?
I have no problem trying to investigate myself, I just don't know where to start.

Thanks,
Oarc

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.9] Desync - Multiplayer Scenario

Post by Nexela »

Oarc wrote:Can you point me to any guides to figure out how to track down and understand desyncs?
I have no problem trying to investigate myself, I just don't know where to start.

Thanks,
Oarc
Here is how to figure out the most common mod desync issue:
Does this variable change -> if YES -> Will this value be used outside of THIS tick -> if YES then put it in global.variable

Each client needs to do the exact same thing.

This example won't desync but is the precursor for desyncs
Client1 loads up A=1, some_event happens A = 2, When Client2 loads up HIS A=1, when the event happens BOTH clients get A=2. The reason this won't desync is because it doesn't change the game state (yet)

Code: Select all

A = 1
on_event(some_event, function() A = 2 end)
Keeping the example above lets print something

Code: Select all

on_event(some_other_event, function() game.print(A))
Client1 loads up A=1, some_event happens A = 2, now Client2 loads up his A is still 1. some_other_event happens and one client prints 2 and the other client prints 1. This results in boom

Oarc
Fast Inserter
Fast Inserter
Posts: 100
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

Re: [0.15.9] Desync - Multiplayer Scenario

Post by Oarc »

Thanks for the tip, I understand what might cause desyncs and have tried to follow the correct use of global for my programming already.
However, I now have a large code base and I would like to be able to learn how to investigate a desync by looking at the desync log itself.
Can anyone tell me how to "load" a desync file to show exactly where the desync is happening?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: [0.15.9] Desync - Multiplayer Scenario

Post by daniel34 »

Here's a small bit on how to analyze desync reports: viewtopic.php?f=25&t=42313#p248078

Unfortunately your dropbox only contains the desynced level and not the reference level, so I can't compare them.
quick links: log file | graphical issues | wiki

Post Reply

Return to “Desyncs with mods”