## News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

## [11.8] Bridges over buildings

Started by MCollett, August 23, 2013, 02:36:38 AM

0 Members and 1 Guest are viewing this topic.

#### MCollett

In 11.8,
QuoteCHANGE: Bridges follow the same rules as elevated ways about the maximum permissible level of buildings beneath them.
This seems to ignore one of the key differences between elevated ways and bridges, namely that elevated ways are always only one level higher than what is beneath them, while a bridge can be any number of levels above.   I'm not convinced that a bridge over a deep valley should worry about buildings on the valley floor (especially given the various scale discrepancies there are).  To take an extreme case, you could build quite a respectable skyscraper under the Europabrücke.

Less importantly, will this only affect new construction, or will existing bridges built in earlier versions be broken if loaded into 11.8?

Best wishes,
Matthew

#### jamespetts

Firstly to answer your latter question: this will only affect new construction. Existing bridges will remain in place and continue to be usable.

As to height relationships, this is an interesting and complex area. There is no parameter for the height of a building - only its level. Currently, all buildings of greater than level 2 (this number is configurable in the pakset) cannot be under (newly built) bridges or elevated ways. We cannot simply exclude bridges from this calculation, as that enables players to replace straight sections of elevated ways with identical bridges to bypass the limit - something that was actually happening in the online game. That resulted in bridges being built through the middle of tower blocks.

The only way of solving this is to have some precise relationship between the height of a bridge and the permissible level of building. The difficulty is what that relationship should be, especially in view of the absence of relationship between level and height. One should also bear in mind that bridges with pillars or other ground supports would get in the way of not only tall but also wide buildings, or buildings requiring substantial foundations beneath them, too.

How many real world examples are there of large structures being built beneath bridges?

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

#### MCollett

Quote from: jamespetts on August 23, 2013, 09:45:46 AM
Currently, all buildings of greater than level 2 (this number is configurable in the pakset) cannot be under (newly built) bridges or elevated ways. We cannot simply exclude bridges from this calculation, as that enables players to replace straight sections of elevated ways with identical bridges to bypass the limit
Only at one end, since at present a bridge has to rest on the ground (level or sloped) at one end, and cannot be built from elevated way to elevated way.  But even so, I agree it shouldn't be possible.
QuoteThe only way of solving this is to have some precise relationship between the height of a bridge and the permissible level of building. The difficulty is what that relationship should be, especially in view of the absence of relationship between level and height.
I would suggest that the restriction simply not apply if the ground level of the building is two or more height levels below the bridge.

Best wishes,
Matthew

#### kierongreen

Or have buildings define a height parameter.

#### Carl

One irritating (and presumably unintended) side effect of this change is that it's often now not possible to build road bridges which cross rail stations. (Presumably this occurs with station buildings/platforms which exceed a certain 'level').

A serious issue with this behaviour is that it is inconsistent. When you try to build a bridge over a station, you receive an error. But if you delete the station, then build the bridge over the track, you can then go back and re-build the station underneath the bridge. This seems silly. If I'm able to build the station underneath the bridge, I should be able to build the bridge over the station.

#### jamespetts

#5
Two levels would not be sufficient. See the attached screenshot: the difference in height here between the bridge deck (level 3) and the base of both buildings (level -1) is 4. Both buildings, incidentally, are identical: the one under the bridge is clipped because that is how the graphics code handles this situation.

As to defining height in the buildings' .dat files, that is one idea - but (1) what would be the units; and (2) what would be the default?

Edit: For the time being, I have disabled the building/bridge check for station/stop buildings to deal with the problem identified by Carl (on the 11.x branch).

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

#### waerth

Ahhhhhhhhhhhhhhhhh now I know why I can never build bridges over stations anymore :p ....... and have to go back later to build the station. Hadn't reported it as a bug yet, because I felt it was part of the game. It has been since the start of the 11.xx

#### Leartin

