The International Simutrans Forum

 

Author Topic: Bad bridge height restriction logic.  (Read 34843 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2835
  • Languages: EN
Bad bridge height restriction logic.
« on: February 10, 2018, 12:42:15 AM »
When trying to build a bridge over a way owned by someone else it will be correctly limited to double height (2 ground levels above). However trying this over river or ones own ways limits it to only a single height above (1 ground level). This will/should make the ways unpassable due to insufficient clearance.

Easiest way to recreate is make 2 companies. Get both companies to have a stretch of road in a flat area. Then with one company try to make a bridge over both company ways that supports double height. It will double height over the other company way but only single height over the own way.

One can solve this case by explicitly forcing a double height bridge with control modifier. However there is no modifier to explicitly force a single height bridge. This is a problem when trying to cross a river or own way which is 1 tile below. It will either construct a flat, no ramp, bridge which is only single height above the way rendering it impassable, or construct a double height bridge which is 3 ground levels above the way pointlessly forcing an unnescescary elevation rise in the way. It is not possible to solve it with the intended single height bridge for double height clearance.

The same logic for other company ways should apply to ones own ways. I cannot think of a situation where one might want only a single height bridge over ones own ways as practically every convoy needs double height clearance.

One could also solve this by allowing a modifier for forcing single height bridges. Currently there is only a modifier to force double height bridges which does not cover the case mentioned above.

This might also apply to standard.
« Last Edit: April 17, 2018, 07:05:37 AM by DrSuperGood »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20688
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Bad bridge height restriction logic.
« Reply #1 on: February 10, 2018, 11:31:18 AM »
When trying to build a bridge over a way owned by someone else it will be correctly limited to double height (2 ground levels above). However trying this over river or ones own ways limits it to only a single height above (1 ground level). This will/should make the ways unpassable due to insufficient clearance.

This is not correct: the lower way will be passable by any vehicle that is not tall. Horse drawn road vehicles, canal barges, vans and single decker 'buses and trams can all pass under single height bridges.

Quote
One can solve this case by explicitly forcing a double height bridge with control modifier. However there is no modifier to explicitly force a single height bridge. This is a problem when trying to cross a river or own way which is 1 tile below. It will either construct a flat, no ramp, bridge which is only single height above the way rendering it impassable, or construct a double height bridge which is 3 ground levels above the way pointlessly forcing an unnescescary elevation rise in the way. It is not possible to solve it with the intended single height bridge for double height clearance.

This is because, as discussed in another thread recently, there is currently no support for the necessary graphics to allow a double height bridge starting from a sloped tile. This is an issue in Standard as well as Extended, and so the discussion of that issue was moved to the Standard extension requests subforum on the last occasion that it was raised.

Quote
The same logic for other company ways should apply to ones own ways. I cannot think of a situation where one might want only a single height bridge over ones own ways as practically every convoy needs double height clearance.

It is not true that practically every convoy needs double height clearance: as noted above, most convoys do not require double height clearance. Only double decker 'buses, double decker trams and tall ships require double height clearance.

Quote
One could also solve this by allowing a modifier for forcing single height bridges. Currently there is only a modifier to force double height bridges which does not cover the case mentioned above.

This might also apply to standard.

I am not sure how a modifier to force a single height bridge would assist - can you elaborate?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2835
  • Languages: EN
Re: Bug: Bad bridge height restriction logic.
« Reply #2 on: April 17, 2018, 06:51:41 AM »
Ops did not see this was replied to...

I was not aware so many convoys could work under single height bridges. When I made this post boats were in heavy use and most boats cannot work under single height bridges, especially ones sea capable.
Quote
It is not true that practically every convoy needs double height clearance: as noted above, most convoys do not require double height clearance. Only double decker 'buses, double decker trams and tall ships require double height clearance.
Train lines appear to force double height requirements. Where as I can build a bridge over my roads which is only single height, trying to do so over railroads forces a double height clearance.

Is it intentional that all trains/train lines require high clearance?
Quote
I am not sure how a modifier to force a single height bridge would assist - can you elaborate?
An example of where this is needed is on the server game @4995,2378. This is an artificial paninsula that was created as part of the Cagbury railway line. Connecting it to the mainland by road requires crossing a sea tile with road bridge. Since sea going ships might have to sail under it, it must have a clearance of 2 above sea level.

Trying to build the bridge normally results in a flat bridge with only 1 clearance above sea level, too little for most sea going ships. Using the Ctrl modifier results in a double height bridge resulting in a clearance of 3 above sea level, more clearance than needed and a performance hazard for road vehicles. Instead the desired bridge is single height as shown in the example, giving a shallow elevation change for vehicle performance and double height clearance for sea going ships.

In order to build this bridge I had to fill the tile with land, create a single height bridge over that land tile then remove the land tile to return it to sea. This created the desired bridge, at considerable cost, but also created an ugly visual bug since removing the terrain under the bridge did not extend the bridge supports down so it appears the bridge is floating in air to some extent.

Offline ACarlotti

  • *
  • Posts: 483
Re: Bad bridge height restriction logic.
« Reply #3 on: April 17, 2018, 09:01:37 AM »
Could you provide a diagram of the situation you describe, for the benefit of those of us not in the server game?

See also https://forum.simutrans.com/index.php/topic,17819.msg169835.html#msg169835 for a discussion of issues with building tall bridges.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2835
  • Languages: EN
Re: Bad bridge height restriction logic.
« Reply #4 on: April 17, 2018, 09:30:14 AM »
Quote
Could you provide a diagram of the situation you describe, for the benefit of those of us not in the server game?
Attached is image showing the situation.

Left bridge is too low. Middle bridge is needlessly high. Right bridge is the sort of bridge needed in these situations.

Instead of ctrl enforcing double height bridge construction, it should enforce double height clearance over all ground the bridge spans. In the case of the sea in the example the single height bridge would be selected as to enforce double height clearance for the sea tile under its span.

Offline ACarlotti

  • *
  • Posts: 483
Re: Bad bridge height restriction logic.
« Reply #5 on: April 17, 2018, 01:36:25 PM »
Ah, I see. So I think the improved behaviour here would be to have Ctrl build a bridge that is one level higher than would be built without pressing Ctrl (if that is possible). Does that sound right?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2835
  • Languages: EN
Re: Bad bridge height restriction logic.
« Reply #6 on: April 17, 2018, 06:56:14 PM »
Quote
Does that sound right?
Possibly. Would have to try it to see if it does not cause regression somewhere else.

Offline Vladki

  • Devotee
  • *
  • Posts: 3659
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
How to enforce bridge with high, low, or no ramp?
« Reply #7 on: July 28, 2019, 08:55:37 PM »
Have a look at at 855,482 in this save: http://list.extended.simutrans.org/debug-saves/bridges.sve
There is a ship channel one level below road ends. If you try to build a bridge as the owner of the channel or public player, it will be flat - leaving low clearance (only for barges): screen92

If you build with ctrl (or as some other player), a full height bridge will be built, although a half-height would be enough for high boats to pass. And thus it is slowing down the road vehicles: screen93

There is a workaround, but not easy for newbies to make up. Raise at leas one end of the road one level up and then build the bridge: screen94

What I wanted to build would look like this. But that required raising the channel, building a low bridge and lowering the channel again: screen95

It would be nice if building with ctrl would check the needed clearance and build only low (or even flat) bridge if it would be high enough. Or maybe there already is some hidden way how to enforce low bridge to be built?

Offline ACarlotti

  • *
  • Posts: 483
Re: How to enforce bridge with high, low, or no ramp?
« Reply #8 on: July 28, 2019, 09:12:02 PM »
This has been previously discussed here.

Offline Vladki

  • Devotee
  • *
  • Posts: 3659
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: How to enforce bridge with high, low, or no ramp?
« Reply #9 on: July 28, 2019, 09:25:33 PM »
Oh, yes. And I think your proposed solution is good:
Quote
I think the improved behaviour here would be to have Ctrl build a bridge that is one level higher than would be built without pressing Ctrl (if that is possible). Does that sound right?

Offline Matthew

  • *
  • Posts: 530
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: How to enforce bridge with high, low, or no ramp?
« Reply #10 on: July 29, 2019, 04:44:12 PM »
The proposed solution also seems a good idea to me.

Offline Vladki

  • Devotee
  • *
  • Posts: 3659
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: How to enforce bridge with high, low, or no ramp?
« Reply #11 on: July 29, 2019, 05:15:15 PM »
Maybe it should be the other way around. Default to high clearance (or the one specified in simuconf.tab as need) as if building over other players road, and use ctrl for lower bridge.

Offline Elemental

  • *
  • Posts: 17
  • Languages: EN, DE
Re: How to enforce bridge with high, low, or no ramp?
« Reply #12 on: August 01, 2019, 02:02:16 PM »
Maybe only force high bridges if the pakset contains a vehicle for whatever type of way you are bridging over that actually requires the heigth. For example, barge, narrowboat and tubboat canals in the british pakset only have low height barges anyway.

Offline ACarlotti

  • *
  • Posts: 483
Re: How to enforce bridge with high, low, or no ramp?
« Reply #13 on: August 01, 2019, 02:20:51 PM »
Maybe it should be the other way around. Default to high clearance (or the one specified in simuconf.tab as need) as if building over other players road, and use ctrl for lower bridge.
This would create inconsistencies in the case where you're bridging over empty land that you might put a road along later. If the road isn't there, then I think the bridge should default to low. If there were a road there, I think it should still default to low.

Offline Vladki

  • Devotee
  • *
  • Posts: 3659
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: How to enforce bridge with high, low, or no ramp?
« Reply #14 on: August 01, 2019, 02:26:54 PM »
I disagree. Imho more consistent (and beginner friendly) is to build always high bridge, regardless of what is underneath. And as advanced feature with ctrl build low bridge if permitted.

Offline Ranran

  • Devotee
  • *
  • Posts: 1432
  • Languages: ja
Re: How to enforce bridge with high, low, or no ramp?
« Reply #15 on: August 01, 2019, 02:54:00 PM »
Building a low bridge will disturb the tiles below. So usually you can not build a low bridge over the tiles owned by others.
When the lower tile is empty and the lower bridge is built there, it seems like a kind of cheating if the lower tile is not purchased by the bridge owner at the same time.
Therefore I support the idea of Vladki.