News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

New cities without city buildings

Started by 1993matias, April 02, 2020, 10:13:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

1993matias

Simutrans-ex nightly from 31st of March, pak128Britain-Ex nightly from 1st of April.

How to replicate: Make a new map (e.g. 128x128 with three towns), switch to public player. Build a new city. It should look like this:

On the right is the city created with the map. On the left several ghost cities placed by hand. Growing cities by hand only expands public road network, no new buildings are build. Attractions appear as they would otherwise. Hand-placed citybuildings appear no problem, but don't spark any other building spawns.

Let me know if you want a save game.


EDIT:

It seems like it only happens every other time I load a new map... I started a new game after the faulty map, then I could place cities. Starting a new map after that, then only ghost cities appeared. Odd...

Spenk009

I have come across this too, but a while ago (around mid-2019 I believe). It seemed to be present in the savegame, but I didn't investigate further.

1993matias

What's interesting is, on a small map the cities will sometimes spawn with buildings if you build enough new cities. 200x200 it happens with around ten new cities.

The bug is also reproduceable in pak128.Sweden-Ex, so maybe it should be moved to the general Simutans-Ex bug reports?

jamespetts

Thank you for the report. I have moved this to the development section as this appears to be a code issue rather than a pakset issue.

Can I check (1) that you can still reproduce this with the latest nightly build; and (2) what map generation settings that you are using when this occurs?

Thank you.
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.

1993matias

Unfortunately, it still happens with the latest nightly builds.

This example has the cities not spawning correctly:




Let me know if you need any of my Simuconf.tab settings, then I'll post them here too.

Vladki

I have seen something similar happening both in standard and extended, with incomplete paksets - pak128.cs and pak128.sweden.
Is it possible, just by chance that there are no suitable low level buildings for the current year and climate, where the towns are built?

1993matias

Quote from: Vladki on April 10, 2020, 08:01:49 PM
I have seen something similar happening both in standard and extended, with incomplete paksets - pak128.cs and pak128.sweden.
Is it possible, just by chance that there are no suitable low level buildings for the current year and climate, where the towns are built?
If that's the bug, then how would other cities be built in 1750? Hovels appear since 1750, no? The original post is from 1850-1900 starting date more or less, I'm 100% certain hovels can spawn then.

jamespetts

I am afraid that I have not been able to reproduce this with 4 map generation attempts with the given settings. Can I check whether you have changed any simuconf.tab or cityrules.tab settings and whether you have modified the pakset at all?
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.

1993matias

Okay, this savegame should be able to reproduce the bug, at least the two times I've opened it:
https://drive.google.com/file/d/1y8Lc2Jq6nERLJ3W1hHnqUYQW0DPkGoQu/view?usp=sharing
Start a bunch of new cities with the public service player, they should look like this:


Then try growing them. It seems like the first city you grow works ok, the rest don't grow anything but streets and special buildings:


This is the pak I use, completely unmodified, together with yesterdays nightly
https://drive.google.com/file/d/1l7jRItBWLT8vLGhGhmzBhEoKb1euoDhj/view?usp=sharing

Does the Simuconf.tab in *\Simutrans\config have any influence on Simutrans-Ex?

Vladki

Quote from: 1993matias on April 11, 2020, 11:33:54 AMDoes the Simuconf.tab in *\Simutrans\config have any influence on Simutrans-Ex?

Sure it does. If you play sometimes standard and sometimes extended, I recommend having separate directories, e.g. ~/simutrans-std and ~/simutrans-ext, and add ~/simutrans as symlink to what you currently play.

1993matias

Quote from: Vladki on April 11, 2020, 04:57:58 PM
Sure it does. If you play sometimes standard and sometimes extended, I recommend having separate directories, e.g. ~/simutrans-std and ~/simutrans-ext, and add ~/simutrans as symlink to what you currently play.
Okay, thanks. I don't play Standard any more, I find it too much like OTTD haha. In that case, here is my upload of the Somuconf.tab:
https://drive.google.com/file/d/1HeulK-Lf7sB9CmOA-WwhXHixCn5mFdSc/view?usp=sharing

Ranran

#11
This bug has been reported many times and has been around for at least a year and a half.
This symptom is common. My saved game no longer builds a residential house too.  ::'(


I did experiment and consideration.


This is caused by job and population imbalances.
Please see this animated gif.



