News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

[Bug] The population sorting in the city list dialog is broken

Started by Ranran(retired), April 23, 2020, 09:08:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(retired)

Hi. (´・ω・`)らんらんよー
There are 3 sorts option in the city list. I have noticed that the "Population" sorting is currently broken. It does not line up in order of population.  :-|


Confirmation method:
Just open the city list.
This bug is obvious in domo.sve


but, it is more clearly comfirmable when creating a new city, as the ability to create a new city is currently broken. New villages with no population are listed above the cities with a population.  ???
Please make more than one of them. They may not be next to each other even though they are both 0.
By the way, standard's population sorting is not broken.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Mariculous

My guess is they are sorted by internal inhabitant number rather than actual inhabitants, which doesn't really make sense for sure.
I am currently working at a fix to the city growth anyway. I'll have a look at it.

In standard, there are not that many cases in which the actual inhabitant number can diverge from the
internal counter.
In extended, there are quite a lot of these.

I guess the prefered solution in extended would be showing and sorting by 1. inhabitants, 2. jobs and 3. a sum of both?
I will try to add those and make the sorting work properly to the displayed number.

Ranran(retired)

I'm looking into the code for displaying the population and class distribution of a city, and I happened to find the part that caused that bug. (I did not understand the meaning of get_einwohner in German, so I searched for the code and it was that.)
It was comparing internal size rather than population as Freahk pointed out.
Now I think I fixed this.
@James - I have submitted a pull request so please check it.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)


Mariculous

Moreover "population" or "inhabitants" in this case.
Note that "(der) Einwohner" is singular, "(die) Einwohner" is plural (no they won't die), but from context, singular interpretation doesn't make sense here.
However, as you have already figured out, it's just an internal counter that is kind of related to the actual population.

jamespetts

Quote from: Ranran on April 27, 2020, 09:56:19 AM
I'm looking into the code for displaying the population and class distribution of a city, and I happened to find the part that caused that bug. (I did not understand the meaning of get_einwohner in German, so I searched for the code and it was that.)
It was comparing internal size rather than population as Freahk pointed out.
Now I think I fixed this.
@James - I have submitted a pull request so please check it.

Thank you very much for this - now incorporated.

Can anyone confirm that this is fixed with to-morrow's nightly build (3 May 2020 or later)?
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.