News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Bug in population count after map creation

Started by Jando, August 16, 2017, 03:09:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jando

Hello again! And my apologies for these pesky bug reports. :)

Want to report a little bug I noticed some time ago but forgot to report it. Noticed it again now, thus here it comes. Town population in/after map creation has several oddities. How to observe:

1. Create a new map. I don't think it matters but in case it does: I used size 512x512 tiles, 16 cities, zero big cities, zero clusters, 3000 median town population, year 1840.
2. Pause game, open city list.
3. Note that all towns (or almost all) will have a stated population below the requested median town population.
4. Note that visually towns seem to have a higher population than stated in city list and town info. Towns may even show an upgraded city hall.
5. Note that sorting the city list by population will show an incorrect sort order.
6. Save the game.
7. Reload the saved game.
8. Pause game, open city list.
9. Note that all towns (or almost all) will now have a population above the requested median town population.
10. Visual presentation and stated town size now fits expectations.
11. Sorting of towns by population in city list will still give incorrect results though.

Thanks again!

grivlad0

I confirm all the points.
In some cases, the negative value of the number of individual cities.
Attach SVE, but on load, go to "7. Reload the saved game."
https://drive.google.com/open?id=0B4qmsfVgiXX5a3QyOTRtY3BUQms

zook2

Could that be related to what I posted here?
http://forum.simutrans.com/index.php?topic=17334.0

Although I didn't notice anything unusual before eight months into the game.

jamespetts

I have just pushed a fix for this. The problem was that the statistics were incorrect when the map was generated and were only corrected after the map was saved and re-loaded: now, the statistics (and passenger generation numbers) should be consistent before and after loading a map. Note that this will not fix the records of the previous incorrect statistics if these have been recorded from an older saved game.

I should be grateful if you could re-test with the next nightly version and confirm whether this is now fixed.
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.

Jando

Hello James, thank you for addressing this issue!

Made a few new maps and compared the population statistics:

1. There are still some (minor) population changes when saving a new map for the first time. Example: total map population changing from 49680 to 50640. No big issue I would say unless the change in numbers points to another potential bug.
2. Sorting city list by population count will still give incorrect sort order.
3. All towns (or almost all towns) will have a population above the stated median town population. Unless my understanding of median is totally wrong I would expect roughly 50% of towns to have a population below and 50% of all towns to have a population above the median town population.

jamespetts

Thank you for your feedback. The latter two issues, I suspect, are caused by remnants of a legacy method for counting town populations. This legacy method must be retained until the town growth algorithm is updated, which may need to wait for some time until other, balance critical feature are completed and tested.
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.

Jando

Thanks for the explanation, James!

No big deal, just good to know it's not some unknown bug that causes it.