How demands should scale on population?

tu_79

Deity
Joined
Feb 11, 2016
Messages
7,376
Location
Malaga (Spain)
There's a debate going on on how to replace crime unhappiness, as apparently it is what is causing the big swings in happiness. But whatever is decided about that, currently demand scaling is reported as being too strict.
The goal of the happiness system is twofold. For instance, it should serve as a limit on strategies that could be too effective. This is why it limits overgrowth in tall cities, and overexpansion in wide playstyle, this is why it limits the duration of wars and forces an assimilation time for conquered cities. In addition, happiness system serves as an early warning on things that are not going well. Completely ignoring culture, for example, could have a disastrous outcome in the late game, but because players try to avoid boredom in their cities, some policies are still gathered. Good.

Currently, unhappiness on city demands scales somehow linearly on techs and somehow exponentially on population. The logic behind the exponential scaling is that this way tall cities are punished for excessive growth, but in current implementation the punishment seems to be excessive, as cities with 30 population become unmanageable.
Without the happiness system, the problems of too big cities are the following. Growing too fast in the early game usually means neglecting yields (those yields are not being worked while citizens focus on food). By the late game, these cities are humongous and can outproduce pretty much any other civ, with their little costs and their easy to protect small territory, making victory very easy provided they survive the early game.

I don't think we can agree on what is the best pop size to be allowed in each situation. But maybe we could agree on how it should scale. In the early game, science and culture are very rare, found mostly on buildings. Gold is easier to find in terrain. If the city gets too big too fast, there will be too many citizens working on bad slots. So far, a linear scaling on population worked well for that time (linear means that doubling the population also doubles the required yields to keep happiness the same). But if we keep the same linear scaling for the late game, when specialists slots are more common and their yields are nice, we find tall cities swarming in happiness, or getting so big that they become unstoppable.

What I think that can work for both situations is a mixed scaling. The linear scaling can be bigger in the early game (early and late game accounted by number of techs), while a quadratic scaling can be noticeable in the late game. For example:
Linear scaler = K1 * City_size
Quadratic scaler = K2 * City_size^2 * Discovered_techs
Unhappy_citizens = (Linear scaler + quadratic scaler) * (1 - city_value_per_pop / median_value_per_pop)
when 0 <= city_value_per_pop < median_value_per_pop
K1 and K2 are constant values that will determine how big a city can grow. Quadratic demand is almost zero in the early game, and almost quadratic in the late game. Linear demand does not depend on techs, but it is included on the quadratic scaler, so it does not really matters.
Then, we only have to find good values for K1 and K2 so overgrowing is punished but not too much.

Edit. The quadratic scaler is not really needed. If it is a second linear scaler that becomes more noticeable in the late game, it already doubles the needs in the late game.
 
Last edited:
I would like to see some adjustment for the big cities needs and its good that you and others are trying to help this process. Bad thing is that I don't understand the formula. :cry::lol:

Anyway, my suggestion is that after it become unmanageable (lets say after 30 pop) demand should be treated differently. At least, if a city produce enough yield to be only -2unhappines with 30 size, the same city shouldn't produce -45unhappines when the size is 49, right? After all, it was able to produce enough yield to make 28 (30-2) citizen happy earlier and now it produce even more.

Clipboard01.jpg
 
Bad thing is that I don't understand the formula. :cry::lol:
My bad.

Let me put it this way:
K1 and K2 are constant values, let's say they are K1 = 0.2 and K2 = 0.01 for a first approach.
Citizens that are suffering from not meeting demands can be calculated as = (0.5 * City population size + 0.01 * City population size * Number of discovered techs) * (1 - Relative difference between city yields per population and the median yields per population)

Let's say your city has 20 population, you are producing 40 gold and you have discovered 25 techs, and that the median city has 12 population and produces 30 gold.
Your city gold per population is = 40 gold / 20 population = 2 gold/pop
The median city gold per population is = 30 / 12 = 2.5 gold/pop
Citizens suffering from poverty is = (0.2 * 20 + 0.01 * 20 * 25) * (1 - 2 / 2.5) = (4 + 5) * (1 - 0.8) = 9 * 0.2 = 2

If we feel this is too low for this time, we tweak K1 and K2 until we find a curve that we find enjoyable and not overpowered.
 
Top Bottom