News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Multi-tile city buildings

Started by jamespetts, August 10, 2013, 09:11:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I have recently been working on code in the Passenger generation Github branch on Experimental changing the way in which passengers are supplied to attractions: instead of each attraction tile being counted as a separate building, now the entire attraction is now a building in itself, and any stop or road connecting to any tile of the attraction connects the whole attraction to that stop or road.

It seems to me that this removes the major impediment to having multi-tile city buildings, which I know has been considered desirable for a while. What I should like to know, however, is what else besides passenger generation will need to change if multi-tile city buildings are to be permitted. I could not see anything in the building reading/writing code, but I wonder whether the code for building city buildings in the first place and the code for renovating them would need to change to allow this to work.

Any assistance from those who know those parts of the code would be much appreciated.
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.

prissi

The biggest problem are the city building rules. This is the only problem with multi tile buildings. All other stuff is trivial.

You would need a set of city building rules for 1x1, another for 1x2 another for l shapes with roations, and so on. That is the really non-trivial part.

One could allow for 2x2 buildings only of 2x2 city rules are present. Otherwise such buildings must be ignored. Same for 2x1 and 1x2.

Also renovation of a 1x1 building into a 2x2 building will change the city quite a lot. Thus rather 1x1 and 2x2 buildings stay 2x2 and 1x1

jamespetts

Ahh, I see. That is more of a challenge. How does the code for building multi-tile attraction buildings in a city fit in with this?
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.

kierongreen

They are built on the outskirts of cities generally then never renovated...

isidoro

I don't know the relevant code, but could it be done in the renewal phase or in manual construction only?

I mean, whenever ST is zoning, it applies 1x1 city building rules, just as it is done now.  But, when it renews/upgrades buildings, it could look the neighboring tiles to see if it can join them to form a larger building: 2x1, 2x2...

Dwachs

Quote from: isidoro on August 12, 2013, 11:39:00 PM
I don't know the relevant code, but could it be done in the renewal phase or in manual construction only?

I mean, whenever ST is zoning, it applies 1x1 city building rules, just as it is done now.  But, when it renews/upgrades buildings, it could look the neighboring tiles to see if it can join them to form a larger building: 2x1, 2x2...
This should be the easiest way to implement it. You do not have to worry about slopes etc, as renewed buildings are already on flat land.
Parsley, sage, rosemary, and maggikraut.

Sarlock

You'd still have to look at slopes as adjacent buildings may be on a different level... but yes, doing it on the renovation stage seems best, look at adjacent tiles for similar heights and then renovate 4 buildings to make 1 new one.

This will require a lot more pakset images, however... but will open the door to a lot of really nice looking buildings.  I'd love to move to a rendered system like SC4 where buildings are drawn from assembled components (it would reduce image load a lot but increase graphical performance requirements)... but I'll keep dreaming  ;)
Current projects: Pak128 Trees, blender graphics

jamespetts

One could, in addition to what Isidoro suggests, also allow new multi-tile city buildings to be built in the same way as existing attractions (i.e., greenfield land on the edges of towns). One of the more difficult questions, I suppose, will become what happens when a building wants to renovate itself to become a multi-tile building and some of its neighbours from which it wishes to take tiles are already multi-tile buildings. I can see things getting complicated there.
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.

waerth

It would be nice if attractions could be build inside cities as well instead of just the outskirts. Also some attractions need to spawn more than one (like schools, libraries). I am totally in favour og multitile buildings and would think it need if they could spawn over 1x1.

You could make a rule like:

if 1x1 then possible 1x2, 2x1, 2x2, 2x3
if 2x1 then 2x1, 2x2 etc

so they cannot degrade again.

Sarlock

It can be as complicated as we want to make it.  I think the code for placing the multi-tile buildings can be fairly selective on what conditions there has to be to build such a building and there will still be plenty of opportunities in a larger city (10x10+) to find these buildings being built.

If the game wants to place a 2x2 building, it has to have 4 existing buildings already built in a square.  Then it just replaces those 4 with the 2x2 building.  This way we're still using the existing cityrules.tab scripts for building and road placement.

