My first question is, what is the best place to start in the desync report? Is the reference level the state before the desync occurred?
I currently have a desync that I can reproduce in my local setup (with 2 copies of Factorio running side by side) and it happens every time a modded entity is built but it only happens in games where there are lots of other mods. For instance, if I run a local game with only my mod in it, it doesn't desync at all. When there's lots of other mods, it does but only the remote player is desynced. The server keeps running fine. I'm not sure if that's a clue either? In trying so solve this particular issue, I can see when I diff files like script.dat, that there are changes between the reference and desync level and I'm not sure if this is something I need to dig into? For instance, the diff below shows that a different entitytarget was stored in the global table between the 2 levels but I'm not sure if this is a problem or not?

I wonder if this is part of the cause as this is the information that is written when the entity is placed. But there's also GUI things that happen around the same time and so I'm not sure which part of my code I should look further into. Are there some golden rules with regards to desyncs I should be taking heed of?
If anyone has any advice it would be much appreciated. I'm trying to avoid just uploading endless desyncs to the bug report forum and expecting someone to just magically work it out. I'm trying to learn how to actually resolve these and make this a better experience for everyone!
