The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: Philip on September 18, 2014, 10:41:42 PM

Title: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: Philip on September 18, 2014, 10:41:42 PM
A while back, I worked on some of the bridge builder code, and in the discussion, Leartin (http://forum.simutrans.com/index.php?topic=13892.msg137903#msg137903) and DrSuperGood suggested allowing bridges to be built a bit more flexibly. I'd implemented that, but had neglected to actually attach a patch, so I've gone back to it now and ported the code to Experimental.

The first thing the patch does is to default to building the lowest possible bridge that does the job, rather than defaulting to a full-height bridge. Here "does the job" means that the bridge does respect clearance over other ways, but if there are no other ways or the way clearance height is set to half-height, a low bridge will be built. (Unfortunately, it seems that pak128.Britain-Experimental is lacking some graphics for half-height bridges, or maybe I'm using an outdated version).

The second thing is to allow bridges that don't have ramps or slopes—right now, it's okay for a bridge to have a ramp or a slope at one end but not the other, but it isn't okay for both ends to connect to vertical walls or elevated ways. In addition, connecting to a vertical wall that is followed immediately by a tunnel entrance is allowed with this patch.

The code is at https://github.com/pipcet/simutrans-experimental/compare/jamespetts:way-improvements...low-bridges?expand=1

I'm not actually sure this is a great idea, but it does make bridges a bit more consistent. I can isolate the code for low bridges from the rest of the code, if desired.
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: jamespetts on September 18, 2014, 10:51:38 PM
Very interesting - thank you. If you don't mind, I should be interested to gather the views of other players before implementing this to see whether there are any unintended drawbacks. One possible issue that I can see is in relation to building a half-height bridge by default on flat terrain where there are no ways to cross: if one were to build the bridge first and then intend to build ways beneath it shortly afterwards, this would be a bad idea, I think; or have I misunderstood what was intended here?

Thank you again for working on this.
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: Philip on September 19, 2014, 01:37:26 AM
Quote from: jamespetts on September 18, 2014, 10:51:38 PM
Very interesting - thank you. If you don't mind, I should be interested to gather the views of other players before implementing this to see whether there are any unintended drawbacks. One possible issue that I can see is in relation to building a half-height bridge by default on flat terrain where there are no ways to cross: if one were to build the bridge first and then intend to build ways beneath it shortly afterwards, this would be a bad idea, I think; or have I misunderstood what was intended here?

Indeed, that would be a failure scenario; you'd either have to construct the bridge with the control key held (I've gone back and forth trying to decide whether low bridges or high bridges should be the default; the current decision to make the default low bridges is so testers would actually notice something has changed) or demolish the bridge and reconstruct it, very expensively.

There's also the slight problem that there are actually three different heights for bridges crossing a simple trench: level with the top of the vertical walls, one half-height above it, or one full-height above it. However, I think usually way construction will happen in the right order for things to work out without ever having to use the control key.
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: Junna on September 19, 2014, 04:34:36 AM
Bridges between elevated ways is something I've always thought missing at least, so that is most certainly very nifty.

Quote from: Philip on September 18, 2014, 10:41:42 PM
(Unfortunately, it seems that pak128.Britain-Experimental is lacking some graphics for half-height bridges, or maybe I'm using an outdated version).

I think James has not transferred over some of the stuff from standard yet as I remember I had to manually update the bridges and the latest industries for my own compile of pak.britan experimental from standard sources (caused a few cock-ups in the process but I sorted it in the end I think).
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: waerth on September 19, 2014, 09:22:29 PM
Like the patch :)
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: jamespetts on September 19, 2014, 09:41:44 PM
Quote from: Junna on September 19, 2014, 04:34:36 AM
Bridges between elevated ways is something I've always thought missing at least, so that is most certainly very nifty.

I think James has not transferred over some of the stuff from standard yet as I remember I had to manually update the bridges and the latest industries for my own compile of pak.britan experimental from standard sources (caused a few cock-ups in the process but I sorted it in the end I think).

Yes, this is correct: there is something of a queue of updating from the Standard branch of the pakset.
Title: Re: [PATCH] low bridges, "trench" bridges, bridges between elevated ways
Post by: jamespetts on December 20, 2014, 01:33:03 PM
Given that this approach seems to have found approval in Standard, I have now incorporated this into the way-improvements branch in Experimental. I should like feedback, however, as to whether to have full height or half-height bridges built by default given the difficulty that I discussed above about building bridges and then building ways under them.