New Version - June 2nd (6-2)

Status
Not open for further replies.
Now, now. All the magic is happening underneath then.

How's 'actual' calculated?
0.25 * (MedianEfficiency * modifiers - City Efficiency) - Reduce?
Actual is calculated exactly as I laid out in #2:
(needed :c5gold:/:c5citizen: - produced :c5gold:/:c5citizen:) / 0.25

Reduction from buildings occurs at #4. It is not included in actual.
 
Urbanization is calculated last, not first.

G
In the example, urbanization doesn't exist, because specialists can't be worked.

Sure, urbanization is calculated last, but the city removes specialists until the city is neutral, which happens before urbanization is calculated.
 
I'm playing a Persia autocracy game. I've taken a number of vassals. I anticipated getting sanctioned so I only traded with my vassals when trying to spread my corporation. Is it still intended for my corporate franchises to be removed from my vassal's cities when I get sanctioned?
 
Actual is calculated exactly as I laid out in #2:
(needed :c5gold:/:c5citizen: - produced :c5gold:/:c5citizen:) / 0.25

Reduction from buildings occurs at #4. It is not included in actual.
So, this is
(medianefficiency * modifiers - City Efficiency) / 0.25 - Reduce
It would have been easier to multiply by 4.


Well. In Bite's last screenshot, he had modifiers around +200%, most of it due to technology. Let's say that the average yields produced is 5 per pop for each yield.
(5 + 200% - 5) / 0.25 = 60 (not likely)
I'd rather think that it is multiplied by 0.25.
(5 + 200% - 5) * 0.25 = 2.5
This is supposing that the player equals the median efficiency.

Then, reduced by buildings.
 
So, this is
(medianefficiency * modifiers - City Efficiency) / 0.25 - Reduce
It would have been easier to multiply by 4.


Well. In Bite's last screenshot, he had modifiers around +200%, most of it due to technology. Let's say that the average yields produced is 5 per pop for each yield.
(5 + 200% - 5) / 0.25 = 60 (not likely)
I'd rather think that it is multiplied by 0.25.
(5 + 200% - 5) * 0.25 = 2.5
This is supposing that the player equals the median efficiency.

Then, reduced by buildings.

Code:
int iUnhappiness = 0;
    int iThreshold = getUnhappinessFromDefenseNeeded(0, bForceGlobal);
    int iBuildingDefense = getUnhappinessFromDefenseYield(iPopMod);

    if(iThreshold > iBuildingDefense)
    {
        iUnhappiness = iThreshold - iBuildingDefense;
        iUnhappiness /= max(1, GC.getBALANCE_UNHAPPY_CITY_BASE_VALUE_DISORDER());

        int iReduction = GetFlatNeedsReduction(YIELD_PRODUCTION);
        if (iReduction != 0)
        {
            iUnhappiness -= iReduction;
            if (iUnhappiness < 0)
                iUnhappiness = 0;

            return min(iUnhappiness, iLimit);
        }

        return range(iUnhappiness,1,iLimit);
    }

The code's structure, for distress (same for all four needs models).

