Demographics report, population ranking question

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
Dino the Dinosore
Hardened
Posts: 231
Joined: Sun Dec 31, 2017 3:41 am

Demographics report, population ranking question

Post by Dino the Dinosore »

I have 1 city size 6, and the Japanese (who have shared vision with me) have 4 cities sized 3,2,1,1 (total 7). When I do the demographics report it shows me as #1 in population, which seems wrong. Digging into the code, it's because of this code in common/city.c

Code: Select all

/**********************************************************************//**
 Returns how many thousand citizen live in this city.
**************************************************************************/
int city_population(const struct city *pcity)
{
  /*  Sum_{i=1}^{n} i  ==  n*(n+1)/2  */
  return city_size_get(pcity) * (city_size_get(pcity) + 1) * 5;
}
Why is it essentially squaring the size of the city? Is this a bug or am I missing something?
cazfi
Elite
Posts: 3488
Joined: Tue Jan 29, 2013 6:54 pm

Re: Demographics report, population ranking question

Post by cazfi »

Each point of city size brings more population than the previous one.

Squaring the size for the score might be a bit extreme, but one big city is supposed to give more points than many small cities.
Post Reply