Krastorio 2


An overhaul mod focusing on end-game technologies and moderately increased complexity.

Overhaul
9 days ago
0.18 - 1.1
308K
Transportation Logistics Trains Combat Armor Mining Fluids Logistic network Manufacturing Power Storage

b [Fixed] Desync when picking up creep

4 years ago

When picking up creep with the creep collector, the game desyncs

4 years ago

Hi,
I have the exact same issue

4 years ago
(updated 4 years ago)

I have the same behaviour on a game hosted on a dedicated (Windows) server. The problem only occurs when the server is running for a while and it's working again after a short restart of the game server. The server unfortunality only prints standard desync messages:

76887.387 Info ServerMultiplayerManager.cpp:923: updateTick(7918266) received stateChanged peerID(7) oldState(InGame) newState(DesyncedWaitingForMap)
76887.388 Info ServerMultiplayerManager.cpp:1008: updateTick(7918266) received playerDesynced peer (7)
76887.388 Info ServerMultiplayerManager.cpp:923: updateTick(7918266) received stateChanged peerID(5) oldState(InGame) newState(DesyncedWaitingForMap)
76887.389 Info ServerMultiplayerManager.cpp:1008: updateTick(7918266) received playerDesynced peer (5)
76887.392 Info ServerMultiplayerManager.cpp:774: updateTick(7918266) changing state from(InGame) to(InGameSavingMapForDesyncReport)

We started the round with 0.9.11 where we only had desyncs when one player played a while alone, another couldn't join before the server was restartet. We updated to .12, .13 and now .14 after release and now have the same issue. Not sure if this is version related or not.

We playing with Factorio 18.21 from both Windows and Linux clients.

4 years ago

Game freezes for a while when picking up creep with the creep collector even when playing solo.

4 years ago

Another piece of info we just discovered ingame:

When collecting the creep with the creep collector tool the game desyncs instantly if the server is up for some while but it's working without any problem to use robots to collect the creep.

Linver ☆
4 years ago

This issue is due slow client/server connection, we can't change the way how Factorio sync users. I have test it in multiplayer for months and this never happen with a stable connection. I'm sorry.

4 years ago

Hi Linver,
Thanks for the update. We will try this on a local self-hosted version and see what happens with that "slow" player. Is there a lua command to disable the creep on the server ? (or is that cheating)

Linver ☆
4 years ago
(updated 4 years ago)

Hi Vitauh,
Reached the end game is possible use a virus that permanently remove the creep.
If is too difficult wait the end game I can give u something to type in console to disable the creep but will disable the possibilty of unlock the achievements.

Anyway to be more precise with my previous answer:

    if not cu.random_generator or not cu.random_generator.valid then
        cu.random_generator = game.create_random_generator()

This is what Factorio can't handle from my experiments, when the object to randomize the creep collected is expired, the game will re-create it, but the client can't reach this state in time.

4 years ago
(updated 4 years ago)

This issue is due slow client/server connection, we can't change the way how Factorio sync users. I have test it in multiplayer for months and this never happen with a stable connection. I'm sorry.

Thanks for the answer but I want to challenge that this is purly connection based. I'm running a dedicated server in an datacenter which is also physical quite close (<300km) to all players connecting to it. We having different kind of internet connections from 50k up to 1GBit connections. Different region, providers, technology. The link to the server is stable, fast and reliable for everybody not only in Factorio.

As we only facing the desync when using the creep collector but not when doing it with robots for example we have a way to work around here. Also the fact that this only happens when the server is running for a while and not directly after an restart of the game server is sth why I cant see the connection is a problem here. the problem also occurs when nobody else is on the server. Would be interesting to know how the setup of the others which reported this looks like.

Linver ☆
4 years ago

Hi Neander,
as I said, in the scripts exist some Factorio objects that "expire" on time, seems that Factorio don't handle properly the updating it in all clients concurrently. I don't know how fix bugs that hard coded.

4 years ago

I don't think it's necessarily related to network speed as I just ran into this issue on my LAN with me being the only connected player. I've been playing Krastorio 2 for a few weeks now and this was the first time I've had this happen.

Restarting the server as suggested did fix the problem though.

4 years ago

"this never happen with a stable connection"
This is happening with a server on my LAN, but good to know a restart fixes it for a while.

4 years ago
(updated 4 years ago)

As we only facing the desync when using the creep collector but not when doing it with robots for example we have a way to work around here. Also the fact that this only happens when the server is running for a while and not directly after an restart of the game server is sth why I cant see the connection is a problem here. the problem also occurs when nobody else is on the server.
Would be interesting to know how the setup of the others which reported this looks like.

Got the same exact issue, but it only happens to 1/3 players. we havent checked with others
I run my server on a vps with 3gb RAM, Intel® Xeon® E-2174G and 1GB/s

Thanks for the reply Linver. sorry you cant fix it.
Can you still send the command in case i want to disable creep. I suspect i will not care about achievements anymore.

Furthermore, A workaround we found yesterday, is to use stone to mine a path over the creep and it's removing itself without issues.

Linver ☆
4 years ago
(updated 4 years ago)

For disable creep generation:

/c remote.call("kr-creep", "set_creep_on_chunk_generated", false)
remote.call("kr-creep", "set_creep_on_biter_base_built", false)

For remove all creep from nauvis:

/c local creeps = game.surfaces[1].find_tiles_filtered
{ 
    name = "kr-creep"
}
local tiles_to_replace = {}
for _, creep in pairs(creeps) do
    table.insert(tiles_to_replace, {name = "landfill", position = creep.position})
end
game.surfaces[1].set_tiles(tiles_to_replace)

Anyway in the next version I will try to re-structure the collectors code to be less predisposed to desync, I can't grant a sure/complete fix, but I have some idea to reduce this effect.

Linver ☆
4 years ago
(updated 4 years ago)

Hi jab416171,
As I said, I don't know how Factorio handle users syncs because is hard-coded, and I can't provide a sure fix because the cause of the desync come out from some Factorio object expiring not synched properly/fast enough with all clients connected to one server, but u can imagine that if the mod work well for a while and "randomly" desync, something of weird happens, and modders rarelly can do something each time that a crash come out from a ".cpp" file.

If u are really upset try to report this desync to Factorio dev too, maybe they can do more than me on this.

Linver ☆
4 years ago

Talking to dev I discorver bit more tips how sync variables.
Fixed in the next version! (0.9.15)

4 years ago

Thanks for the discussion and your effort on it. Appreciate it! :)

4 years ago

Thanks for the fix! Greatly appreciated :)