The International Simutrans Forum

 

Author Topic: How do "Relative affinities for certain building types" work? (cityrules)  (Read 416 times)

0 Members and 1 Guest are viewing this topic.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1204
  • PAK-DEV P192C
  • Languages: DE, EN
The cityrules contain settings to affect the relative placement of res, com and ind.

Here are the rules of pak64 for reference:
Code: [Select]
# avoid building next to industry
res_start_score = 0
res_near_ind = -8
res_near_com = 0
res_near_res = 8

# everywhere is good, next to com best
com_start_score = -10
com_near_ind = 1
com_near_com = 8
com_near_res = 1

# next to res means expensive filters and no truck after 10 pm => avoid this ...
ind_start_score = 0
ind_near_ind = 8
ind_near_com = 0
ind_near_res = -8

The general idea is pretty clear, make sure each type mostly sticks to itself, and use commercial buffers between industrial and residential zones. It's the specifics that I wonder about, especially since I don't know in which order a new building is buildt.
My impression:
- city grows by increasing unemployment/homelessnes (Question: Do these increase differently based on what causes the growth, such that deliveries to city-factories increase unemployment and a pax network increases homelessnes?)
- city decides on type of building (Question: It takes ind if unemployment is high and res if homelessnes is high, but how exactly does it decide whether to build com?)
- city decides on whether to build a new building or replace an old one based on renovation_percentage (Question: Even if set to 1, you don't need 100 buildings to get one upgraded. Is it really a percentage?)
- - if it replaces an old building, it uses the above rules to decide which building to replace. (Question: Does it take into consideration which building it replaces, or will it not care and abort if no higher level building of the destined type is found?)
- if it wants to build a new building, it would need to first find the chance of each potential spot for a building to be placed there according to building rules, and then multiply that chance for all building spots with the chance based on above rules???
- After all that, a new building of the type chosen and appropriate level is buildt. Only at this point, chances of individual buildings would come into play and compete with each other (so if there is only one eligable building, whether it has a chance of 1 or 100 does not matter, and different types of buildings don't compete???) - and if there is no building of that type of that level - is another type/level used, or does the placement process repeat?
- - clusters affect chances, so they are accounted for in the same step

Pretty sure I got something wrong, but even if it's all right, I would not know how "start_score" affects things, and what the near-numbers really mean (I would think of chance like in buildings, but you can't do that with negative numbers)

Note: I wonder about all this, because I have a roughly equal amount of res and ind type buildings for a climate, but upon founding or growing cities, I usually don't get any inds. Even if I place low-level inds manually, they are overwritten by res. So I feel like I need to deeply understand all the citybuilding mechanics in order to make them do what I want them to do.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: How do "Relative affinities for certain building types" work? (cityrules)
« Reply #1 on: December 16, 2018, 11:56:22 PM »
You need high level ind buildings. Most paks do not provide them, at least not in later years to have a post-industrial society ... But if you have a factory every few levels (say 13 16 19 and so on until higher than the highest com), then you will retain industrial areas.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1204
  • PAK-DEV P192C
  • Languages: DE, EN
Re: How do "Relative affinities for certain building types" work? (cityrules)
« Reply #2 on: December 17, 2018, 06:01:54 AM »
In that climate, I have Industrial buildings of level 1,3,5,7,9,12; at least 3 per level. I have only one residential building at a higher level, 15. If the city would only consist of those level 15 res, it would make perfect sense. But even before the first level 15 building is ever buildt, there is not a single ind.  ???
Also: Why higher than the highest com? If I want to retain all zones, shouldn't the highest level of all types of buildings be the same?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: How do "Relative affinities for certain building types" work? (cityrules)
« Reply #3 on: December 21, 2018, 08:13:12 AM »
Com can replace ind or res. But ind does not like go near com or res. Also there seems to be more com building on each level as ind. So to avoid indentical buildings next to each other, com is more likely to succeed.