The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: turenar on November 29, 2017, 02:25:46 PM

Title: Population temporarily doubled after map enlargement
Post by: turenar on November 29, 2017, 02:25:46 PM
Hello,

After I enlarged the map, population of the cities which already exist before enlargement was temporarily doubled. This glitch was fixed by save-and-load.

It is reproduced in rd78683e.

Thanks.
Title: Re: Population temporarily doubled after map enlargement
Post by: zook2 on November 29, 2017, 11:13:40 PM
Could it be related to this?
https://forum.simutrans.com/index.php?topic=17334.0
Title: Re: Population temporarily doubled after map enlargement
Post by: turenar on November 30, 2017, 03:23:39 PM
I think, the results (doubled population) may be the same, but this glitch is different from that because reloading does fix this...

I tested #81082ce and this glitch is reproduced.
Title: Re: Population temporarily doubled after map enlargement
Post by: zook2 on November 30, 2017, 08:46:21 PM
It might be connected to this:
https://forum.simutrans.com/index.php?topic=17307.0

in which case it's a known bug that can't be fixed at the moment.
Title: Re: Population temporarily doubled after map enlargement
Post by: turenar on December 01, 2017, 01:58:01 PM
My explanation may be too bad... sorry

1. Start new map or load existing map.
2. Check population of each city. I tried with 4 cities, which population was 49680, 4202, 8604, 11496.
3. Enlarge the map
4. Check population of the cities. the 4 cities have 100162, 8404, 17208, 22992 people (population becomes twice or larger; first city probably grows between step2 and 4).
5. Save and reload the map
6. Check population again. the 4 cities have 50482, 4202, 8604, 11496.

I suspect enlarging code makes cities count buildings population in existing city "again", already counted by loading or first map generation.

BTW, it's ok even if this glitch can't be fixed. I can reload the map.