The International Simutrans Forum

 

Author Topic: Spurious reservations upon loading  (Read 3377 times)

0 Members and 1 Guest are viewing this topic.

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Spurious reservations upon loading
« on: December 19, 2016, 05:53:53 PM »
Upon loading the old large save-game, across the network will appear random spurious reservations. It is hard to pin-point an exact location, because it does not follow any clear pattern; but upon loading will, in places where trains are waiting or close to one-another, spurious reservations appear. The reserving train will reserve, for example, platforms well ahead of it, and/or random (1-4 tiles in length), and cause a dead-lock because other trains cannot pass, and the train that has reserved it, cannot possibly reach. This happens on circuit block and absolute block sections with no clear connection to the type of signalling.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #1 on: December 19, 2016, 09:45:22 PM »
It will be exceedingly hard to track down the problem without a reliable way of reproducing it. Are you able to test further to narrow down more precisely the circumstances in which it occurs? Also, to which saved game are you referring, and do these reservations always appear at the very moment of loading, or are they ever created after the game has been loaded?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #2 on: December 19, 2016, 09:47:38 PM »
It occurs when reloading a save in zipped format. Try it out with my UK map (by saving in zipped and reloading), it should occur.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #3 on: December 19, 2016, 09:54:20 PM »
It occurs when reloading a save in zipped format. Try it out with my UK map (by saving in zipped and reloading), it should occur.

That is very interesting. Does it not occur in any other format? Junna - can you confirm that this can be reproduced only when loading/saving in zip (rather than bzip) format?

May I ask both of you whether you use Linux, Windows or Mac OS? This may well be relevant to the Windows/Linux desync issue (if, for example, this occurs with Windows and not Linux, this would cause a desync, as multi-player games are saved in zipped rather than bzip format).

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Spurious reservations upon loading
« Reply #4 on: December 19, 2016, 10:10:01 PM »
I am using zipped saves and loaded an autosave when I first noticed this. Am using Windows as well.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #5 on: December 19, 2016, 10:14:01 PM »
I am using zipped saves and loaded an autosave when I first noticed this. Am using Windows as well.

Thank you for confirming. Can you test loading/saving in different formats to see whether the problem can be reproduced there?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #6 on: December 19, 2016, 10:57:59 PM »
It appears that trains leave a couple of tiles behind them reserved when loading.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #7 on: December 19, 2016, 11:01:55 PM »
It appears that trains leave a couple of tiles behind them reserved when loading.

Do you mean loading from a saved game in the zipped format or loading at a station?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #8 on: December 19, 2016, 11:04:55 PM »
Loading from a zipped format.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #9 on: December 19, 2016, 11:06:11 PM »
Loading from a zipped format.

Thank you. May I ask whether you are using Windows or Linux?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #10 on: December 19, 2016, 11:07:32 PM »
Windows.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #11 on: December 19, 2016, 11:42:02 PM »
Windows.

Thank you - that is very helpful. May I ask where you are getting your builds from?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #12 on: December 19, 2016, 11:44:05 PM »
Github and compiled with MSVS 2015.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #13 on: December 20, 2016, 12:05:19 AM »
Github and compiled with MSVS 2015.

And may I ask where you obtain your zip libraries?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #14 on: December 20, 2016, 12:17:32 AM »
From the sources linked to in this thread. I believe I recompiled libbz2.lib myself to make it work in MSVS 2015.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #15 on: December 20, 2016, 12:19:37 AM »
libbz2 relates to bzip, which is a different format. Was it to bzip that you were referring earlier or the plain zipped format?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #16 on: December 20, 2016, 12:25:55 AM »
Plain zipped. So for that I should have the ready-made binary.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #17 on: December 20, 2016, 12:27:20 AM »
What is the date of the version of zlibstat.lib that you are using? I am attempting myself to re-compile with an older version.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #18 on: December 20, 2016, 12:32:17 AM »
October 1st 2015.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #19 on: December 20, 2016, 12:34:07 AM »
Can you try to download and use some other versions of this file to see whether it makes any difference? Do not forget to clean the build between each attempt and re-name the other file to something like zlibstat.lib.new to make sure that it can only be using the new one.

