Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#8908) endgame numbers
Home

[Freeciv-Dev] Re: (PR#8908) endgame numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8908) endgame numbers
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Sat, 5 Jun 2004 05:25:37 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8908 >

On Fri, 4 Jun 2004, Jason Short wrote:
> I'm not so sure that it's correct to include the total population here.
>   The existing code reports the total number of citizens, times 1000.
> The total population is calculated quite differently since a size n city
> has population 5000n(n+1) - the nth citizen counts as 10,000n people.
>
> However should we be reporting the population in people or in citizens
> here?

The population should be reported in people, because this is the only
measure which is interesting to the player. It is repoted in people in the
demographics report and elsewhere (civ-info. by radar). The player doesn't
get a number of citizens elsewhere during the game, so it will not be
interesting at endgame either.

> Of course if we do it in citizens we shouldn't be multiplying by
> 1000.

Yes. This is a bug.

> Also I'm not sure if get_population is the right function to call to get
> the population.  It recoveres the population from the score struct.  But
> if this data hasn't been updated then it may be wrong.  In that case it
> would be better to call civ_population().

civ_score(), which updates the score struct, is called before
get_population() in report_final_scores(). So get_population() is always
up to date in this case.

> And also...
>
> Since the game doesn't end until the start of the new turn, the
> population when the game ends isn't the same as it was when the last
> player was killed.  This is probably bad.

The population which is used to calculate the score is reported at
present. I don't see what is wrong. Can you explain again, or give an
example where the current situation probably is bad?

> And finally, the population is listed in thousands.  The column title
> needs to say this.

No, the population is not listed in thousands (with the patch). The
population in this report has the same unit as the population in the
demographics report. See the screenshot. "40.000" Surely this isn't
40.000.000, with two cities..

> You can't give the full population because it may
> overflow a 32-bit integer (that's what they say, although I'm not sure I
> believe it - but it's hard to prove that it _can't_ overflow).

The full population isn't used. It's sent over the network in thousands.
get_population() returns a regular int, that int is sent over the network,
and the client converts this number to the full population with
population_to_text().


Andreas Røsdal





[Prev in Thread] Current Thread [Next in Thread]