News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Allowing elevated ways to be built over buildings (again) in pak128.britain

Started by neroden, May 27, 2024, 04:53:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

This is currently disabled.  It's irritating because in reality there frequently are buildings under elevated ways, including arches.

There is also existing code for this.  The code seems to cue off of "level", and prohibit building over buildings of sufficiently high "level" (which is set to 0 in the pak, irritatingly enough).  OK.  We can turn the setting to allow for building over buildings of, say, level 8 or less. 

But -- to avoid graphical issues and to look more realistic -- what I was thinking we should do is to actually look at the *height*, since we have dimensions for each building, and insist on having enough *height* to build over the building.  We aren't using the z value in dims for anything right now.  Most of the buildings are just generically set at height 4 right now; we'd probably want to make a bunch of the short ones shorter to allow reasonable constructions. 

(The "level" thing could still be used to prohibit building over "signature" buildings even if they're short, or a special no-overhead flag could be added.)

I can eliminate the inconsistencies in the code while I'm at it.  There are three different pieces of code here which need to be unified (building construction, pier construction, and "bridge" construction).

OK as a plan?

(I see that building elevated ways over buildings was disabled by James in Jan 2022 for no explained reason.)

jamespetts

Thank you for your thoughts on this. This was disabled intentionally, as, in the current implementation at least, it cannot work realistically. While it is true that there are often buildings built into railway arches, as in the below image:

Railway Arches by Sam Tait, on Flickr

one never sees, for example, a full sized house (even a bungalow) sitting underneath a railway arch, as it would not fit - yet, if we just allow building elevated ways over buildings, even those with a low level (as was the case until 2022), players just build railways through all but the densest part of towns by putting them on viaducts like the one pictured above, straight over people's houses, small offices and industrial buildings that in reality could never have a viaduct built over them. This made building railways (and canals) through towns unrealistically easy and gave entirely unrealistic results, which adversely affected the balance of the game and made nearly every town have extensive networks of elevated rail/canal and even grand elevated roads for elevated segregated trolleybus or tram systems, built entirely without regard for the buildings underneath so long as they were lower level buildings.

If we could have a realistic way of underneath-the-arches style buildings appearing in the right places, this would be a worthwhile addition, but that would take a great amount of work (including pakset work).

One change that I do want to make when I get time, however, is to allow stops (not extension buildings) to be built beneath elevated ways, as station platforms, 'bus stops, etc., can and often are built beneath urban viaducts.
Download Simutrans-Extended.

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

Follow Simutrans-Extended on Facebook.

neroden

Hmmmmm.  When I'm building over "hovels" and "shacks"... those often ARE under bridges.  I think that's what's been bugging me.

Maybe it should only be allowed over buildings which have a specific under_bridge_ok flag.  (Even then, only if the bridge is tall enough for the building height.)  This would enable substantial flexibility in the pakset, and comport with the reality that most people won't allow their houses to be under a bridge, but people living in hovels and improvised shacks absolutely will

jamespetts

Quote from: neroden on May 27, 2024, 03:35:37 PMHmmmmm.  When I'm building over "hovels" and "shacks"... those often ARE under bridges.  I think that's what's been bugging me.

Maybe it should only be allowed over buildings which have a specific under_bridge_ok flag.  (Even then, only if the bridge is tall enough for the building height.)  This would enable substantial flexibility in the pakset, and comport with the reality that most people won't allow their houses to be under a bridge, but people living in hovels and improvised shacks absolutely will
That might work, but I can't think of a lot of buildings that would allow this. Do we have any real life examples of the sort of hovels and shacks that we see in the game having a bridge built over them leaving them in situ? I am a little sceptical that this actually happened.
Download Simutrans-Extended.

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

Follow Simutrans-Extended on Facebook.

neroden

Quote from: jamespetts on May 27, 2024, 09:07:17 PMThat might work, but I can't think of a lot of buildings that would allow this. Do we have any real life examples of the sort of hovels and shacks that we see in the game having a bridge built over them leaving them in situ? I am a little sceptical that this actually happened.

At 128 dpi resolution, perhaps I do not have a solid image of what the sort of hovels and shacks we see in the game in 1750 are actually supposed to represent.  During the Great Depression you could find an awful lot of shacks under bridges.
Still happens elsewhere... https://groundup.org.za/article/fears-for-dunoon-bridge-as-people-dig-out-shelters/
I am *quite* sure that the "cow field" type of building (one of the industrial buildings in the game in 1750) can exist under a bridge.  I've definitely seen cows under a bridge.  Bridges are definitely built over expanses of fields with the cows continuing to graze underneath. 
Industrial buildings in general are much more willing to locate under bridges.  https://www.dreamstime.com/old-industrial-blocks-under-williamsburg-bridge-along-kent-avenue-brooklyn-side-east-river-brooklyn-ny-usa-may-old-image216462930
The Curious Case of the Lighting of the Williamsburg Bridge — NYC  Department of Records & Information Services

Thinking about it then -- this is definitely going to be a building-by-building thing, not a "level" thing. 
When I get a chance I will rewrite the code to look for a specific flag on buildings.  That makes the most sense in the long run.

jamespetts

Thank you for that. Buildings remaining under bridges/viaducts are definitely the exception rather than the norm. I note that the first two examples given are not, in fact, buildings remaining while bridges are built over them.

If this is to be in the code, I should think that the building would need to specify the height of the bridge above it: the building shown in the black and white picture above, for example, could not have fitted under the railway arches in my picture above - indeed, probably nothing other than a dedicated building could.

As to the cow fields, I must confess that I am not entirely sure what they are intended to represent - normally, cattle pastures are substantial fields in rural areas and should be represented as a farm based industrial building (which, in fact, they are: we have cattle fields as such in the pakset). Some of these early low density town buildings may need re-thinking when the town growth changes come to be implemented.
Download Simutrans-Extended.

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

Follow Simutrans-Extended on Facebook.