The newly created city is an empty city with no people.
Only the road will grow even if using the grow city tool. The city refuses to build a house.
Next, create an industrial building there with the edit tool and increase the job.
After that the house was built correctly when using the grow city tool.  :thumbsup:


The problem is that stupid city doesn't create a job even though it has a job shortage.
So the new city falls into a state where it is impossible to build a house.
It only makes roads because it can't make a house or work place.

Ranran

#12
I found this thread and delved into it.


I modified the code to show the current status of the world for debugging. Experimenting with it, I found that a new city never builds a city building if job_shortage = true.
As soon as you increase the number of jobs in the world and job_shortage becomes false, the new city will return to sanity.

And as I pointed out in another thread, there is another problem.
Urban expansion seeks to maintain a balance between population and work, but renovation does not.
There is a balancer written by james in the code that expands the city.
I think the renovation code is written by catasteroid (below the line 5468 of simcity.cc), but there is no balancer there. So in another thread, as I pointed out, renovation causes a lack of jobs.
It's very easy to reproduce this. And there are many problems that trigger this.

First of all, set the median town population to a low value or city 0 to start a new game.
In this way, create a city at the edge of the map or in a place such as a small island where it is difficult to expand the city area.
(Even if you do not intentionally place a city in this way, for example, if there is another city nearby, it will not be able to extend the city limit any further, and the city will prioritize renovation.)

If you use the grow city tool in this city, the world will easily run out of jobs due to renovation. Because there is no balancer in the renovation.
And this exposed even more problems.

As mentioned earlier, the first city building that city builds is RES. And like simcity, renovation doesn't change the use of tiles.
That is, the center of the city is always a residential area.

Is the center of London a residential area? I do not know.
I wouldn't leave Jalapagos because I'm afraid to fly on a lump of iron. (´・ω・`)
Anyway, however, in Japan, the larger the city, the more the center of the city is the commercial area. There may be many high-rise office buildings lined up. However, many slaves may sleep in the office rather than in their own home. So it's not a lie to say that they live in the office.  :P (But covid may have prompted them to go home.)
Anyways, since the center of the city is always a residential area in simutrans entended, these are the buildings with the highest potential for growth in the city, and as the city grows, population explosions are more likely to occur.

QuoteEspecially during the 1960s-80s, this actually causes the population to decrease because residential buildings are renovated into those with a smaller population.
As I've already pointed out, this is just an expectation of chance. Perhaps even in those times, condominiums are more densely populated than small houses.
If it doesn't always do exactly that (rather, it would be a lot of work and difficult for the pakset author to control it correctly), then the system has to control it.

And look at the percentage of residential areas throughout the city. It turns out that most of the city is a residential area. And the use of these tiles will not change.

There is currently no code to control population, at least in renovation.
Performing a renovation that does not take this balance into consideration in the two conditions that the center of the city is a residential area and most of the city is a residential area will likely lead to a shortage of jobs in the future.
It has not been decided whether the renovation will increase or decrease the population, but as long as there are high-rise housing such as condominiums, it is likely that the renovation will increase the population.

As the renovation breaks job-population balancing in this way, the balancing code during city expansion is also almost meaningless.

I know that I plan to change the city generation algorithm in the future, but there is a possibility that we can take measures that can be taken at this time or make effective changes in the future.


Other measures I came up with:
(1) Allows the construction of COM/IND even if the city population is 0.
I have no idea how this can be achieved or why this is currently not possible. (´・ω・`)

