The International Simutrans Forum

 

Author Topic: Multi Tiles Inner City Building (MTICB)  (Read 2133 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Multi Tiles Inner City Building (MTICB)
« on: January 14, 2018, 07:29:19 AM »
Hello Jamespetts and everyone ;D
I made a patch that allows multi tiles inner city building.
In current simutrans, the size of city buildings is limited to 1x1. As a result, buildings in a highly flourishing city are too thin. They are like pencils. So, I made this patch to make the scene of cities more realistic.

The city buildings are distributed like this. Of course, they are not cur buildings!


size -- orange:1x1, blue:1x2, purple:2x2, green:2x3, yellow:3x3


The size of buildings that are newly built is still limited to 1x1. When renovating, multi tiles buildings become candidate. The newly constructed building is a small level 0 building, so I believe that the 1x1 limitation is not a problem. This limitation makes no change in cityrules.tab. When renovating, vacant ground and ground on which there is a building are used to place a new building.
There is no programmatic change in makeobj. Pak authors now can write other dimensions than 1x1 in the dat of city buildings! There is no side effect.

The testing of this patch is done with this addon set.
https://drive.google.com/open?id=15iPmxsLe7r_rOLfsBUrutwMhG5baQ2wY
This is minimum to conduct the test, so a building set that is well planned and that has more kind of multi tiles city buildings is needed to ensure the safety of this patch.
At present, this rule is not implemented for multi tiles city buildings and comment outed. Test addon set that I use now is not enough to write and test this rule.

If you use multi tiles inner city buildings well, it is possible to make a whole new realistic city sight in simutrans. It's pak authors who should think how to use this feature.

I made a pull request, so please review my code. Atom, the text editor I usually use, removed meaningless spaces in code. So I have to apologize that code difference became hard to understand.


~Discussion~
Under the elevated truck, the passenger level of the building is restricted, but should the height of the building be restricted?
https://github.com/teamhimeh/simutrans/blob/ex-MTICB/simcity.cc#L4412

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #1 on: January 14, 2018, 10:03:59 PM »
This is very interesting. I have briefly tested this on my the multi-tile-city-building branch (having put this test pak into the Swedish pakset as you appear to have done in the screenshot), and cannot immediately find any errors; however, testing this thoroughly is not straightforward when that pakset seems to have no commercial or industrial city buildings, and the supplied sample buildings are all residential (what I wanted to test was how this interacts with the passenger generation system; this should not be a problem, as  I think that I already did code for this, but I do want to be sure).

The tests also seem to show that there is no adverse effect when generating towns without multi-tile city buildings (I note that the prohibition on identical buildings being built next to each other has been disabled as you indicate).

One issue that my testing has demonstrated, however, which might need some further refinement of this model, is that multi-tile city buildings never seem to be renovated/redeveloped when a city expands. Testing with repeated city expansion using the public player expand city tool, the only buildings to be redeveloped were one tile buildings, leaving the original town centre with medium sized buildings, and only building the very large, yellow, buildings near the edges of the town as it grew. Not redeveloping multi-tile city buildings will be a big problem for paksets that have a long timeline, such as Pak128.Britain-Ex.

This feature has great potential to improve the quality of town generation considerably, however, so this is an excellent piece of work. One interesting prospect is that a lot of things that are currently coded as city attractions (e.g. the greenhouse) could be re-coded as commercial city buildings (alternatively, this code could be modified to allow the building of attractions and industries in the place of existing city buildings rather than at the edges of cities; that would actually be extremely useful for industries, which would allow for things like multi-tile department stores being built in the middle of towns).

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Multi Tiles Inner City Building (MTICB)
« Reply #2 on: January 16, 2018, 03:32:43 AM »
Interesting.... proof of concept is tricky bit so well done for that!

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #3 on: January 16, 2018, 04:32:08 AM »
Quote
testing this thoroughly is not straightforward when that pakset seems to have no commercial or industrial city buildings, and the supplied sample buildings are all residential (what I wanted to test was how this interacts with the passenger generation system; this should not be a problem, as  I think that I already did code for this, but I do want to be sure).

Thank you for having a deep interest on this patch. I added commercial and industrial city buildings in the test addon set. With that, the patch seems to work fine.
I also implemented the cluster rule for multi-tile buildings, but I'm not sure it is working fine because the number of buildings is still not enough to confirm that. (commit: https://github.com/teamhimeh/simutrans/commit/528f1ca12228dd32d76bc2530c86c460f60c229f)

Quote
One issue that my testing has demonstrated, however, which might need some further refinement of this model, is that multi-tile city buildings never seem to be renovated/redeveloped when a city expands.

I conducted a experiment and it showed that multi-tile city buildings are also renovated. However, the frequency of that is quite low. This is not so strange because there are many low level single-tile buildings in a city and these tend to be selected for renovation more frequently.
During the test, I found a problem in the calculation of population, and it is now fixed. All changes were committed on the git repository.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #4 on: January 18, 2018, 02:47:36 PM »
Should I give more renovation chances to multi-tile buildings?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #5 on: January 18, 2018, 09:41:09 PM »
Thank you very much for your work on this, and apologies for not being able to get to this sooner - I have had a number of other things to deal with. In answer to your last question, I think that increasing the renovation chances for multi-tile buildings would be sensible: I have still not managed to observe any renovation of multi-tile buildings, even when I constrain city borders artificially to stop the city from expanding (although this does make the town expansion very, very computationally expensive). We do need a higher chance of these multi-tile city buildings being renovated, or else the larger buildings will be (virtually) permanently stuck, which will unbalance town growth.

Thank you, incidentally, for fixing the bug relating to population: that is most helpful. As you might have read in other threads, the long-term plan is to abolish "bev" "arb" and "won" entirely and use the newer variables specific to Extended (population, jobs, visitor demand, etc.) for town growth purposes, but the old variables have been retained pending the rewrite of the town growth system.

Thank you again for your work on this - it is much appreciated.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #6 on: January 20, 2018, 02:51:28 PM »
I have to apologize that the phenomenon that the renovation of multi-tile buildings was quite rare was a bug. And I succeeded in fixing. Although I haven't implement the boost of the renovation chance for multi-tile buildings, this video shows that multi-tile buildings are well renovated. How do you feel about this?


All changes are pushed to my repository.

P.S. Is it a known problem that population becomes negative number in the city information window when the population is increased by "grow city tool"?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #7 on: January 20, 2018, 07:08:09 PM »
Thank you for that. I am having difficulties compiling this in Visual Studio, however. Specifically, the following line:

Code: [Select]
bool checked[size.x][size.y];

returns error C2131, "expression does not evaluate to a constant". I think that the trouble is that this line is attempting to create a 2 dimensional array, yet size.x and size.y are not constant values, so the system cannot know the amount of memory to allocate at compile time, as is necessary for an array. You will either need to use new/delete operators or just use nested collection classes.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #8 on: January 21, 2018, 10:22:10 AM »
Oops, that code could be compiled with gcc of Mac, so I couldn't notice that the code didn't follow C++ standard. I fixed the code, so please confirm that the code can be compiled with Visual Studio.
Also I fixed the bug that population became negative number when removing multi-tile city buildings.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #9 on: January 21, 2018, 01:48:01 PM »
Splendid, thank you very much for that. Testing confirms that the issue with multi-tile buildings not being renovated has now been fixed. I have now merged this with the master branch, and it should be available in the next nightly build.

Thank you very much for your work on this - it is much appreciated.

Incidentally, to answer your questions above that I forgot to answer before because I was concentrating on testing the patch: I think that the negative population issue has been reported as a bug, but I have not yet had time to look into it.

As to the issue of the level as against the height of the building in relation to whether a bridge can be built over it: the level was used as a proxy for the height, as there is no sufficiently sensitive way of measuring the height in any of the other data to do this job; in reality, even, e.g., a small four storey office block would be too tall to fit under a railway bridge; yet there is nothing that would distinguish this at present from a two storey house.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 335
  • Languages: JP,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #10 on: January 21, 2018, 02:10:48 PM »
Thank you very much for the integration! I'm very very excited to see a new simutrans world with new kinds of city building!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #11 on: January 21, 2018, 02:13:25 PM »
Adding pakset support for this may well take some time, especially since, unfortunately, nobody has updated Tile Cutter (which facilitates making multi-tile buildings) so as to be compatible with the new transparent workflow for Pak128.Britain.

Offline sheldon_cooper

  • *
  • Posts: 178
  • Languages: PT,EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #12 on: January 21, 2018, 03:26:20 PM »
This reminded me of a topic created by a player, which made buildings in the city larger than 1x1, but he was annoyed because it did not fit the standard simutrans factor. Now he must be very happy.  :D

Here is the topic:
>>>>>https://forum.simutrans.com/index.php?topic=17292.msg164695#msg164695<<<<

Hi, I spent weeks playing Simutrans (great job everybody!) so I decided to share a few drawings I had made meanwhile.

They don't fit on the 1x1 tiles but I tried to keep the scale of storeys so this is how it went out. Needless to say, they are actual Eastern European buildings (year of appearance is in each filename). Feel free to comment and/or make any use of it as I don't reserve any copyrights.



The pack of single images, if you like.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #13 on: January 21, 2018, 03:30:45 PM »
Interesting - thank you for spotting that. Those were for pak128, I believe; I do not think that there is an Extended version of that pakset; I wonder with which pakset that they might best go?

Offline AP

  • Devotee
  • *
  • Posts: 1202
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #14 on: January 21, 2018, 04:33:25 PM »
They could fit right into pak-gb as post WW2 housing schemes, James, if the licencing permits. I doubt anyone is going to draw Park Hill or the Alexandra Road estate any time soon, and for every one as distinctive as those there were dozen as utilitarian as the above.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #15 on: January 21, 2018, 04:57:28 PM »
They would have to be re-rendered (if they were rendered in the first place) to fit with Pak128.Britain lighting if they were to be used in that pakset.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1277
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Multi Tiles Inner City Building (MTICB)
« Reply #16 on: January 21, 2018, 05:17:41 PM »
 :o Me wants! Any chance for that to find it's way into Standard?