Spoiler :
Code:for(pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop)) { totalPlayerYield += pLoopCity->getYieldRateTimes100(eYieldType, false); totalPlayerPopulation += pLoopCity->getPopulation(); } if (totalPlayerPopulation > 0) buffedYield = (totalPlayerYield / totalPlayerPopulation) * iAI_Population; if (buffedYield > iAI_Yield) return buffedYield; return iAI_Yield;
EDIT: It is a simple bullet proof technique that has a big effect on the quality of the game. The "false" means trade routes get included in the calculation.
If yield rate times 100 is that cities production / population, then for a human with a single city, that comparison value amounts total production / population ^2.
But it is simple to show that (sum of yield rate) / (sum of population) is not always the above when there are two or more cities.
In fact a human who had a mature city of pop 10 producing 30 science for a yield of 3.
Dividing by pop again, that yields .3
Then founds a new city of pop 1 producing 1 science for a yield of 1.
Sum of yield per population : 4. Empire population : 11. 4 / 11 is about .36. It's actually gone up! Were you intending to give the AI more of a bonus when the human founds a brand new city?
Edit:
It would probably be a good idea to lock Great Scientist & Great Writer strength to the turn they are born as well.