If you're planning on introducing this, I'd just start it simple and very restrictive to the perfect conditions.  The logic can always be expanded upon later.
Current projects: Pak128 Trees, blender graphics

ӔO

I don't think there is a need for complicated L shaped buildings. Those can be 2x2 or 2x3 with a building painted in an L, but the extra space can be painted as a parking lot or park.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

jamespetts

Quote from: Sarlock on August 13, 2013, 05:41:38 PM
It can be as complicated as we want to make it.  I think the code for placing the multi-tile buildings can be fairly selective on what conditions there has to be to build such a building and there will still be plenty of opportunities in a larger city (10x10+) to find these buildings being built.

If the game wants to place a 2x2 building, it has to have 4 existing buildings already built in a square.  Then it just replaces those 4 with the 2x2 building.  This way we're still using the existing cityrules.tab scripts for building and road placement.

If you're planning on introducing this, I'd just start it simple and very restrictive to the perfect conditions.  The logic can always be expanded upon later.

One simple addition to this is to allow blank spaces as well as other buildings to be considered for some of the building's tiles.
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.

prissi

But then the replaced buildings needs to be in about the same level. Also once 2x2 (or L at a corner) it needs to be always this size. Or should the next renovation, when it hits the building, make again four 1x1 buildings?

Also the building scale in simutrans is anyway broken. A 1x1 tile is rather 4-9 buildings (more like in pak64.japan). As such 2x2 would be way too large, as they would fill a typical block (or generate boring cities). Finding a good balance looks tricky here.

jamespetts

Does the replaced building need to be at or near the same level as the building(s) that it is replacing? It is not entirely uncommon for buildings to be replaced by something much denser. As for the tile scale, is this not a matter for pakset authors? After all, if attractions can be multi-tile, there is no reason that city buildings should not also be able to be so, technical hurdles notwithstanding.
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.

kierongreen

Ah the pak scales issue crops up again. Way scale, vehicle scale and building scale will always conflict in simutrans unfortunately if a pakset has all three in proportion as ways will end up looking very wide....

Hence it's up to artists to decide what look to go for in a pak. In my opinion in pak128 and pak128.Britain the key advantage of allowing buildings greater than 1x1 would be to allow more open space. Houses could be 1x2 buildings with gardens, large tower blocks would be 2x2 with open ground around a central building. Only in town centres would every tile actually be graphically occupied by a building. Certainly on my list of things to add someday to simutrans if no one else gets there first...

vorlon

Quote from: prissi
Also the building scale in simutrans is anyway broken. A 1x1 tile is rather 4-9 buildings (more like in pak64.japan). As such 2x2 would be way too large, as they would fill a typical block (or generate boring cities). Finding a good balance looks tricky here.
It depends on what scale is pursued. I think an average simutrans city block of 2x3 tiles is very small, as it creates cities which have more land spent for streets than buildings. I know many don't like comparison beetween simutrans and simcity, but just take a look at any simcity city and you'll se bigger buildings and blocks and the effect it has on realistic city-look.

Therefore making the cities more realistic requires bigger buildings with streets further away from each other. I think a better standard block size could be 3-4x5 tiles. The tiles not next to road would then be filled by multi-tile buildings. Or perhaps by special buildings (backyards, parking areas) that were coded to spawn at constructed city area without road access to avoid the problems of multi-tile city buildings.

jamespetts

#16
Vorlon makes a good point about the relationship between the size of the roads and the size of the buildings, I think.

Edit: One other salient point about improving the ability to build multi-tile buildings in a city centre: this should allow end-consumer industries (in other words, shops) to be built in the centre of a city more easily in the same way as city buildings themselves. It makes no sense for these "industries" (shops) to appear only on the outskirts. They should be able to be built by replacing existing city buildings if appropriate.
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.

Sarlock

Excellent discussion and some good progress being made on the possible logic.

