Add some kind of "demolish excess" for all building types once max_XXX reached. Group food items together
Have a buffer for max_XXX resources, so that building placement to gain resources takes place at a slightly lower level than at which excess buildings are demolished, so if there is a fluctuation it doesn't start building as soon as the stored resource count drops slightly. Say a buffer of 10, so max_XXX is actually a lower max of max_XXX - 10 and max_XXX + 10
Add some kind of "demolish excess" for all building types once max_XXX reached. Group food items together
Have a buffer for max_XXX resources, so that building placement to gain resources takes place at a slightly lower level than at which excess buildings are demolished, so if there is a fluctuation it doesn't start building as soon as the stored resource count drops slightly. Say a buffer of 10, so max_XXX is actually a lower max of max_XXX - 10 and max_XXX + 10