You get the threshold, then the city's yield, if threshold is higher, you get the delta and divide it by the defined value (in this case, 25). You then reduce that value by the city's flat reduction, and return the value (unless the value is bigger than the remaining not-calc'd population, in which case it returns that value instead). Easy.

G
 
So, this is
(medianefficiency * modifiers - City Efficiency) / 0.25 - Reduce
It would have been easier to multiply by 4.


Well. In Bite's last screenshot, he had modifiers around +200%, most of it due to technology. Let's say that the average yields produced is 5 per pop for each yield.
(5 + 200% - 5) / 0.25 = 60 (not likely)
I'd rather think that it is multiplied by 0.25.
(5 + 200% - 5) * 0.25 = 2.5
This is supposing that the player equals the median efficiency.

Then, reduced by buildings.
BiteInTheMark's screenshot doesn't have Gazebo's newest iteration, which changed GC.getBALANCE_UNHAPPY_CITY_BASE_VALUE_DISORDER() from 100 to 25 (quadrupling the dependency on yields), while also reducing the % modifiers. You shouldn't see modifiers of +200% in his iteration.

But yes, if you did somehow manage to get modifiers of 200%, then that unfulfilled need would produce 40 unhappiness (not 60).

You can see that as the modifier increases, needs unhappiness will increase, even if a city maintains the global median throughout the game. Ways to mitigate this include:
  1. Get above the global median
  2. Get more happiness
  3. Get more unhappiness reduction.
As the game goes on, being in a winning position helps to achieve #1 (although high growth counteracts this), and sources for #2 and #3 become more plentiful.
 
Last edited:
You get the threshold, then the city's yield, if threshold is higher, you get the delta and divide it by the defined value (in this case, 25).
Steps #1 & #2.
You then reduce that value by the city's flat reduction, and return the value
Step #4.
(unless the value is bigger than the remaining not-calc'd population, in which case it returns that value instead). Easy.
Step #5.
 
Last edited:
BiteInTheMark's screenshot doesn't have Gazebo's newest iteration, which changed GC.getBALANCE_UNHAPPY_CITY_BASE_VALUE_DISORDER() from 100 to 25 (quadrupling the dependency on yields), while also reducing the % modifiers. You shouldn't see modifiers of +200% in his iteration.

But yes, if you did somehow manage to get modifiers of 200%, then that unfulfilled need would produce 40 unhappiness (not 60).
I want to mention, that the modifiers not even get halfed by the removal of the poplation modifier, but the unhappiness created by 1 yield difference to the median get quadrupled.
Does anyone believe that this will turn out well?

The maximum tech penalty is now 225%, lets say you get it down to 200%.
5 yields per pop may be a bit too high, lets say its 3 yield per pop:
(3 * 3 - 3 ) / 0,25 = 24
And dont forget: This is only the generated unhappiness for ONE yield type. There are 3 more, so you would end with 100 unhappiness. This is literally vanilla.
 
I want to mention, that the modifiers not even get halfed by the removal of the poplation modifier, but the unhappiness created by 1 yield difference to the median get quadrupled.
Does anyone believe that this will turn out well?

The maximum tech penalty is now 225%, lets say you get it down to 200%.
5 yields per pop may be a bit too high, lets say its 3 yield per pop:
(3 * 3 - 3 ) / 0,25 = 24
And dont forget: This is only the generated unhappiness for ONE yield type. There are 3 more, so you would end with 100 unhappiness. This is literally vanilla.

I think it will turn out well, because I'm not a human raincloud, unlike some people around here.

G
 
So to be clear, this version is back to the Global Median, and no longer uses the individual players median?
 
BiteInTheMark's screenshot doesn't have Gazebo's newest iteration, which changed GC.getBALANCE_UNHAPPY_CITY_BASE_VALUE_DISORDER() from 100 to 25 (quadrupling the dependency on yields), while also reducing the % modifiers. You shouldn't see modifiers of +200% in his iteration.

But yes, if you did somehow manage to get modifiers of 200%, then that unfulfilled need would produce 40 unhappiness (not 60).

You can see that as the modifier increases, needs unhappiness will increase, even if a city maintains the global median throughout the game. Ways to mitigate this include:
  1. Get above the global median
  2. Get more happiness
  3. Get more unhappiness reduction.
As the game goes on, being in a winning position helps to achieve #1 (although high growth counteracts this), and sources for #2 and #3 become more plentiful.
Thanks again, both of you.

So the formula is actually
ActualUnhappy = (MedianEfficiency * Modifiers - CityEfficiency) / Disorder (=25) - Reduce, everything expressed in hundreds.

And the values that we get on the happiness UI are: ActualUnhappy, Reduce, Modifiers, and Required (which may be MedianEfficiency * Modifiers)

Txurce is right that not every player needs to know the innerds, but it's nice to know whether the actions you are performing are useful, which you can be more lenient over.
 
I guess I missed the update it was removed. There's no way to see in game, nor can you see from these patch notes.

I'm really glad it is gone because it was an awful self defeating mechanic.

I really thought you were joking. Yes, it's been gone since before the local jump.
 
What % modifier per tech and % modifier per city are you currently working with?

100 and 4

So if you have all techs, you'll be at 100% (actually fixed a bug with this that was doubling the intended value in some instances). And each city increases it by 4%. Keep in mind there are some buildings that reduce the empire modifier.

G
 
And each city increases it by 4%. Keep in mind there are some buildings that reduce the empire modifier.
So this 4% per city is the only effect that directly punishes number of cities, correct?

In theory I could have 10,000 cities, so long as I kept their populations low.
 
So this 4% per city is the only effect that directly punishes number of cities, correct?

In theory I could have 10,000 cities, so long as I kept their populations low.

Well and culture, science, tourism scaling, etc. Those elements are not trivially increased without pop to work specialists, and you'd likely be at max unhappiness in all cities pretty quickly.

G
 
Status
Not open for further replies.
Back
Top Bottom