Page 1 of 1

Coop causing desyncs

Posted: 09 Sep 2009, 13:05
by YokoZar
I'm still seeing the coop desync every now and again. I believe this is how to reproduce it:

Have player 1 and 2 cooping, and have them both place and ready before player 3 connects/loads.

After 3 connects/loads, don't have 1/2 place or right click any more.

Player 3 will desync. The workaround is to wait until everyone connects before you place as a cooper.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 13:39
by Niobium
Coop start points are sent as lua messages

If you aren't connected, you don't get the start point, and then desync on game start.

The solution is to send all start points thus far (if any) to each player when they connect, or change the way the gadget works.

This also causes desync if a player does not receive a 'side change' message, so re-placing after the person connects is not sufficient, you also need to re-change your side, if you changed your side to non-default before they connected.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 14:01
by Auswaschbar
All previously selected startpositions are sent to a player when he connects, and are broadcasted another time when game starts for this exact reason...

Re: Coop causing desyncs

Posted: 09 Sep 2009, 14:06
by Niobium
Auswaschbar wrote:All previously selected startpositions are sent to a player when he connects, and are broadcasted another time when game starts for this exact reason...
For spring, yes, for BAs mo_coop gadget, no

Re: Coop causing desyncs

Posted: 09 Sep 2009, 14:10
by lurker
So you think the messages are getting dropped.

Another possibility is that they're loading at the wrong point, that normally you'd have some call related to loading then lua messages, and now it's in the wrong order.

Replays might help, one from each side.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 14:11
by Auswaschbar
lurker wrote:So you think the messages are getting dropped.
I don't think, I know.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 15:08
by Regret
Auswaschbar wrote:
lurker wrote:So you think the messages are getting dropped.
I don't think, I know.
Image

Re: Coop causing desyncs

Posted: 09 Sep 2009, 15:10
by TheFatController
Coop almost always desyncs when someone drags their script onto spring.exe after a failed connection attempt I've noticed.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 16:01
by Niobium
TheFatController wrote:Coop almost always desyncs when someone drags their script onto spring.exe after a failed connection attempt I've noticed.
Yes, because they weren't connected when the coop messages were sent.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 17:11
by YokoZar
maybe change script to only send synced code on first frame? Then the rest can be unsynced (so maybe a late joiner has wrong core/arm info about a player)

Re: Coop causing desyncs

Posted: 09 Sep 2009, 17:16
by TheFatController
Then you wouldn't know where your allies start points were.

It could resend everything on GameStart to reclarify it all, i'd much rather have access to a 'CountDownStart' callin instead tho rather than doing this in game.

(I'd also much rather have the existing functionality fixed ;) )

Re: Coop causing desyncs

Posted: 09 Sep 2009, 17:17
by Auswaschbar
YokoZar wrote:maybe change script to only send synced code on first frame? Then the rest can be unsynced (so maybe a late joiner has wrong core/arm info about a player)
Keep in mind that if you send in frame 1, it will arrive in frame >= 1, or not at all if the player dropped in between.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 17:41
by Niobium
If a player joins, and you are a cooped player with a coop start point, send your current start point / faction to the joining player, if you have one.

Done.

Re: Coop causing desyncs

Posted: 09 Sep 2009, 17:47
by TheFatController
Is there a player joined callin or anything similar tho?