Page 1 of 1

Improved function for calculating City Population

Posted: Tue Oct 06, 2015 4:19 pm
by Jacew
Representing citys populace could be significantly improved by weighting it against food in granary to produce more fluid and nicer population growth. My idea was to tweak the original function, but after a long trial and error with unsatisfactory results I gave up and made my own.

Original Freeciv function:
population = ((citySize*(citySize+1)*5)*1000

New version:
population = (100000*GranaryFillPercent*(citySize/10))+((citySize-1)*citySize*6000)+100

GranaryFillPercent = Food in Granary/Granary Size

Comparative population with both functions in different situations:



EDIT: Fixed previously miscalculated table and added +100 into function to prevent population count 0 with City Size 1 and empty granary.