Multiplayer pause / drop detection issue

This subforum contains all the issues which we already resolved.
Dag
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue May 24, 2016 6:33 am
Contact:

Multiplayer pause / drop detection issue

Post by Dag »

Hi,

I have a headless server to be able to switch locations without bringing my saves with me all the time. And quite often I find that I have been playing only on my local save without being connected to the server. I did some research and found out how my playing pattern is causing this.

If I play and my internet goes down, I get noticed with a warning, which is very good. If i minimize or the OS is pausing the factorio-process, the server drops me and I get noticed with a warning which is also very good. However, if I pause the game and get dropped (after some minutes), when I unpause again I am disconnected from the server, and the only notice is a faded text in the console saying "Server stopped communicating, cannot continue in game." (which I don't notice). Then I play for many hours thinking that I am still playing on the multiplayer server, while only playing local.

There really should be a huge blinking red light. The screen should shake and the game should be screaming a audible warning when this happens :)

Who wants it anyway ? If you are playing a multiplayer game and gets disconnected, I cannot imagine someone wanting to just be playing along locally. (OK, maybe someone, but it should be confirmed with a button saying "yes I want to continue locally" :)

Sorry for the rant, just looked forward to continue a game, and found out this had happened and the latest savegame is in a computer too far away :)

(Possibly also not a bug per se)

/Dag
Loewchen
Global Moderator
Global Moderator
Posts: 9196
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Multiplayer pause / drop detection issue

Post by Loewchen »

Just enable Multiplayer_waiting_statistics in the debug-menu. If the server is gone then you are no longer connected.
Dag
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue May 24, 2016 6:33 am
Contact:

Re: Multiplayer pause / drop detection issue

Post by Dag »

Ok, thanks for the tip, it will make it easier to detect if I have lost communication at least.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Multiplayer pause / drop detection issue

Post by Klonan »

Thanks for the report,

We will look at ways of solving this issue,
Though it may not strictly be a bug
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Multiplayer pause / drop detection issue

Post by Oxyd »

Can't reproduce. Paused the game, disconnected the server and got the “Server stopped communicating, cannot continue in game.” dialog as I should.
Dag
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue May 24, 2016 6:33 am
Contact:

Re: Multiplayer pause / drop detection issue

Post by Dag »

It might be related to osx and powersaving/putting the process to sleep (by minimizing the window).

I also believe there is a difference in being disconnected and being dropped from the game ? Might be hard to reproduce if you can't sleep the process as I suppose OSX does when it's minimized. Maybe you can tell osx that you do not want it to be put to sleep ?

A minute or so after pausing and minimizing factorio, the logs starts saying:
29610.723 Info Synchronizer.cpp:444: NetworkTick(7730982) peer(12) drop detection state(100/600).
129613.553 Info Synchronizer.cpp:444: NetworkTick(7730988) peer(12) drop detection state(100/600).
129615.220 Info Synchronizer.cpp:444: NetworkTick(7730988) peer(12) drop detection state(200/600).

And when it gets to 600/600 I get dropped from the game. When I open factorio again, I see no change, still paused game. If I unpause and continue and play, it is on a local game.

This is how it looks after opening factorio and wanting to play again.
Yes, I might be the only person being annoyed about this (osx and minimizing a network-game) but thought you should know anyway :) (My first thought was, gah, the multiplayer-part in facotorio is so unstable).

Image

Log says:

129610.723 Info Synchronizer.cpp:444: NetworkTick(7730982) peer(12) drop detection state(100/600).
129613.553 Info Synchronizer.cpp:444: NetworkTick(7730988) peer(12) drop detection state(100/600).
129615.220 Info Synchronizer.cpp:444: NetworkTick(7730988) peer(12) drop detection state(200/600).
129790.112 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(100/600).
129791.779 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(200/600).
129793.446 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(300/600).
129795.112 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(400/600).
129796.780 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(500/600).
129798.445 Info Synchronizer.cpp:444: NetworkTick(7741329) peer(12) drop detection state(600/600).
129800.162 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(100/600).
129801.829 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(200/600).
129803.495 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(300/600).
129805.162 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(400/600).
129806.828 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(500/600).
129808.495 Info Synchronizer.cpp:444: NetworkTick(7741341) peer(12) drop detection state(600/600).
129808.512 Info Synchronizer.cpp:590: NetworkTick(7741341) peer(12) peerHeartbeatsEmpty(false) is not responding, dropping.
129808.547 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
129808.548 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
129808.550 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
129808.551 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
129808.553 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
129808.553 Warning Synchronizer.cpp:70: networkTick(7741342) received heartbeat(networkTick(7741335) closedTick(false) ) from unknown peer(12).
*100 or something, then some lines with:
129808.584 Warning Synchronizer.cpp:70: networkTick(7741343) received heartbeat(networkTick(7741345) closedTick(true) ) from unknown peer(12).
129808.584 Warning Synchronizer.cpp:70: networkTick(7741343) received heartbeat(networkTick(7741346) closedTick(true) ) from unknown peer(12).
then alot of
129808.612 Warning Synchronizer.cpp:70: networkTick(7741343) received heartbeat(networkTick(7741347) closedTick(false) ) from unknown peer(12).
129808.612 Warning Synchronizer.cpp:70: networkTick(7741343) received heartbeat(networkTick(7741347) closedTick(false) ) from unknown peer(12).
and in the end:
129808.628 Info MultiplayerManager.cpp:1495: Peer dropout for peer (12) by peer (0) -- removing now
129808.629 Info MultiplayerManager.cpp:1010: networkTick(7741347) mapTick(16262677) removing peer(12) dropout(true)
129808.629 Info Synchronizer.cpp:516: networkTick(7741347) removing peer(12) success(false).
129808.629 Info MultiplayerManager.cpp:913: networkTick(7741347) mapTick(16262677) changing state from(InGame) to(InGameAligning)
129808.629 Info MultiplayerManager.cpp:1719: networkTick(7741347) mapTick(16262677) starting mapAlign
129808.629 Info MultiplayerManager.cpp:1633: networkTick(7741347) mapTick(16262677) adding mapAlignTask(RemovePlayerAlignTask)
129808.728 Info MultiplayerManager.cpp:1060: networkTick(7741353) mapTick(16262677) received stateChanged peerID(0) oldState(InGame) newState(InGameAligning)
129808.729 Info MultiplayerManager.cpp:1653: networkTick(7741353) mapTick(16262677) sending mapAlignAction
129808.828 Info MultiplayerManager.cpp:1307: networkTick(7741359) mapTick(16262677) received MapAlignAction from peer(0), mapAlignTick(16262678) appliedTickClosuresCount(0)
129808.829 Info MultiplayerManager.cpp:1735: networkTick(7741360) mapTick(16262677) mapAlign finished targetTick(16262678) updating map and running the tasks ...
129808.829 Info MultiplayerManager.cpp:1607: networkTick(7741360) mapTick(16262677) peerID(0) fullStateLog: local state(InGameAligning) local peers(((peerID(0) state(InGameAligning) mapAlignTick(16262678))
)
129808.853 Info MultiplayerManager.cpp:1754: maptick(16262678) crc before applying all ticks: -2140563956
129808.853 Info NetworkInputHandler.cpp:661: applyAllTickClosures: expectedMapTick(16262678) lastTickApplied(16262669) referenceMapTick(16262678) networkTick(7741360)
129808.854 Info MultiplayerManager.cpp:1762: maptick(16262678) crc after applying all ticks: -2140563956
129808.854 Info MultiplayerManager.cpp:913: networkTick(7741360) mapTick(16262678) changing state from(InGameAligning) to(InGameAligned)
129808.945 Info MultiplayerManager.cpp:1060: networkTick(7741366) mapTick(16262678) received stateChanged peerID(0) oldState(InGameAligning) newState(InGameAligned)
129808.945 Info MultiplayerManager.cpp:913: networkTick(7741366) mapTick(16262678) changing state from(InGameAligned) to(InGameWaitingForOthers)
129809.045 Info MultiplayerManager.cpp:1060: networkTick(7741372) mapTick(16262678) received stateChanged peerID(0) oldState(InGameAligned) newState(InGameWaitingForOthers)
129809.045 Info MultiplayerManager.cpp:1259: networkTick(7741372) mapTick(16262678) stopping mapAlign
129809.046 Info MultiplayerManager.cpp:1785: performing map align task (RemovePlayerAlignTask)
129809.046 Info MultiplayerManager.cpp:1809: networkTick(7741372) mapTick(16262678) finishing removing peer(12) hasPeer(false)
129809.046 Info MultiplayerManager.cpp:2121: NetworkTick(7741372) MapTick(16262678) disconnecting player(0) from the user.
129809.047 Info NetworkInputHandler.cpp:544: expectedMapTick(16262678) removing peer(12) success(true).
129809.047 Info Synchronizer.cpp:516: networkTick(7741372) removing peer(12) success(false).
129809.048 Info MultiplayerManager.cpp:913: networkTick(7741372) mapTick(16262678) changing state from(InGameWaitingForOthers) to(InGame)
129809.048 Info MultiplayerManager.cpp:1607: networkTick(7741372) mapTick(16262678) peerID(0) fullStateLog: local state(InGame) local peers(((peerID(0) state(InGameWaitingForOthers) mapAlignTick(-1))
)
129809.145 Info MultiplayerManager.cpp:1060: networkTick(7741378) mapTick(16262678) received stateChanged peerID(0) oldState(InGameWaitingForOthers) newState(InGame)
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Multiplayer pause / drop detection issue

Post by slpwnd »

I tried to reproduce this (both in 0.13 and then in 0.12.x) but without success. What I did:

- create server
- connect client
- pause client
- minimise client
- kill server

and the client gets a notice box about server being disconnected ...
Dag
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue May 24, 2016 6:33 am
Contact:

Re: Multiplayer pause / drop detection issue

Post by Dag »

I think the main difference here is that you killed the server.

I never kill the server, but the server drops the client after the client stops responding to keepalive-pings ?('drop detection state' in the log)

You have to wait some minutes for the drop-detection to give up. I have 2 macbook pro's, and it happens on both of them, so this would most certainly be default behavior.

- create server
- connect client
- pause client
- minimize client
- observe the log, wait for the client being dropped ('peer(12) peerHeartbeatsEmpty(false) is not responding, dropping.')
- resume client

Sorry for not being absolutely clear about the procedure before.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Multiplayer pause / drop detection issue

Post by slpwnd »

Thanks for the details. That was it=) I managed to replicate the issue and fix it. In 0.13 the result is such that the game continues, but player receives a clear message that he is playing the local copy of the game (to give him a chance to save the game for instance before reconnect).
Dag
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue May 24, 2016 6:33 am
Contact:

Re: Multiplayer pause / drop detection issue

Post by Dag »

Fantastic that you made it in the .13 :) As long as it is virtually impossible to continue without knowing about the disconnecting I am very happy :)

Keep up the good work!
Post Reply

Return to “Resolved Problems and Bugs”