Author Topic: Multiple Tiles Inner City Building  (Read 1288 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

Multiple Tiles Inner City Building
« on: August 07, 2017, 02:38:16 PM »
I know that this topic was denied some years ago, but this feature is desired for a long time. I believe that this can be possible, and it must be done.
So I'm planning to make a proof of concept, but I'd like to discuss about cityrules before starting implementation.

To make things simple, let's put roads aside. Current cityrules supports only 1x1 buildings. We have to define cityrules for multiple tile buildings. In the case of multiple tiles building, cityrules should be applied not only when putting a new building, but also when replacing the existing by a multiple tile building.

The simplest way for coders is to define cityrules for all types of building, 1x1, 1x2, 1x3, 2x1, 2x2, 2x3,... but this is unrealistic because the amount of cityrules becomes so huge. So I made an idea that can reduce the amount of definition.


It will be fine if we define cityrules like this. Before starting construction of renovation, "P" tiles must be nature or a building. "P" tiles can be modified in construction and renovation. In this example, 1x1, 1x2, 2x1, or 2x2 building can be placed. The center of definition must be the left top of buildings.

Offline Leartin

  • Devotee
  • *
  • Posts: 796
  • Total likes: 287
  • Helpful: 44
  • !!!!!This user was banned for double posting!!!!!
  • Languages: DE, EN
Re: Multiple Tiles Inner City Building
« Reply #1 on: August 07, 2017, 03:38:24 PM »
I can't remember multitile citybuildings ever being denied. It's just that nobody with the skills had the time and put in the effort.

Personally, I have two issues with your suggestion already.
Say I have 1*2 buildings and 2*2 buildings. With my 1*2 buildings, they are designed to face the road on the short end. If I were to use your example grid, I would only want it to spawn horizontally, not vertically. However, I cannot remove the lower two "p", since otherwise 2x2 buildings could not spawn. Same is true for larger buildings, though 3*3 is probably as far as anyone should go anyway.

Perhaps a differentiation would help. Such that, say, if it's four "P", this specific cityrule only applies to 2*2 buildings, but if it's four "p", it would apply to any kind of building that would fit in. With mix&match (obviously, if you stay with your "top left" idea, the top left would always be P) As such, you would do
Code: [Select]
sssss
ts...
tsPP.
.spp.
.s...
And it would only apply to horizontal 1*2 or 2*2. Or some weird-shaped 3-tile-buildings (this approach does not forbid them, and factories or curiosities can have weird shapes, so why not?)

My second issue is more of a question - how would you go about building levels? First of all - if a 2*2 had the same level as a 1*1, would it have the same amount of pak, the same amount of pax/tile (like cur - act as individual buildings) or four times the amount of the 1*1 (same as before, but having any part in station coverage counts)
If you have an empty spot surrounden by highrise, and a new building would appear on that empty spot, but instead, it becomes a multitile building - how will the levels of other buildings affect the level of the new building? Generally speaking, one would not tear down a skyscraper unless the new building is at least as high/offers as much space. So the new building would need to be equal to the old one.



Offline THLeaderH

Re: Multiple Tiles Inner City Building
« Reply #2 on: August 08, 2017, 03:10:47 AM »
I like Leartin's P and p idea. I think this works fine.

When constructing a multiple tile building, the level should be divided per a tile. Calculation should be done based on the level of each tile.

Offline Leartin

  • Devotee
  • *
  • Posts: 796
  • Total likes: 287
  • Helpful: 44
  • !!!!!This user was banned for double posting!!!!!
  • Languages: DE, EN
Re: Multiple Tiles Inner City Building
« Reply #3 on: August 08, 2017, 07:22:03 AM »
But would you really get rid of a 100-store-building to get a 25-store-building over a larger area?
Btw. your screen shows another problem - the lower left corner of the new 2*3 building belongs to a 2*2 building. Can existing buildings be ripped apart like that? What happens to the other 3 tiles that belonged to that building?



I'd like to suggest a slightly different approach in line with this suggestion about land-dedication.
Essentially: Instead of using the rules at the point in time when a building needs to be buildt, do that beforehand (perhaps even using a different core) and dedicate land. With this, you get a situation much like in simcity and similar games, and can build the buildings pretty much in the same way. Cityrules would not need to handle multitile buildings directly, and instead focus on the general city layout. Incidentially, if Player-AI-scripts would be allowed access to land-dedication-tools, it would open up a lot of possibilities for custom-written city-layout-code as well, as a sort-of replacement to the cityrules format.


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: Multiple Tiles Inner City Building
« Reply #4 on: August 08, 2017, 10:13:41 AM »
The practical problem is more on map generation. Towns are grown using the timeline during map generation. With even more freedom on city rules, that long time becomes even longer.

The building levels are per tile. hence a 2x2 building would generate the same pax as four 1x1 buildings at the same level.

But some questions remains:
How to choose what building size to look for? Currently only for new buildings the buildings can be chosen freely. For renovation the balance would be utterly destroyed, of one has to replace three different (com, ind, res) building by a 2x1 building.

A straightforward implementation might be selecting a building (res,com,ind) and then only use the maching nxm size city rules for that building. The rules then can enforce a long side is near a road. Upon renovation only buildings with same size can be replaced.

Using more than one set of city rules is probably making thing more simple and faster, instead of trying to cover everything with one rule.

But of course, also Leartins proposal works. But I worry that single tile buildings are much easier to match in a random cityrule, that with only one rule set only single tile buildings will spawn.

Offline Leartin

  • Devotee
  • *
  • Posts: 796
  • Total likes: 287
  • Helpful: 44
  • !!!!!This user was banned for double posting!!!!!
  • Languages: DE, EN
Re: Multiple Tiles Inner City Building
« Reply #5 on: August 08, 2017, 11:44:48 AM »
The practical problem is more on map generation. Towns are grown using the timeline during map generation. With even more freedom on city rules, that long time becomes even longer.

Wouldn't it be smart if during map generation, only townhalls were placed, and the city only actually forms once the game started? While generating and playing at the same time would take longer, players would notice it less, since they are still able to interact with the map, checking out industry/city placement, set their name and player color, perhaps even build their first coal line. I could imagine that I'd create a new map with just one large city just to see it unfold - much like a city where you keep adding inhabitants via the editor. And if you want to start out with city traffic, you just need to pause* the game for a while until city generation kept up.

*) I think currently, pause stops the computer from doing anything, while the player can still build things. It might be nice if the computer could still do stuff just like the player can, and 'pause' just means that vehicles won't move and time won't pass. Just like players use pause to think about how they build something, the computer could do the same, since it has open resources it does not currently need to figure out what happens in the next tick. An additional stop button might stop everything completely.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4806
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: Multiple Tiles Inner City Building
« Reply #6 on: August 08, 2017, 01:08:47 PM »
That depends on how feasible it is to have towns generate using a different timeline until they catch up. Otherwise, you would be playing under the same fast-forward timeline used to grow the cities.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Multiple Tiles Inner City Building
« Reply #7 on: August 09, 2017, 08:26:51 AM »
My idea about automatic placement of multi-tile city buildings is the following: Build multi-tile buildings only when upgrading smaller buildings. Check if all affected tiles already have a small building, then build the multi-tile building as upgrade of smaller ones.

