Manco Capac
Friday,13 June,I Collapse
- Joined
- Mar 1, 2010
- Messages
- 8,051
Demographics were intended by the developers to give an insight to players on how competitive they are versus either other players or commonly AI's.
Sadly, it turns out the use was pretty limited, but still permitted interesting deductions like guessing Mansa Musa or Hammurabi presences out of power rates. Or guessing the number of spawned charismatic leaders or what are the odds to get a GLH without much risk with the averaging of Land Areas. The main attractive aspect of demographics is the costless [corrected] view to how world goes. Graph won't do that for free since BTS espionage.
Nonetheless, there is another tab in F9 that gives free info to us about the world:
TOP 5 CITIES/WONDERS. Let's have deeper look to this information tab and especially the less obvious TOP 5 CITIES.
Usually people considers that tab to be a reference on the most cultured cities given experience shows end game cities with lots of wonders or/and legendary cities.
There is partial truth to it, but let's take a stab into the code to reveal the reality:
In your Program Files BTS folder, you'll find a sub-folder called Assets. Click onto it and then follow that path:
\Assets\Python\Screens\CvInfoScreen.py
CvInfoScreen.py is a python file that contains various lines of codes expressing many screens like demographics and TOP 5 CITIES/WONDERS.
Here is the code:
Here is the very part that calculates the worth of a city.
Ignoring the reverse solidus (backslash) meaning a breaking of line for asthetic uses while considering the two lines as a whole for compiling code, it is simply translated as:
City Worth = Pop*(0.2*C + F + P + G)
where
Pop: City population
C: Culture accumulated; not the rate
F: Food rate
P: Production rate
G: Gold generated (nor commerce or beakers) ; Via slider,buildings like shrines or specialists
Looking at this qualitatively, this is a pretty well sum-up of a city welfare/prosperity:
Higher populations mean a people are flocking to this city
More culture is the pride of a city
Better food,production rate and gold generation are the riches of the city
Now, quantitatively, the conclusions are far from expected. Culture is not a predominant part for TOP 5 CITIES. In fact, the factor Pop is the most important one. One may grow C, F, P elements or G factor, but another population point over pop=1 makes the city worth twice!
Now, let's include experience: early game is dominated with F,P,G parameters and globally Pop factor because early culture is limited until monuments apprear or libraries. Creative leaders will make its share, but those aforementioned parameters will take big part of city worth.
Where culture shines is the late games where cities have built plenty of wonders, made culture bombs,etc. explosing the diminished by 5 culture factor comparing to F, P and G factors that are limted to what the BFC can offer.
That is why late game is dominated with heavy wonders cities or legendary ones.
What to deduce from this in practice; well, early game where all civs start with pop=1 for [8,11] turns, C, F, P are balanced to each others, making nice deductions on how one leader is starting.
Why G factor is not including is simply due to AI coded normally to put the science slider to 100% given the absence of maintenance in cities and civics. Still, from testing, even if I put the slider down to 0% science, it doesn't change at all, so basically I'll ignore that factor out of necessity and everyone is on full science early game.
The equation is simplified:
City Worth = (0.2*C + F + P)
Observations:
Culture element (C) is indeed diminished in effect, but also rounded down to make even more difficult the comparison:
For instance, For each increment of 5 , the culture parameter 0.2*C increases of 1 point.
A normal leader (non-creative) will generate 4 after 2 turns, but 4/5 is rounded down to 0.
Setting a equal comparison in F and P (quite usual), creative civs will outdo non-creative ones on T2.
F and P are gone.
T0:T1:T2:T3:
Therefore, looking early TOP 5 CITIES in the very early turns (without moving your capital, this SIP or simply supposing most AI's have equal F and P), we can deduce creative civs.
LIMITATIONS: the problem with the TOP 5 is actually the limitation to 5 capitals, which means the study of AI capitals work well on standard maps with 6 opponents or work best on smaller maps.
Another rising problem is how human player on par in 0.2*C, F and P are put first place out of convention, making harder the distinction cities lower than yours.
It is when we are in the middle of the TOP 5 we have the capacity to deduce something by having a reference: us.
Nonetheless, in case where we do not SIP and loses turns on settling farther, the catching up in culture (being creative) permits to spot non-creative and those who are creative. All done in the interval [8,11] turns before AI goes pop 2 and screws the comparison. If the AI goes for worker first, the comparison will do a bit longer. Still, worker first or not is a big RNG decision from the AI.
An unexpected conclusion is about how to guess the presence of EXP (expansive leaders).
Expansive leaders in BTS are nerfed from Warlord expansions from 50% workers to 25% workers. That means, for every 4 , the expansive leader get a bonus of 1 rate. And that is a parameter in our city worth formula. Those AI's working a forested plain hill will get another out and thus outdo us (non-expansive or lack of FPH while being EXP).
You might think culture will get in the way, but no!
The comparison shall be done on T1! A moment where both creative and non-creative see their 0.2*C parameter rounded down to 0, annihilating the influence of culture. What about food? Well, have you seen ever an AI settling on a food resource or getting modifiers from food output? Simply no.
Finally, there is a balance between food and hammers early.
Normally, the capital generates 2 and 1 and the tile it works with the first pop is almost always 3 + output. Making F+P= 6 most of the time.
What can go wrong in that reasoning?
First, for AI's, simply plains hills under cities. It gives another hammers and can be mistakened with EXP leaders. Still, does it happen often? Not really.
Deer in forest giving an output of 4 (F+P) is another case, but even even rarer. Let's ignore that one.
And lastly, there are cases of AI working a lake, but that doesn't interest us because they are lower than us.
What about IMP leaders with a modifier of 50%?
AI's start extremely rarely on a settler in capital on IMM and below. On deity, we see that and anyways, deity screws totally the reasoning of "city worth" because of the second free settler.
Conclusion:
Cities getting upper ranks than us either have settled on a PH or are under control of a EXP leader working a forested plain hill. This must be evaluated on T1 when culture has no effect in the comparison.
Shamefully, no real practical conclusions, but that was a nice thinking process.
Conclusion is under revision.
Sadly, it turns out the use was pretty limited, but still permitted interesting deductions like guessing Mansa Musa or Hammurabi presences out of power rates. Or guessing the number of spawned charismatic leaders or what are the odds to get a GLH without much risk with the averaging of Land Areas. The main attractive aspect of demographics is the costless [corrected] view to how world goes. Graph won't do that for free since BTS espionage.
Nonetheless, there is another tab in F9 that gives free info to us about the world:
TOP 5 CITIES/WONDERS. Let's have deeper look to this information tab and especially the less obvious TOP 5 CITIES.
Usually people considers that tab to be a reference on the most cultured cities given experience shows end game cities with lots of wonders or/and legendary cities.
There is partial truth to it, but let's take a stab into the code to reveal the reality:
In your Program Files BTS folder, you'll find a sub-folder called Assets. Click onto it and then follow that path:
\Assets\Python\Screens\CvInfoScreen.py
CvInfoScreen.py is a python file that contains various lines of codes expressing many screens like demographics and TOP 5 CITIES/WONDERS.
Here is the code:
Code:
def calculateTopCities(self):
# Calculate the top 5 cities
for iPlayerLoop in range(gc.getMAX_PLAYERS()):
apCityList = PyPlayer(iPlayerLoop).getCityList()
for pCity in apCityList:
iTotalCityValue = ((pCity.getCulture() / 5) + (pCity.getFoodRate() + pCity.getProductionRate() \
+ pCity.calculateGoldRate())) * pCity.getPopulation()
for iRankLoop in range(5):
if (iTotalCityValue > self.iCityValues[iRankLoop] and not pCity.isBarbarian()):
self.addCityToList(iRankLoop, pCity, iTotalCityValue)
break
# Recursive
def addCityToList(self, iRank, pCity, iTotalCityValue):
if (iRank > 4):
return
else:
pTempCity = self.pCityPointers[iRank]
# Verify a city actually exists at this rank
if (pTempCity):
iTempCityValue = self.iCityValues[iRank]
self.addCityToList(iRank+1, pTempCity, iTempCityValue)
self.pCityPointers[iRank] = pCity
self.iCityValues[iRank] = iTotalCityValue
else:
self.pCityPointers[iRank] = pCity
self.iCityValues[iRank] = iTotalCityValue
return
Here is the very part that calculates the worth of a city.
Code:
iTotalCityValue = ((pCity.getCulture() / 5) + (pCity.getFoodRate() + pCity.getProductionRate() \
+ pCity.calculateGoldRate())) * pCity.getPopulation()
Ignoring the reverse solidus (backslash) meaning a breaking of line for asthetic uses while considering the two lines as a whole for compiling code, it is simply translated as:
City Worth = Pop*(0.2*C + F + P + G)
where
Pop: City population
C: Culture accumulated; not the rate
F: Food rate
P: Production rate
G: Gold generated (nor commerce or beakers) ; Via slider,buildings like shrines or specialists
Looking at this qualitatively, this is a pretty well sum-up of a city welfare/prosperity:
Higher populations mean a people are flocking to this city
More culture is the pride of a city
Better food,production rate and gold generation are the riches of the city
Now, quantitatively, the conclusions are far from expected. Culture is not a predominant part for TOP 5 CITIES. In fact, the factor Pop is the most important one. One may grow C, F, P elements or G factor, but another population point over pop=1 makes the city worth twice!
Now, let's include experience: early game is dominated with F,P,G parameters and globally Pop factor because early culture is limited until monuments apprear or libraries. Creative leaders will make its share, but those aforementioned parameters will take big part of city worth.
Where culture shines is the late games where cities have built plenty of wonders, made culture bombs,etc. explosing the diminished by 5 culture factor comparing to F, P and G factors that are limted to what the BFC can offer.
That is why late game is dominated with heavy wonders cities or legendary ones.
What to deduce from this in practice; well, early game where all civs start with pop=1 for [8,11] turns, C, F, P are balanced to each others, making nice deductions on how one leader is starting.
Why G factor is not including is simply due to AI coded normally to put the science slider to 100% given the absence of maintenance in cities and civics. Still, from testing, even if I put the slider down to 0% science, it doesn't change at all, so basically I'll ignore that factor out of necessity and everyone is on full science early game.
The equation is simplified:
City Worth = (0.2*C + F + P)
Observations:
Culture element (C) is indeed diminished in effect, but also rounded down to make even more difficult the comparison:
For instance, For each increment of 5 , the culture parameter 0.2*C increases of 1 point.
A normal leader (non-creative) will generate 4 after 2 turns, but 4/5 is rounded down to 0.
Setting a equal comparison in F and P (quite usual), creative civs will outdo non-creative ones on T2.
F and P are gone.
Creative | Non-creative
0 | 0
0 | 0
1 | 0
2 | 1
Therefore, looking early TOP 5 CITIES in the very early turns (without moving your capital, this SIP or simply supposing most AI's have equal F and P), we can deduce creative civs.
LIMITATIONS: the problem with the TOP 5 is actually the limitation to 5 capitals, which means the study of AI capitals work well on standard maps with 6 opponents or work best on smaller maps.
Another rising problem is how human player on par in 0.2*C, F and P are put first place out of convention, making harder the distinction cities lower than yours.
It is when we are in the middle of the TOP 5 we have the capacity to deduce something by having a reference: us.
Nonetheless, in case where we do not SIP and loses turns on settling farther, the catching up in culture (being creative) permits to spot non-creative and those who are creative. All done in the interval [8,11] turns before AI goes pop 2 and screws the comparison. If the AI goes for worker first, the comparison will do a bit longer. Still, worker first or not is a big RNG decision from the AI.
An unexpected conclusion is about how to guess the presence of EXP (expansive leaders).
Expansive leaders in BTS are nerfed from Warlord expansions from 50% workers to 25% workers. That means, for every 4 , the expansive leader get a bonus of 1 rate. And that is a parameter in our city worth formula. Those AI's working a forested plain hill will get another out and thus outdo us (non-expansive or lack of FPH while being EXP).
You might think culture will get in the way, but no!
The comparison shall be done on T1! A moment where both creative and non-creative see their 0.2*C parameter rounded down to 0, annihilating the influence of culture. What about food? Well, have you seen ever an AI settling on a food resource or getting modifiers from food output? Simply no.
Finally, there is a balance between food and hammers early.
Normally, the capital generates 2 and 1 and the tile it works with the first pop is almost always 3 + output. Making F+P= 6 most of the time.
What can go wrong in that reasoning?
First, for AI's, simply plains hills under cities. It gives another hammers and can be mistakened with EXP leaders. Still, does it happen often? Not really.
Deer in forest giving an output of 4 (F+P) is another case, but even even rarer. Let's ignore that one.
And lastly, there are cases of AI working a lake, but that doesn't interest us because they are lower than us.
What about IMP leaders with a modifier of 50%?
AI's start extremely rarely on a settler in capital on IMM and below. On deity, we see that and anyways, deity screws totally the reasoning of "city worth" because of the second free settler.
Conclusion:
Shamefully, no real practical conclusions, but that was a nice thinking process.
Conclusion is under revision.