Initial the population in a sector is one and there are no buildings.
The basic types of sectors include Mountain, Prairie and Forest. Each type has different behaviors. In the future, additional sectors may be added to the game.
To feed the population in a sector, compute the amount of food needed. This is done by multiplying the population by the food requirements for that sector for the given season. Use the next highest integer to "round" this computation. If the global food count equals or exceeds the amount of food needed, deduct this from the global food count, and proceed to the population reproduction step.
If the amount of food needed is less than the global food count, set actual food to the global food count and set the global food count to be 0. Calculate surviving population by computing the percentage of people fed (actual food/food needed) and multiplying this by the population. This computation is rounded down.
After the population has been fed it reproduces. In some sectors this is limited by season or other conditions. If the population can reproduce, multiply the population by the growth rate and round down. Add this number to the population.
In some sectors the total population is limited. If the population exceeds the population limit for a sector, set the population to be the population limit.
All computations, including population change occur from top to bottom, left to right. Update the cell at row 0, column 0, then the cell at row 0, column 1, ...
Example 1:
The global food count is 200. It is in the winter in a forest sector with a population of 182. Since it is winter, the forest consumes .7 food per person. This is calculated to be: 182 * .7 = 127.4 or 128. The global food count is adequate, so the entire population survives and the global food count becomes : 200-128 = 72 In the winter a forest reproduces at a rate of 30%. The new population becomes: Population change: 182 * .3 = 54.6 or 54 New Population: 182 + 54 = 236. A forest only supports 200 people. The new population is 200.
Example 2
Continuing with the previous example in a prairie sector in the winter. The population is 302. The global food count is now 72. The food required in the winter is .6 per person or 302 * .6 = 181.2 or 182. Since the global food count is below this, the actual food is set to 72. The percentage fed is: 72/182 = 39.56% The new population is: 302 * .3956 = 119.4 or 119 Strangely there is not a restriction on reproduction due to starvation, so the population in this sector reproduces by 10%. 119 * .1 = 11.9 or 11 The new population is 130
Production starts with the most recently constructed building in a sector and continues until the workforce is exhausted or all buildings have performed production. Buildings produce only if global resources are available. However, the workforce is used regardless of resource availability.
Sector bonus or penalty production is applied during production calculation (not to the units produced).
Example
A forest with a population of 30 has a sawmill (the oldest building) and a mint (the newest building). The mint is the newest building so 20 workers will be used. If there are 7 gold available, one coin will be produced. Otherwise the workers will happily sit in the building and do noting. After the workers have been assigned to the mint, there are 10 workers remaining, since the sawmill requires 14 workers to complete a task, the sawmill is not open this season. Those worker remain available for another task. If there was an older building that only required 9 workers, they would be assigned to this building.
If a sector provides additional harvesting, this amount is calculated, rounded down and added to the normal production.
Example:
A Forest has a population of 30. After production the usable workforce is 12. The following resources are produced: Wood: 1.20 * 12 = 14.4 truncated to 14 Food: 0.30 * 12 = 3.6 truncated to 3 Gold: 0.10 * 12 = 1.2 truncated to 1 In addition, if it were fall, the forest would produce extra food based on the entire population. Food: 30 x .1 = 3