Notes on scoring

Joined
Dec 5, 2005
Messages
3,663
Edit: taken from another place by the original author. Subject to further cleanup later


Compromise said:
I've looked briefly, but I can't find a clear forumula for how the Firaxis score is computed. Population, land, technology and wonders all seem to make it go up. (Does number of cities matter? Do you have to construct the wonders yourself?) Later victories earn fewer points. But I don't know the relative values of all these things.

Gah, what a mess. OK, there are a couple important functions: getScoreComponent in CvUtil.py, and calculateScore in CvGameUtils.py.

Basic idea: each of the four components (pop, land, tech, wonders) has a raw total associated with it. From each of these raw totals is calculated a component score, the component scores are added to give your final total. (extra note for micronauts: all of the rounding is going to be happening in the component scores).

The basic idea is that for each component, your score is the ratio of your raw score for that category and the "maximum" possible score in that category, times a factor for that category (GlobalDefines.xml). This is the score that shows up during play while the outcome is still uncertain. Let's call it the normalized score....

Now, if the game is over, your normalized score gets a boost which depends on your difficulty level. At the lowest level, your final score is 40% of your normalized score - but it goes up by 20% per level after that.

After this, there's a victory bonus... psych! It's globally defined as 0%; I mention it only because it could be modded in.

But if the game is over, AND you have won, things get really baroque: the code jacks with the definition of the "maximum" possible score before the normalized score is calculated. The basic drill is that the game looks the ratio of the final turn and the "EstimatedEndTurn" (see the logic in CvGame.init), and uses that ratio to reduce the value it uses for maximum possible score before the normalized score is calculated.

That's the easy bit, and how it works for wonders. Roughly speaking, if you win the game about halfway through, your normalized wonder score doubles; win the game one third of the way through, your normalized wonder score triples, blah blah blah.

However, the other three components use an exponential adjustment, rather than a linear one. Again, the game is trying to use a sliding scale from the minimum score to the "maximum" score, depending on when you complete your victory. Excusing the usual rounding non-sense and integer math, the theoretical maximum is reduced by a factor (Initial/Max)^(1-r), where r is the percentage of the turns you used up.

As I recall (I'm tired, and have looked up enough for this evening), the maximum raw tech score is fixed (total score for all techs in the game), but the initial value depends on how many techs were known initially by at least one civ. Maximum land score is number of land tiles on the map, initial value is a function of the number of settlers you have at the start (and some similar value for advanced starts). Max population is based on... food on the land, and water tiles adjacent to land.

You may now see why I've been using scare quotes around "maximum"; you may manage to exceed the max population with enough merchants plus taking over the world. You can certainly exceed the tech max by landing enough Future techs?

OK, we're almost done. What are the raw scores, anyway? Each plot of land is 1 point, each population (ie, city pops, not that silly number on the demographics screen) is 1 point, each wonder is 1 point; tech's are the oddball - the value of an ancient era tech is 1 point, and more advanced techs are an additional point per era.


Corrections with references accepted with gratitude - I'm planning to blame my mistakes on fatigue anway.

Edit: cities don't matter at all. I'm almost certain that captured wonders are just as good for scoring purposes as constructed wonders.
 
A question ( for tomorrow, I suppose... ):
Max population is based on... food on the land, and water tiles adjacent to land
This means:
a) unimproved land
b) fully improved land pre Biology
c) fully improved land post Biology
?
And it is calculated with basis on the starting map or in the ending one ( some events add food to a tile... )?

I suppose that c) and ending map is the correct anwser , but Civ mechanics never cease to surprise me.....
 
Top Bottom