Edit
: Attempting to connect to the Bridgewater-Brunel server with a Windows client compiled with a version of zlibstat.lib from 2013 instead of the previously used version from 2016 did not affect the desync there.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Spurious reservations upon loading
« Reply #20 on: December 22, 2016, 01:29:13 AM »
I just got similar (bigger) spurious reservations with an autosave made in bzip2 format. This seems to indicate that it has something to do with autosaving in general rather than a particular format.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #21 on: December 22, 2016, 01:35:53 AM »
Autosaving? Interesting. Can anyone else who has had this problem confirm whether this is confined to autosaving?

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Spurious reservations upon loading
« Reply #22 on: December 22, 2016, 06:41:13 AM »
That I cannot narrow down, but now and then random spurious reservations should appear in my save-game previously uploaded without any interference (quite often it is in stations, but can be anywhere). This obviously makes it hard to know ahead of time.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #23 on: December 22, 2016, 11:30:43 AM »
That I cannot narrow down, but now and then random spurious reservations should appear in my save-game previously uploaded without any interference (quite often it is in stations, but can be anywhere). This obviously makes it hard to know ahead of time.

Was that game saved with autosave or otherwise?

Also, are you sure that you and Rollermaterial are describing the same problem; Rollermaterial is, I think, describing spurious reservations that exist at the very moment of loading, but your reference above to random spurious reservations appearing without interference suggests otherwise. Are you both able to clarify?

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Spurious reservations upon loading
« Reply #24 on: December 22, 2016, 11:37:59 PM »
Well, I would say that I think they might appear during play, but I cannot guarantee this; it is possible they were upon loading. I only notice them once a number of trains have piled up and become visible on the map. It mostly appears on sections with numerous lines running over them. The trains reserving the sections invariably seem to have passed the section already, but the reservation remains.

It was saved manually, but some time before it did the loading of autosave on closing, so the reservation strangeness might have been from this.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #25 on: December 23, 2016, 12:05:24 AM »
Thank you both for your reports. I will have to try to look into this when I get back from my Christmas holiday (until then, I will not be able to do much coding work). If in the meantime either or both of you could narrow down the problem further, that would be exceedingly helpful.

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Spurious reservations upon loading
« Reply #26 on: January 07, 2017, 09:54:01 PM »
I cannot narrow this down any further, the spurious reservation appear all over, but -- mostly where a service reverses. There will be anything from 2-5 or more locations around the network -- particularly in heavy trafficked areas with many trains going around -- each time it is loaded, regardless of the save settings.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #27 on: January 07, 2017, 09:59:32 PM »
Thank you for the information. On loading the exact same saved game, do the reservations appear in different places on different occasions of it being loaded (i.e., do you get a spurious reservation in place X when loading the game on one occasion, and when closing it - without saving - and loading the same saved game again do you get no spurious reservation in X, but perhaps another one in Y that was not present when the game was last loaded)? Also, can you confirm precisely which saved game that you mean by the "old large saved game", and the minimum amount of time before these reservations occur?

Thank you again.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #28 on: January 11, 2017, 11:08:17 PM »
I am not sure whether or not this is the same problem, but I have found and fixed a problem that caused spurious reservations to remain at stations after trains had departed. Can you re-test to see whether this problem now recurs?

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Spurious reservations upon loading
« Reply #29 on: January 22, 2017, 12:51:17 AM »
Testing shows that the spurious reservations remain after loading and unloading save  game (both going to menu and restarting the program).

I haven't seen any new spurious reservations appear since updating the exe so far.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Spurious reservations upon loading
« Reply #30 on: January 22, 2017, 11:25:38 PM »
The nature of the problem and the fix is that new spurious reservations will not be created, but if the spurious reservations were created in the unfixed version and the game then saved, the fixed game will have no way of knowing which reserved tiles are incorrectly reserved and which are correctly reserved. I recommend using the clear reservation tool on the incorrectly reserved tiles: hopefully, no further tiles will now become incorrectly reserved.