MarcasRealAccount / FactorioDustlessMiners

A mod that adds miners whose purpose is to reduce pollution
GNU General Public License v3.0
0 stars 1 forks source link

Multiplayer desynchronization problem #1

Closed coding-komek closed 3 years ago

coding-komek commented 3 years ago

A buddy of mine and me were using this mod with version 0.2.0 in a multiplayer game. As soon as we started to use the drills, some time after the save game seems to have gotten corrupted, causing him to not be able to join my server any more. Instead he received the message, that his game is no longer synchronous.

We then tested again, rolling back to version 0.1.1. After booting up the game, he then was able to connect without any problems, so there seems to be an issue with the additions/changes from the latest version of the mod.

Could you please check this?

MarcasRealAccount commented 3 years ago

so I made a headless server running this mod, creative mod and fnei. After filling an iron patch with the T1 miners I got the server to save the map and then I restarted it with the new map, and I got in just fine.

First try to run the command "/dustlessminers reset" to see if that fixes the issue.

If not could you tell me what your settings are set to, as that could help me figure out the root to the issue.

coding-komek commented 3 years ago

I have done some researching about solutions for desync errors and we have tried some of those, including "/dustlessminers reset", but none worked for us.

It may be a compatibility issue with other mods we have installed. Here is an image of our current mod list. factorio-mods-list For the corrupted save file, dustless miners is used with version 0.2.0 of course, this is from the currently working world.

Also the savegame already has about ~20h of play time and we are using a local server and connection via Steam/LAN. What I have also tried in the meantime is using the "heavy mode" (reference https://wiki.factorio.com/Desynchronization) and in a new world there were no errors in comparison to the already existing save file. I have not built any miners in this new world though.

MarcasRealAccount commented 3 years ago

Ok so I tested with the same mod list as you, but I am still unable to reproduce the issue.

I should probably say I am not using the steam version, because I needed two instances of factorio to be able to host a server and join it myself.

The steps I took was:

  1. create a world with the command 'call "bin/x64/factorio.exe" --create "saves/world.zip"'
  2. start the server with the command 'call "bin/x64/factorio.exe" --start-game "saves/world.zip"'
  3. start the second instance of the game
  4. connect to the local server through 'localhost:34197'
  5. use some commands to get T1 dustless miners and just regular belts and pipes and some power production.
  6. exit the game so the server saves the world
  7. close and start the server again like in the beginning
  8. reconnect with the second instance.
  9. got in just fine again.

I also tried running the server as a player itself, changing the map settings and a lot of other things. But even through all of that it still worked just fine.

So in general I can't fix something I don't have a clue what is.

As a last fix I can think of try to run it with an instance installed from factorio.com instead. If that doesn't fix it, I will have to dig deeper into the issue with a friend of mine whilst we are playing a large bobs pack, that might take a few days though, so until then if you don't care about the realism just use 0.1.1 until we have tested it more deeply.

coding-komek commented 3 years ago

We will test the non Steam version and will give you feedback on this. For further debugging I could also offer to send you the save game, if this can help you with finding the error.

Since I am busy for the rest of the day I will not be able to reply until tomorrow.

MarcasRealAccount commented 3 years ago

yeah maybe the save game could help

coding-komek commented 3 years ago

Hey, we have now tested with the standalone version and the problem exists there as well.

We then did some more modular testing, checking single components for possible desync errors. I removed parts of the miners and my buddy connected until it worked. The point where the connection was established again was, when i removed all pipes from the miners and they have gone idle. So I then added the pipes again. Sometimes the connection worked, but other times it desynced again. It seems that the pipe connection may be responsible for the desync errors.

And the most interesting part of it: When my buddy was connected to the game, I placed down a line of pipes to the miners and just this action caused him to desync and drop out of the game.

MarcasRealAccount commented 3 years ago

hmm sounds odd as that should be handled by factorio on its own, the only thing the mod does is insert a fluid into the miner causing it to push the fluid out.

But as I said earlier I am soon going to get the mod tested with a friend on a save we are playing on, if we get the problem I might be able to find a possible fix, but until then just use the 0.1.1 version as it is stable.

MarcasRealAccount commented 3 years ago

The problem arose when me and my friend tested on a world he had. And I think I found the culprit for the issue.

It might be caused by the fact that some local values are being used each tick even though the values should've been synced by the fact that they update to the same values at the same time. As well as a local value called firstTick which was supposed to be used by the server on the first tick to update some global values, but I have changed them all to global values and hopefully the issue should be gone.

Yeah it got fixed, so I will update the mod sometime tomorrow.

coding-komek commented 3 years ago

Perfect, thank you very much! :)

MarcasRealAccount commented 3 years ago

I hope you want some more recipes, as I fixed another issue where it wasn't creating recipes because they were never added to their technologies. As well as I added new recipes for turning dust into ore :)

The update should be out soon.

coding-komek commented 3 years ago

We have also tested and it is working as expected now. Thanks again! :) I am afraid I have to open another issue though since we ran into a new problem with the Krastorio rare metals.

Since this issue is fixed, I am closing it.