So, er, could you explain what this means to an illiterate peasant such as myself?
Sure
It loops through all the cities. If one of them have been a capital before, it will have highest priority (code not shown. comes before what I posted). If no then it will give values to cities depending on size, culture level, culture percent, etc. The one with the highest value becomes new capital.
getPopulation() * 4);
SIZE OF CITY x 4
getYieldRate(YIELD_FOOD);
NUMBER OF FOOD ON TILES IN BFC
getYieldRate(YIELD_PRODUCTION) * 3);
NUMBER OF HAMMERS ON TILES IN BFC x 3
getYieldRate(YIELD_COMMERCE) * 2);
NUMBER OF COMMERCE ON TILES IN BFC x 2
getCultureLevel();
# OF CULTURE LEVEL :
<Type>CULTURELEVEL_NONE</Type>
1
<Type>CULTURELEVEL_POOR</Type>
2
<Type>CULTURELEVEL_FLEDGLING</Type>
3
<Type>CULTURELEVEL_DEVELOPING</Type>
4
<Type>CULTURELEVEL_REFINED</Type>
5
<Type>CULTURELEVEL_INFLUENTIAL</Type>
6
<Type>CULTURELEVEL_LEGENDARY</Type>
7
(actually not sure if NONE is 0 and POOR is 1 etc or NONE is 1 and POOR is 2 etc)
getReligionCount();
HOW MANY RELIGIONS IN CITY
getCorporationCount();
HOW MANY CORPORATIONS IN CITY
getNumGreatPeople() * 2);
HOW MANY SETTLED GREAT PEOPLE x 2 IN CITY
calculateCulturePercent(getID()) + 100);
HOW BIG A PERCENTAGE OF THE CULTURE IS OWN CULTURE ((0-100%) + 100) /100 AND THEN MULTIPLIED TO THE VALUE OF ALL THE OTHERS
Sorry for caps, but easier to see I guess
The last is very important. F.ex. if one city have value 200 and 0% own culture and a second city have value 101 and 100% own culture the second one will become capital (1st: 200 x 1 < 2nd: 101 x 2)