Then one does not need to think about city rules etc.
Parsley, sage, rosemary, and maggikraut.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: Multiple Tiles Inner City Building
« Reply #8 on: August 11, 2017, 02:52:36 AM »
That sounds very elegant, but I am not sure how to handle very different levels of the replaced buildings. Also somehow it must be avoided that in larger cityies are dominated by similar multitile buildings with just a different "placeholder" in between. I.e. somehow the multitile buildings should not be a oneway direction.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15687
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multiple Tiles Inner City Building
« Reply #9 on: August 13, 2017, 01:31:48 PM »
This would be a very worthwhile thing to achieve: this has been on the to do list for Extended for some years (together with a land value simulation, local transport based town growth, and full integration of the industry and attraction building into the city building code so that city based industries and attractions are built in exactly the same way as city buildings). The latter part of that at least might very well be worth considering for Standard if this were to be implemented, as it would mean that new attractions and industries would not be confined to being built on the outskirts of towns.
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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4806
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: Multiple Tiles Inner City Building
« Reply #10 on: August 13, 2017, 02:01:02 PM »
[...]full integration of the industry and attraction building into the city building code so that city based industries and attractions are built in exactly the same way as city buildings[...] [T]hat at least might very well be worth considering for Standard if this were to be implemented, as it would mean that new attractions and industries would not be confined to being built on the outskirts of towns.

