The International Simutrans Forum

 

Author Topic: Half height bridge bug  (Read 2361 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2715
    • My addons, mostly roadsigns
  • Languages: EN, CS
Half height bridge bug
« on: March 15, 2015, 10:37:14 AM »
Hi, I'm trying devel-new branch and noticed that half-height bridges can be built over ways. Vehicles pass under  without problems, but the way on top of the bridge cannot be upgraded.
Savegame here: https://uran.webstep.net/~vladki/simutrans/test-bug.sve

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Half height bridge bug
« Reply #1 on: March 15, 2015, 12:28:29 PM »
Thank you for the report: I should be grateful, however, if you could post bug reports in a new topic, one for each bug. I ask because I use the forum as a sort of bug tracker, so it is important to have this degree of separation. I have split this post into its own thread for this purpose.

Edit: I have managed to reproduce this. Can any of the Standard developers remind me where the part of the code is that checks whether a bridge is half height or full height so that I can track this down more easily?
« Last Edit: March 15, 2015, 04:36:27 PM by jamespetts »

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: Half height bridge bug
« Reply #2 on: March 24, 2015, 10:01:32 PM »
The only code is to check the z coordinate and check whether the pak enforce double height bridges over ways or not.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Half height bridge bug
« Reply #3 on: March 24, 2015, 10:49:54 PM »
Thank you for the reply: that is most helpful. Is that in simtool.cc or bridgebuilder.cc?

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: Half height bridge bug
« Reply #4 on: March 25, 2015, 10:06:49 PM »
Neither. You just compare max_h for a tile (shoud be in simworld.cc) with the curent pos.z of the bridge. This is the current height of the bridge. And example is in the bridge builder too.

if you ignore slopes:
bridge->get_pos().z-welt->lookup_kartenboden(bridge->get_pos().get_2d())->get_pos().z>=welt->get_settings().get_get_way_height_clearance()

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Half height bridge bug
« Reply #5 on: March 25, 2015, 10:28:30 PM »
Splendid, thank you. I will look into this when I get a moment. That is most helpful.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Half height bridge bug
« Reply #6 on: July 23, 2015, 12:22:15 AM »
Looking into this, this is not actually a bug: Pak128.Britain-Ex had simply not defined way_height_clearance = 2. I have now amended that so that it does define way_height_clearance = 2, so it should no longer be possible to build single height bridges over ways.

Thank you for your report!

Offline wlindley us

  • Devotee
  • *
  • Posts: 978
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Half height bridge bug
« Reply #7 on: August 09, 2015, 09:49:07 PM »
With the latest (as of 2015-08-09) source and pak128.Britain-experimental, I cannot figure how to actually make a rail or road bridge anymore.  The built-in city generator does, but it's not clear what combination of single- or double-height slopes and ways would be required to get a bridge built.  Help?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Half height bridge bug
« Reply #8 on: August 09, 2015, 10:42:29 PM »
Building bridges is a little different to how it used to be, as you no longer need to (or, indeed, can) build a bridge starting from a way on a slope tile. Instead, a bridge should be dragged accross from the nearest non-slope tile on one side to the nearest non-slope tile on the other side.

Offline wlindley us

  • Devotee
  • *
  • Posts: 978
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Half height bridge bug
« Reply #9 on: August 10, 2015, 09:52:11 AM »
Aha! That works, although it requires rather different construction planning. Thanks!