Wouldn't it be enough to read the height by the number of z dimension of the picture? After all, each point of z dimension should be as much as two height levels - not ideal, because you never know how much content the top picture has (maybe just the top of a flagtower or a bit of smoke) but it would be first step. Maybe additionally just an additional indicator how much of the top picture is in use measured from the top from 0 (all the way up, standard if nothing else stated) to 4 (nothing there, just clip it and build anyway) - 4 of course with half heights in mind.

#### kierongreen

Height would just be measured in terms of z. So if we are at 0 with a building with height 4 then the lowest height a bridge could be built over would be 4.

#### Sarlock

Measuring the image height in the Y direction could be a quick way to approximate this and would probably work for 95% of the building graphics.

A pakset could have a field to state how many pixels high one elevation represents (probably in the 10-20 pixel range) and then the game can look at a building graphic and see what the highest Y pixel is in the image and if it will fit underneath that elevated way graphic.  If it's just a bit too high still, it will clip like in the image above and won't matter if it's "close enough".  Images that have a dramatic elevation change between the front of the tile and the back wouldn't work as well but most buildings would work this way.  Certainly a lot easier than setting a "height" parameter for every single building.

If we look at the example above, this would work perfect for this building.  The roof access is a bit higher graphically than the back corner of the building but if that little roof access is clipped off under the bridge no one will care.  You could leave a few pixels extra gap in the calculation too: if the pakset limit is 15, cut off buildings that are 12 pixels high or something.
Current projects: Pak128 Trees, blender graphics

#### MCollett

Quote from: jamespetts on August 23, 2013, 06:09:39 PM
Two levels would not be sufficient. See the attached screenshot

Yes, but that's a purely cosmetic issue, caused by scale inconsistencies.

Best wishes,
Matthew

#### isidoro

Quote from: Leartin on August 23, 2013, 07:37:29 PM
Wouldn't it be enough to read the height by the number of z dimension of the picture?
[...]

I worked on a patch just for that time ago (before my computer broke down and lost it) since it was in the TODO list of Standard.  It didn't seem very difficult to me up to the point I was able to reach.  If I recall it correctly, there was a bridge builder object and a method that checked tile by tile in the span of the bridge if it could be built.  The only thing to do was to add a supplementary condition to see how many images the building underneath had in that tile and act accordingly...

#### sdog

Quote from: MCollett on August 23, 2013, 02:36:38 AM
To take an extreme case, you could build quite a respectable skyscraper under the Europabrücke.

While it would fit, i highly doubt one would get a building permit. If there is good land for such a large construction under the bridge, it is also very likely the bridge has some type of support. I doubt anyone would risk interfering with the static stability of a bridge's pillar by digging the foundations for a high rise.

Examples to be found* on the net suggest two types: elevated ways spann over small to mid-sized buildings; small (often historically significant) buildings under parts of major bridges. The latter suggests when building a massive bridge project, one sooner knocks down anything in the way, unless it so important that such is not possible.

* i found only two large structures under buildings they are in Quebec and China respectively. A bridge building at pont jacques cartier which supports the bridge itself. A 6 story house that was in the way for a bridge in china, with the bridge just being built over it.

#### Sarlock

Seems to me that there would be serious safety concerns with building a bridge over existing buildings (Bridge decks have been known to collapse during construction).  It would also impede access to the bridge deck during construction.  I find lots of examples of parking lots, parks and light industrial areas (no buildings, or maybe a portable structure or two and some shipping containers) but very few examples of actual buildings being located beneath a bridge deck.

Current projects: Pak128 Trees, blender graphics

#### ӔO

although not strictly a bridge, elevated ways can sometimes have shops or storage units underneath.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

#### pwhk

#15
As a side note, in fact in real world there are road bridges that go through buildings

http://en.wikipedia.org/wiki/Gate_Tower_Building

http://goo.gl/maps/tigBE

Of course, simulating this would be non-trivial (and these are rare in real world too) and definitely require some artwork.

#### greenling

Hello all
I can me rember that in Japan in the city tokjo gives railway lines there standing small houses under it.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!