The International Simutrans Forum

 

Author Topic: Regarding renovation behaviour during city growth (or lack thereof)  (Read 482 times)

0 Members and 1 Guest are viewing this topic.

Offline Catasteroid

  • *
  • Posts: 4
Over the past few days despite tinkering with the settings in cityrules.tab in Pak128.Britain-Ex I noticed a pattern of cities sprawling out during post-generation growth during gameplay regardless of the settings of "renovation_percentage" and "minimum_building_density" with only a cluster of relatively dense middling population value buildings in the centre of cities produced during map generation and further buildings constructed during growth were most often a random mixture of the same low level/density residential, industrial and commerical buildings constructed outward with very little renovation of existing buildings to types with greater population/job/visitor values, after some probing of the simcity.cc file on Simutrans Extended github repo I noticed two settings that modify renovation behaviour which an attempt is made to read but are not present or written to the cityrules.tab file by default which are "renovations_count" and "renovations_try" which are as of writing defined on lines 252 and 257 and read at lines 705 and 706 respectively and they're defined with values 1 and 3 respectively resulting in exactly one building being. I'll add that since my single player games are usually exceptionally short with maps holding my interest between two and seven days at most I have my growth factor divisors set in the Pak's simuconf.tab as 60, 40 and 20 for villages, cities and capitals respectively to expedite growth and I found that my large road distribution depots (which I use as central hubs to collect goods from producing primary or secondary industries and deliver them to secondary industries and tertiary consumer industries and shops) tend to get swallowed up by suburban sprawl and invaded by semi-detached houses as the roads are claimed by the public service player which prevents me from placing further signals or signs if I wanted to redevelop the depots as traffic grows (to prevent the cyclical self-sustaining truck deadlocks which essentially force me to load an autosave due to them being horrid to untangle).
Upon adding the "renovations_count" and "renovations_try" values to the cityrules.tab, defining them both as 10 and setting renovation_percentage to 100 cities produced by map generation would be dense clusters of the largest population/job value (highest level value from what I understand) buildings available which whilst undesirable for gameplay was a good metric to compare maps generated with different values of these two options. Reducing "renovations_try" from 10 had the most impact on the chance of buildings being renovated instead of a new low level building being produced and the current behaviour essentially uses this variable as a hard cap on the number of buildings that will be renovated with "renovations_count" acting more as a soft cap as the number of renovation attempts will never exceed the number of iterations made.

Personally I'm of the opinion that these two options which aren't present in cityrules.tab probably should be there to allow players to adjust renovation behaviour without having to sift through the source to discover that these options exist, and also that it would be of benefit if city growth behaviour was extended with one or more extra settings defining a target population or job density that cities will attempt to achieve and perhaps an absolute threshold of density below which no new buildings will be constructed and instead exclusively renovating existing buildings to higher level buildings. I know it may not be high on the list of priority targets for development but it's something to consider, it's been a while since I've used C++ and git but I'll see if I can wrangle the source and compiling process to a point where I could produce this behaviour myself in the nearby future.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Regarding renovation behaviour during city growth (or lack thereof)
« Reply #1 on: February 24, 2019, 11:44:57 AM »
Thank you for your feedback, and welcome to the forums!

There is a plan to renovate completely the town growth algorithm, which is the next priority after the schedule/vehicle maintenance features, which work is currently suspended pending the resolution of an extremely difficult to fix bug which has been outstanding for some months (relating to loss of synchronisation in some very specific conditions in online games).

The way in which town growth is calibrated is intended to be replaced entirely when the town growth system is overhauled, which is why I have not expended any effort in improving the current system. The current system, incidentally, uses the older metrics from Simutrans-Standard for population and jobs, which are not the same as the metrics shown in the city's charts; I had planned to change the city growth system when the new metrics (jobs, population, visitor demand) for the passenger generation system were implemented, but realised that that was too much work to do all at once.

If you would like to add features to the current system, you would be most welcome to do so, and I should be happy to integrate them if they work without undesirable side effects, but you should be warned that they may have a fairly short lifespan (although quite how short will depend on how long that it takes me to deal with the higher priority tasks and how many others assist with those tasks).

I should note that it is always extremely encouraging to see people willing to contribute to the coding effort.

Thank you again for your feedback, and I hope that you are enjoying Simutrans-Extended.

Offline Catasteroid

  • *
  • Posts: 4