(2) Renovation considering population and job balance.
Renovation is complicated because it does not always increase the population. (I'm not familiar with those codes)

(3) Stopping the half-broken balancing code once.
Because it virtually makes it impossible to manually set up a new city in the middle of the game. You have to create a city with a population of 0 or manually plant all the buildings in the city. Or you need to plant a COM/IND building until world get the right job. The grow city tool cannot be used because it makes things worse.
OTOH, it's very easy to add a simuconf.tab option that stops job-population balancing code.
Even so, the city is not created completely randomly because it follows the city rules.

// Divide unemployed by 4, because it counts towards commercial and industrial,
// and both of those count 'double' for population relative to residential.
int employment_wanted  = get_unemployed()*2;

I tried to do (1).
A big improvement can be seen by changing get_unemployed () / 4 to get_unemployed () * 2 or get_unemployed () * 4. Simply removing / 4 will not improve much.
Balances seems to be working properly even in this case. Rather, it improves the situation where the city does nothing.

I'm not familiar with these codes so I'd appreciate any insight into this. (´・ω・`)


EDIT: Addition of countermeasures
(4) Allows rebuilding to another district.
For example, if there is a shortage of job, a more reasonable district can be transformed into an industrial or commercial district.
This is a bit complicated due to the existence of the cluster system. The alternative district must be a reasonable location. (For example, outdated buildings, low-level buildings) It should not be isolated or unnatural.

freddyhayward

Quote from: Ranran on January 08, 2021, 01:11:32 PMAs I've already pointed out, this is just an expectation of chance. Perhaps even in those times, condominiums are more densely populated than small houses.
No, it's a direct result of levels being inconsistently defined in the pakset. There is a specific residential building with 30 people defined at a higher level than buildings with 150 people. Buildings are renovated according to level.

Ranran

#14
Quote from: freddyhayward on January 08, 2021, 02:02:27 PMThere is a specific residential building with 30 people defined at a higher level than buildings with 150 people.
Unfortunately I don't think so. And there is no point in discussing just that one point. What I'm saying is that it's just one of the causes of the bug.
I've added a level display so check it out in the game.
https://github.com/Ranran-the-JuicyPork/simutrans-extended/commit/4f26c725956040488302c9cc094b6e67e363d84b

In standard, population is proportional to level. That's certainly not the case with extended. However, it should be noted that it is also a height parameter in extended.
That is, skyscrapers tend to have a high level, and that is necessary.
Certainly, the vast aristocratic housing may have a small population for its level. But the point here is that the population does not match the level, so the problem is that we do not know how it will change with renovation, and the problem is that renovation does not control population, high-rise condos image As you can see, the population is naturally large, and the population tends to increase.
Also, since skyscrapers have a high level, I think that they will end up in a building with a large population. And when renovation creates a populous condominium, will it be offered with the right jobs?
The center of the city is occupied by houses, and the entire city has a large number of RES tiles. And does pakset always have high level COM / IND? It is not guaranteed. Similarly, the level and number of jobs are not guaranteed. Renovating to a high level COM / IND as you say may reduce the number of jobs. So the fact that renovate can reduce the population is just proof that it is uncontrollable.
These factors create a dissonance. The gears are not meshing well. The result is a city bug that doesn't build buildings.

The problem anyway is that the population and job balancers aren't working properly. I'm just wondering if we can fix this bug by listing the causes and thinking about countermeasures.

jamespetts

Thank you for investigating this. As I think that I have mentioned before, I am reluctant to spend too much time and effort trying to modify the existing city growth code because one of the planned major projects is a total rewrite of this code (not so much the building placement code, but the rest of the code, including code relating to the amount of town growth and the growth of particular types of buildings, as well as where in a town that there is demand for growth). For this reason, I also caution against anyone else spending too much time on this. However, at this stage, if there is a way of fixing the reported bug quickly and easily without fundamentally unbalancing the game, then this would be welcome.
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.

Ranran

Quote from: jamespetts on January 08, 2021, 03:25:40 PMHowever, at this stage, if there is a way of fixing the reported bug quickly and easily without fundamentally unbalancing the game, then this would be welcome.
// Divide unemployed by 4, because it counts towards commercial and industrial,
// and both of those count 'double' for population relative to residential.
int employment_wanted  = get_unemployed()*4;

I suspect this change will improve the bug. In my test, the city will create buildings with a few clicks. It may seem to increase the probability of IND / COM generation, but in the end it seems to maintain equilibrium because the balancer you created works.
I wasn't confident because it contradicted the comments written above.

Renovation now breaks the job-population equilibrium, but it can only be detected when trying to set up a new city. Therefore, I think that the equilibrium balance will also be improved.

jamespetts

In that case, this may be a sensible interim workaround, although it may be worthwhile doing some more testing before deploying to check for unwanted effects.
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.

freddyhayward

Quote from: Ranran on January 08, 2021, 02:30:32 PMUnfortunately I don't think so. And there is no point in discussing just that one point. What I'm saying is that it's just one of the causes of the bug.
It's there in the GIF: the second from the bottom: level 12, population 15. I think you are underestimating its effect. In bridgewater-brunel, annual population growth of 20,000 in 1959 dropped to -20,000 in 1961 because of the introduction of that building. However, I admit that this is a separate issue.

Another issue might be found in cityrules.tab:

#
# relative affinities for certain building types which can lead to clustering of certain building types
#

# Note that the below scores are stored as signed 16 bit integers.
# avoid building next to industry
res_start_score = 1250
res_near_ind = -8
res_near_com = 0
res_near_res = 25

# everywhere is good, next to com best
com_start_score = -125
com_near_ind = 1
com_near_com = 6
com_near_res = 0

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

Vladki

I have done a few tests with the wienn-krakov-budapest game.

Manually placing IND/COM buildings does not help, because they will be outside of city limits. What helped was to increase the worlds industry density, until some factories appeared in the problematic cities. From then on the growth started. Further growth was boosted when attractions appeared in them. However there were moments when the growth seemed to be stuck. Adding COM/IND buildings within city limits helped the growth.

There are still very few IND/COM buildings in these towns (and none in some). But there are quite a lot of them in automatic cities. Automatic cities have COM/IND demand positive (around 1000), and RES demand negative (around -1000). Hand made cities have both values positive. Althought the COM/IND demand is higher, it seems that RES demand is being satisfied first. I had to grow Brno to almost 200 000 people to get RES demand negative.

Good news is that there happened some replacements form RES to COM and vice versa.

Bad news is that I'm unable to repeat that... At least not if I place an industry chain by hand into the problem town. And increased the industry density 100 times and no industries appeared in the problem cities again...

Ah, finally got a reproducible case. It does not matter if the industries appear in the problem cities or not. What matters is the world total of jobs (seen in city list - chart tab). It has to be sligthly over 90,000 (91,669) in my case, and then the cities start to behave correctly. (At world population of 775,200 - so the factor is approx 8.5).

I did further tests with empty map. I placed 15 towns by hand, and all of them got some houses. (not only the usual town hall and parish church). I could grow all of them but at some point the growth stalled and only roads were built. When some town had built big attractions, it enabled the growth of other towns as well, but eventually I got stuck and the growth stoped with citizens:jobs ratio around 10:1. Then after increasing the industry (30-40x) towns were able to grow again, quickly filling the prepared roads. But again the growth stalled (people 22,500; jobs 2500 ... 9:1)

The question is, why this ratio affects only towns built by hand?

Ranran

After all, the formula of the part I proposed may have been wrong originally.
Is there any reason why the city must always build RES first? Perhaps the previous formula leads to that.
In other words, underestimate the demand for IND / COM. So the new city gets stuck without being able to build IND / COM first.

QuoteHowever, I admit that this is a separate issue.
I have never seen a high-rise condo like the one in the image above in extended version 14, but at least before version 12 it could be built.
There may be a problem with the renovation, cluster, pakset settings, etc.

freddyhayward

Quote from: Ranran on January 09, 2021, 12:36:53 AMI have never seen a high-rise condo like the one in the image above in extended version 14, but at least before version 12 it could be built.
There may be a problem with the renovation, cluster, pakset settings, etc.
I'm not quite sure what you're referring to here. These are the two buildings I was mentioning, where the left is replaced with the right, leading to consistent population decline.

Ranran

#22
Quoteleading to consistent population decline.
After all, it's the same problem I'm pointing out that renovation changes buildings without controlling population (or jobs).
That may lead to a shortage of jobs in the world and vice versa.
And the same is true for jobs. Renovation can also reduce jobs. What I'm saying is that renovation ignores balancing and breaks job-population balance.
In simutrans, people who lose their homes die, so we have to wait for them to be born again.

The building above is clearly of a different age. And the hierarchy group is also different. It is difficult for the pakset author to properly balance it for even across the ages. It may change from old to new, or it may change to a high-rise condominium.
As my image shows, pak britain still has high-rise condominiums with a large population at that time. Why isn't it built? That's what I said in the previous post. Why does it only make the choice to reduce the population? Judging from the example of supplying an excessive population, I do not think that it is done intentionally.
So we need system control. The current situation is uncontrolled, causing the population decline you pointed out, the Great Depression, and bugs where new cities don't build anything.
Standard is proportional to level and population so such problems will not occur. They also don't have to balance jobs and population.

However, although the cause of breaking the balance is renovation, it is another problem that the city does not build anything in the state where the balance is broken.
The latter issue may be fixed with the changes proposed earlier.

freddyhayward

Quote from: Ranran on January 09, 2021, 02:13:58 AMAfter all, it's the same problem I'm pointing out that renovation changes buildings without controlling population (or jobs).
I think that we are in agreement.
1. If we use the level to determine population, jobs and renovation like standard, then balance is possible.
2. If we ignore the level and use population and jobs to determine renovation, balance is still possible.
3. If we use the level to define renovation but jobs and population are separately defined like current extended, the balance breaks.
So the best options are 1 and 2. I suggest 2.

Ranran

Quote from: freddyhayward on January 09, 2021, 04:11:45 AMI think that we are in agreement.
Thank you for clarifying.

Quote1. If we use the level to determine population, jobs and renovation like standard, then balance is possible.
2. If we ignore the level and use population and jobs to determine renovation, balance is still possible.
3. If we use the level to define renovation but jobs and population are separately defined like current extended, the balance breaks.
So the best options are 1 and 2. I suggest 2.
Given that Extended links level to the concept of height, I think it would be better to separate height and population indicators.

Simutrans does not simulate decline, but now renovation may act as decline, and I suspect that such content is related to rewriting the city growth code. I hope that the issues raised here will be corrected at that time.
See you at the next butcher shop.

Vladki

@ranran, @freddy,  I think that the fact that renovation (rising level), may reduce population or jobs, has nothing to do with cities being unable to grow. It is the worlds population:jobs ratio that affects this. What needs to be fixed is perhaps a fix of cityrules, to enable more COM/IND buildings to be built, or to enforce industry chains to spawn if the ratio gets close to the stall point (8:1)

freddyhayward

Quote from: Vladki on January 09, 2021, 02:40:55 PM@ranran, @freddy,  I think that the fact that renovation (rising level), may reduce population or jobs, has nothing to do with cities being unable to grow. It is the worlds population:jobs ratio that affects this. What needs to be fixed is perhaps a fix of cityrules, to enable more COM/IND buildings to be built, or to enforce industry chains to spawn if the ratio gets close to the stall point (8:1)
Your first point is correct, it is a related issue but not directly responsible.

Vladki

#27
I have tried the same: empty map, a few hand placed towns; on pak128.CS-ex and I was able to grow them indefinitely. The ratio of people:jobs is about 3:1 without any intervention. It was only the COM/IND + attractions satisfying the demand for jobs. No industry chains at all. Growthfactors:  400/200/100,but I do not think they are relevant. Individual cities had positive job demand and negative house demand, approximately of the same absolute value.

I think the most important is the difference in cityrules.tab. Note that pak128.CS cityrules are taken form pak128 and nobody did any tweaks in last 10 years. They have problems of their own - e.g.building houses even inside of the blocks (i.e. without road access). Also many new options regarding the renovation_range_proportions_* are missing (are they specific to extended?)


--- Pak128.Britain-Ex/config/cityrules.tab      2020-01-20 06:10:59.000000000 +0100
+++ pak128.CS-Ex/config/cityrules.tab   2017-05-09 21:53:53.913189242 +0200
-# Note that the below scores are stored as signed 16 bit integers.
# avoid building next to industry
-res_start_score = 1250
+res_start_score = 0
res_near_ind = -8
res_near_com = 0
-res_near_res = 25
+res_near_res = 8

# everywhere is good, next to com best
-com_start_score = -125
+com_start_score = -10
com_near_ind = 1
-com_near_com = 6
-com_near_res = 0
+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 = -95
+ind_start_score = 0
ind_near_ind = 8
ind_near_com = 0
-ind_near_res = -12
+ind_near_res = -8



I tried to set res/com/ind_start_score=0 for pak128.britain-ex, and it did the trick. Now I can grow the cities. Job demand is positive, Res demand is negative both in hudreds. Total world population:jobs is 3.5:1
Unfortunately the cityrules seem to be stored with the game, so I cannot repair the vienna-budapest scenario this way.
EDIT: It seems that the vienna-budapest map can be fixed by growing some automatic cities first (or building some industry chains), to reach population:jobs ratio less than 8:1 and after that I was able to grow all the capitals to the desired size.

Ranran

https://forum.simutrans.com/index.php/topic,18804.msg182927.html#msg182927
As phystam pointed out in this thread, the patch completely made it incompatible with past paksets. A city will no longer grow properly unless it is properly set up. Maybe it's another matter.