pakset scale is up to the pak artist(s) to decide.  Having larger building sizes allows artists a lot more flexibility in how to make their cities look.  As kieron says, it allows a lot more open space to be included with all levels of buildings.  With the scales used by most paksets, higher density buildings fill most of the tile with a big square foundation.  A 2x2/2x3 building would allow for a nicely styled high-rise building with a non-square foundation and include some outdoor features (extended sidewalks, trees, awnings, etc).  I would probably re-draw quite a few of the taller pak128 buildings to fit on a larger base if this were to be implemented.  I would probably limit the height of single tile high-rises.  Perhaps an additional field in cityrules.tab can control how aggressively the game will attempt to evolve urban areas to multi-tile buildings... so that pakset authors can guide how the urban areas develop.

A side benefit, as james says, is being able to more easily place urban factories would be a huge benefit as well.  Urban freight delivery is an interesting (and for me, enjoyable) logistical challenge for the player.

I wouldn't allow a multi-tile building to reduce back to a group of single-tile buildings again.  This system would marry well to a previous discussion on city growth that looked at the concept of not increasing building sizes frequently to more naturally match "real" city evolution: an old building upgrades to a building, a building 5 years old doesn't get knocked down to make way for a new one.  Over a 100-200 year period, a given city tile may only change 3-5 times at most.  In an urban area, this evolution can be in large density increments (going from a single family dwelling to a high rise in 2-3 increments).
Current projects: Pak128 Trees, blender graphics

Carl

This is all very interesting. I can't speak to the technical details, but the possibilities opened up by multi-tile buildings are very promising.

The advent of multi-tile buildings would allow for paksets where the building/road/rail scales are roughly identical, if one wished. We could then have a distinction between paksets which are designed for simulation of small urban areas, and those which are designed for simulation of large geographical regions. I toyed around with the idea of a 20 metre-per-tile map of New York City a few months ago, but one major realism obstacle was that many buildings in NYC take up an entire city block of 80m x 80m, which requires 16 buildings to fill if one is only allowed single-tile buildings.

Presumably one could even make a 64-pixel pakset where the roads, rails and vehicles were ordinary 64-pixel graphics, but all the buildings were adapted from a 128-pixel pakset -- i.e. they were all at least 2x2 tiles. In one respect this would be like having pak.128 with double rails/roads on one tile...

Sarlock

Quote
Presumably one could even make a 64-pixel pakset where the roads, rails and vehicles were ordinary 64-pixel graphics, but all the buildings were adapted from a 128-pixel pakset -- i.e. they were all at least 2x2 tiles. In one respect this would be like having pak.128 with double rails/roads on one tile...

I have given thought to that very idea for a (close to) scale model city that I am working on.  Build it in pak64 size but all of the buildings are still pak128 buildings but represented as 2x2 attractions instead of regular city buildings.  But the sheer act of placing that many buildings manually would be onerous and I shelved the idea.  For now at least  ;)  It would look amazing, though!
Current projects: Pak128 Trees, blender graphics

kierongreen

QuoteThe advent of multi-tile buildings would allow for paksets where the building/road/rail scales are roughly identical, if one wished.
Unfortunately while roads and railways might be in scale to buildings the vehicles on them would not. If you take a road and railways as being 10m wide then getting a 20+m railway vehicle to scale will be impossible. Let alone ferries.

Carl

Right, that's what I meant by "roughly" identical, though what I should have said is that the scales would be closer to one another than they are now. :)

kierongreen

Ah but is it better that ways and buildings are at the same scale, or that ways and vehicles are at the same scale...

jamespetts

One other thing to add here: although, normally, multi-tile city buildings should not be downgradable to single tile (or smaller multi-tile) buildings, if Neroden's very sensible proposal concerning building abandonment were implemented, that rule should be disapplied to abandoned buildings or those with very low occupancy.
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.

isidoro

In that case, an easier solution could be to blow away the entire building, leaving those tiles empty, and let the city rebuild there with the usual rules.

jamespetts

Presumably, the demolition would only happen when somebody wanted to build on at least one of the tiles?
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.

kierongreen

Or it could happen of it's own accord once a building becomes that underutilised. After all - semi derelict buildings often have a lack of maintenance, or burn down and so on. If the city has spare capacity in other buildings then the remaining occupants could be moved to those...