I don't care for multi-tile buildings in general, because few buildings are that large in real-life (compared to the catchment area of stops). Some building complexes are, but they even have internal public roads, and maybe even a mix of building types, which goes beyond what is discussed here. However, this idea with attractions is somewhat interesting. Some of the city attractions in pak64, such as the old school and old town hall, should really have existed before they became attractions. Basically, what was once just a building should suddenly become an attraction once there were few enough left of them on the map.

Offline Leartin

  • Devotee
  • *
  • Posts: 796
  • Total likes: 287
  • Helpful: 44
  • !!!!!This user was banned for double posting!!!!!
  • Languages: DE, EN
Re: Multiple Tiles Inner City Building
« Reply #11 on: August 14, 2017, 11:28:50 AM »
My idea about automatic placement of multi-tile city buildings is the following: Build multi-tile buildings only when upgrading smaller buildings. Check if all affected tiles already have a small building, then build the multi-tile building as upgrade of smaller ones.

Then one does not need to think about city rules etc.

One would still need to think about city rules. Current rules tend to only allow buildings next to roads, even if spawning one tile further from the road is enabled, it usually has a way lower rate. But if there are no buildings in second row, multi-tile buildings would not be able to spawn by combining existing buildings.

I'd also think that multi-tile buildings might not be a rare addition to the single-tile buildings we have, but rather a replacement. New paksets might try to have cityrules that aim for much larger city blocks and use a higher station coverage, with those blocks being filled by mostly 3x3 or 2x2 building, smaller buildings just for tight places to have something there. Such a thing would not be possible if it's just updating existing buildings. [Unless the pakset has level-zero-one-tile-buildings that represent a lot designated for building on... But that would be a pakset-side implementation of land-dedication I guess.]

Some of the city attractions in pak64, such as the old school and old town hall, should really have existed before they became attractions. Basically, what was once just a building should suddenly become an attraction once there were few enough left of them on the map.
That would certainly be possible for an old town hall if a new one is buildt somewhere else. But for everything else, it does not seem like a good idea. I wrote some more about it in a seperate thread, since it has nothing to do with multitile buildings. --> http://forum.simutrans.com/index.php?topic=17304


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: Multiple Tiles Inner City Building
« Reply #12 on: August 19, 2017, 02:58:23 PM »
The cityrules does not force building next to a road. It is very easy to add a rule to fill holes or inner rows.

Offline Leartin

  • Devotee
  • *
  • Posts: 796
  • Total likes: 287
  • Helpful: 44
  • !!!!!This user was banned for double posting!!!!!
  • Languages: DE, EN
Re: Multiple Tiles Inner City Building
« Reply #13 on: August 19, 2017, 04:44:08 PM »
The cityrules does not force building next to a road. It is very easy to add a rule to fill holes or inner rows.

Sure, as I said...
Current rules tend to only allow buildings next to roads, even if spawning one tile further from the road is enabled, it usually has a way lower rate.
Plus, there is a reason why they are usually not covered by the cityrules - because nobody want's them to exist as single buildings.

Offline kierongreen

Re: Multiple Tiles Inner City Building
« Reply #14 on: August 21, 2017, 09:58:53 PM »
It's something that's been on my personal Todo list for years now but these days don't really have time for any serious coding :( absolutely hope that the same code can be used in Standard and Extended though.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15687
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multiple Tiles Inner City Building
« Reply #15 on: August 21, 2017, 11:47:09 PM »
It's something that's been on my personal Todo list for years now but these days don't really have time for any serious coding :( absolutely hope that the same code can be used in Standard and Extended though.

It will take me quite a while to get around to town growth, I expect, so if it is implemented in Standard before then, it should be able to be the same, so long as the implementation in Standard is compatible with what I seek to do with local growth for towns and fully assimilating the system for building town based industries and attractions with the system for building city buildings.
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.