The International Simutrans Forum

 

Author Topic: Bug: low bridge built over active canal  (Read 584 times)

0 Members and 1 Guest are viewing this topic.

Offline whaleberg

  • *
  • Posts: 8
  • Languages: EN
Bug: low bridge built over active canal
« on: August 15, 2018, 10:30:42 PM »
I saw an instance where a city built a new low bridge over a canal that I had constructed.  This trapped my ships and made me unable to continue to use the canal.  I had to switch to the public player in order to make the bridge higher. 

It seems like bridges should check if they are obstructing a way before they are built.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #1 on: August 15, 2018, 10:38:35 PM »
This is intended to be how it works (a feature implementing the behaviour of preventing towns building low bridges over public rights of way was implemented some time ago) - but this will be difficult to track down without a saved game in which I can reliably reproduce this occurring at a specific place and time so that I can trap the execution of the faulty code in the debugger and work out exactly what is going wrong. I appreciate that this is likely to be hard to reproduce in this way.

Can I check - is the canal in question a public right of way? (If it is, it will be marked as a public right of way in its information dialogue).

Incidentally, welcome to the forums!

Offline ACarlotti

  • *
  • Posts: 355
Re: Bug: low bridge built over active canal
« Reply #2 on: August 15, 2018, 10:47:50 PM »
Also, could you please confirm what version you were using when the bridge was built? I have very recently merged some changes made in Standard in late 2014, during which time the code for bridge heights was changed several times, so it is possible that I have accidentally (re)introduced a bug.

Offline whaleberg

  • *
  • Posts: 8
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #3 on: August 16, 2018, 02:45:16 AM »
Thanks for the response!  I'm really enjoying extended. 

I'm sorry this was kind of worthless bug report... I didn't think to report it right away and had already saved over the file by the time I decided to.  I had left the game running for a few hours while I went out and I came back to find hundreds of messages saying my ships can't find a route.  I don't have a save game from before it was built.  Incidentally, a rolling autosave would be useful...

It's definitely not a public way now, it's marked as belonging to "default player" which I'm assuming is me... I ended up rebuilding it when I raised the bridge, so it's hard to say what it was before.  I'm pretty sure that I built it as the default player instead of the public service player and never did anything to convert it to a public way.  I don't have any way of verifying it though.

I'm using version 120.2.1 Extended Nightly Development Build 14.0 #bf81728

I've included a screenshot of the offending bridge post raising, although I'm not sure it can help much... ( I had to downscale the resolution a lot to get it small enough to attach, sorry for the terrible quality.)  There's on other oddity in the screenshot, which is a fishing port on the lower left that was built on a tiny landlocked lake that's disconnected from the Fishing Grounds. 

Thanks for all the hard work on extended!

Offline ACarlotti

  • *
  • Posts: 355
Re: Bug: low bridge built over active canal
« Reply #4 on: August 16, 2018, 09:49:21 AM »
Incidentally, a rolling autosave would be useful...
The following setting exists in simuconf.tab
Code: [Select]
# autosave every x months (0=off)
autosave = 0
If set to 1, then this will produce an autosave every game month. These are saved with a name reflecting the month in which the save is made, so you could have up to 12 such saves at one time (which for me is about 12 hours of playing time). The name does not reflect the original save name, however, so if you play September for one game and then play September for a different game (or again in the first game), the second autosave will overwrite the first one.

EDIT:
As for the original bug, it is possible that it either has been fixed, or will be fixed in the course of merging in further changes from Standard, followed by some additional bug fixes that I intend to make (to both Standard and Extended) in the future. So unless you can reproduce this again in an up-to-date build, then I think it is unlikely that we will be able to do any more than keep an eye out for this sort of bug when working on that code.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #5 on: August 16, 2018, 11:05:28 AM »
Thank you for letting me know the position - I am glad that you are enjoying Extended. If you find that this occurs again, please do let us know and we can look into it in more detail.

Offline whaleberg

  • *
  • Posts: 8
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #6 on: August 17, 2018, 02:15:18 AM »
Oh, did not know about that autosave option.  Thank you very much.

I'll let you know if I see the bridge issue again and try to capture a save the reproduces it. 

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #7 on: August 17, 2018, 10:29:07 PM »
Splendid, thank you.

Offline whaleberg

  • *
  • Posts: 8
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #8 on: September 07, 2018, 03:32:39 AM »
So this did end up happening again in the same game.  I had an autosave right before it happened (about 2 minutes on fast motion), and by replaying it repeatedly I was able to reproduce it once more.  That seemed to be a rare occurrence though since I tried a number of times and only reproduced it once.  Maybe it can help?  I'm not sure exactly how the game decides what to build so I'm not sure if there's any way to debug it sanely...

I've played another 20 years of the same game after the bridge without any more incidents.

I put the save game and some screenshots on github because I wasn't sure what the right place to upload was. It seems like this forum has a rather low file size restriction.

https://github.com/whaleberg/simutrans-extended-bug-repro

Offline ACarlotti

  • *
  • Posts: 355
Re: Bug: low bridge built over active canal
« Reply #9 on: September 07, 2018, 04:09:20 AM »
Which version of the game are you using? For a bug like this it is likely that we will need to be running the same (or a very similar) version in order to reproduce it too. The version is a hexadecimal string at the end of the title of the window, and corresponds to the id of the git commit used to build it.
Also, which version of the pakset?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: low bridge built over active canal
« Reply #10 on: September 08, 2018, 09:54:43 PM »
This is likely to be very difficult to test, but I have just pushed a speculative fix for this, which I suspect has a good chance of resolving this. I should be grateful if anyone could let me know whether this recurs after to-morrow's nightly build.