The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: chor on October 20, 2013, 07:16:43 AM

Title: 11.12 weird desync problem
Post by: chor on October 20, 2013, 07:16:43 AM
I've been trying to extend a station today in an online game - I removed some roads, added a platform, and then the game disconnects.
When I relaunch it, all my work (including a line I managed to add before the disconnection, in one time it stayed connected for a little longer) is still there, except for one tile which keeps becoming a road tile.

(http://img14.imageshack.us/img14/4718/i4h9.png)
This has happened for me for at least 4-5 times today.

It can be seen on Simu.zapto.org, around (1068, 589) (Kiryat Motzkin city)
Title: Re: 11.12 weird desync problem
Post by: chor on October 20, 2013, 08:42:14 AM
Update: I think I figured the source of this bug: deleting this tile leaves a building with no road access, which causes the game to crash. This may also be the source of the other desync Asaph mentioned.
The game should either not let you delete roads isolating a building, or make it not crash every time it happens.
Title: Re: 11.12 weird desync problem
Post by: jamespetts on October 20, 2013, 11:36:45 AM
Thank you very much for the report. Can you upload a saved game in which this can be reproduced? Is it only the server that crashes, or does the client crash, too?
Title: Re: 11.12 weird desync problem
Post by: chor on October 20, 2013, 12:54:49 PM
Quote from: jamespetts on October 20, 2013, 11:36:45 AM
Thank you very much for the report. Can you upload a saved game in which this can be reproduced? Is it only the server that crashes, or does the client crash, too?

I'll check it and let you know.
Title: Re: 11.12 weird desync problem
Post by: jamespetts on October 20, 2013, 01:00:35 PM
Thank you.
Title: Re: 11.12 weird desync problem
Post by: chor on October 20, 2013, 01:01:05 PM
Ok, it doesn't happen on local games, just on the online game.

I only disconnect from the game, the client doesn't crash.

This reminds me that I also disconnect from the game when saving the game (say, for backup reasons) - the download (save) is complete and then I disconnect.
Title: Re: 11.12 weird desync problem
Post by: jamespetts on October 20, 2013, 01:05:54 PM
Thank you for that report - that is helpful. I will look into this when I get a chance.

Incidentally, desynchronising on saving locally is normal behaviour.
Title: Re: 11.12 weird desync problem
Post by: chor on October 20, 2013, 01:11:10 PM
Thanks a lot for your quick replies, James. Your efforts are really appreciated!
Title: Re: 11.12 weird desync problem
Post by: asaphxiix on October 22, 2013, 05:34:06 PM
indeed this is the bug I reported. Good catch on the disconnected house trigger, choro!
Title: Re: 11.12 weird desync problem
Post by: jamespetts on October 24, 2013, 09:59:41 PM
I have now fixed on the 11.x branch what I can reproduce of this problem. I have not been able to reproduce a crash, but I have found and fixed a desync relating to deleting roads: it is intended that the public player can delete any road, even if it would disconnect a building. Other players should not be allowed to disconnect roads from public buildings. What was happening, however, was that the game was checking for whether the roads were being deleted by the public player by checking whether the active player was the public player, which, of course, is likely to be different on the server than on any given client, meaning that roads would often be deleted on the client but not the server (as reported in the original message). This would eventually cause a desync. I have now fixed this by checking specifically the deleting player.

However, I am not sure what was causing a crash, as I could not reproduce it. It might or might not be related to the issue that I describe. Do either of you know of any instances where any of these problems occurred in circumstances that cannot be accounted for by what I describe above?
Title: Re: 11.12 weird desync problem
Post by: asaphxiix on October 24, 2013, 10:10:46 PM
Nope this was a straight desync problem, I think choro used the word crash by mistake, but really meant desync. (since he later reported the client didn't crash, and I know the server didn't, either).
Title: Re: 11.12 weird desync problem
Post by: asaphxiix on October 24, 2013, 10:11:34 PM
thanks very much for fixing it james!