Re: Regarding renovation behaviour during city growth (or lack thereof)
« Reply #2 on: February 24, 2019, 07:48:43 PM »
Ah I had a feeling that may be the case and I figured I wouldn't beat about the bush and get straight to putting my thoughts down on the experience, I've not had much successful practical experience with git beyond causing conflicts and breaking things but despite the interesting half-and-half situation between the English and German usage in the source code and despite my practical experience being largely leaning towards C# (and the strange Algol/Ada influenced language that powered LambdaMOO) I can read it fairly fluently and determine purpose in most chunks. I've essentially got nothing to do all day except tinker as I'm currently out of work with a gnarly case of depression but I've found some succour in Simutrans-Extended as it's held my interest longer than I expected since I can tailor and shape the game to suit whatever particular scenario I fancy and there's still yet more content and nuanced detail that I've yet to explore before the 1950 mark which is usually the earliest I start my games from.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Regarding renovation behaviour during city growth (or lack thereof)
« Reply #3 on: February 24, 2019, 09:00:22 PM »
Git is quite straightforward once one gets used to it - if you get stuck, let me know and I can try to assist (although I only know the basics myself). Don't feel obliged to contribute anything, of course, but anything that you do contribute would be most welcome.

I do hope that you are finding Simutrans-Extended enjoyable. With the British pakset, there is a great deal to explore for 200 years before 1950, so hopefully you will find much of interest there.

Thank you again for your feedback.

Offline Catasteroid

  • *
  • Posts: 4
Re: Regarding renovation behaviour during city growth (or lack thereof)
« Reply #4 on: September 07, 2019, 07:03:45 PM »
Right as much as I don't like to necropost it's probably worth it to mention that I wound up cracking an annoying bit of flipped logic I got frustrated with having come back after several months with a clearer mind, I made a couple of commits to my personal branch (which is probably a couple of hundred commits behind the master branch) that expose a bunch of variables relating to how the renovation function operates giving players greater control over how that particular part of city growth behaves both during map generation and in real time. I'd like to expand the scope of this to provide additional behaviour to provide further options for tailoring how the cities grow as the game develops.

Offline Catasteroid

  • *
  • Posts: 4
Re: Regarding renovation behaviour during city growth (or lack thereof)
« Reply #5 on: September 15, 2019, 10:26:12 PM »
I've gone and revised my current renovation code to provide both static and proportional renovation range and count settings which should provide even more options by which a player can customise how the cities in their games renovate buildings during gameplay which initially was relatively little as the most impact the renovation settings has was during map generation where cities are quickly grown over many, many growth steps upon the three relatively stiff settings we had access to had the most influence. On my personal branch you can access the source to compile it yourself though you'll also need to replace the following lines in your cityrules.tab:
Code: [Select]
# chance for renovation versus new building (bigger number => less sprawling)
# Note: the rougher the desired landscape, the lower that this number should be.
#
# With low minimum_building_density, must raise renovation_percentage to avoid sprawl
renovation_percentage = 95

renovations_count = 10

renovations_try = 10

With the following lines:

Code: [Select]
renovation_percentage = 60

# Static renovation stats
renovations_count = 10
renovations_try = 25
renovation_range = 10

# Renovation count proportional setting type...
renovation_influence_type = 2
# If the above is set to 1 these static values are used
renovation_count_village = 5
renovation_count_city = 10
renovation_count_capital = 15
# If it's set to 2 these proportional values are used
renovation_count_increase_every = 2500
renovation_count_maximum = 25

# Renovation range proportional setting type...
proportional_renovation_radius = 1
# If the above value is set to one these proportional percentage values are used otherwise renovation_range is used
# Set them all to the same value (for example 50 which would always use 50% of the city size) for a simple proportional renovation range for all cities
renovation_range_proportions_village = 80
renovation_range_proportions_city = 60
renovation_range_proportions_capital = 50
# Additional proportional values used for each building type...
proportional_renovation_range_type = 1
# If the above value is 1 then previous range values are multiplied by these percentage values
renovation_range_proportions_res = 100
renovation_range_proportions_com = 150
renovation_range_proportions_ind = 200
# If the below value is 1 buildings further from the city centre are less likely to be renovated
# though if it is 0 a building at the maximum allowable distance from the centre would be equally
# likely to be renovated as one adjacent to the city centre
renovation_distance_chance = 1

You may modify these values to your heart's content to get a feeling for how they change the development of cities both during map generation and during gameplay, it'd be nice to get some feedback and criticism on these changes. I didn't intend for this to be a replacement for the planned overhaul of city growth and generation algorithm but in the meantime it should provide a meaningful amount of power over how cities develop to the player until that overhaul comes.