1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

New Version - June 2nd (6-2)

Discussion in 'Community Patch Project' started by Gazebo, Jun 2, 2019.

  1. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    908
    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.
     
    tu_79 likes this.
  2. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    908
    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.
     
  3. tothePAIN

    tothePAIN Chieftain

    Joined:
    Dec 31, 2018
    Messages:
    66
    Gender:
    Male
    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?
     
  4. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,361
    Location:
    Malaga (Spain)
    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.
     
  5. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    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
     
    vyyt and tu_79 like this.
  6. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    908
    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: Jun 11, 2019
    vyyt, CrazyG and tu_79 like this.
  7. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    908
    Steps #1 & #2.
    Step #4.
    Step #5.
     
    Last edited: Jun 11, 2019
  8. BiteInTheMark

    BiteInTheMark Chieftain

    Joined:
    Aug 23, 2016
    Messages:
    1,503
    Gender:
    Male
    Location:
    Germany
    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.
     
  9. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    I think it will turn out well, because I'm not a human raincloud, unlike some people around here.

    G
     
  10. CrazyG

    CrazyG Warlord

    Joined:
    Oct 14, 2016
    Messages:
    4,160
    Location:
    Beijing
    So to be clear, this version is back to the Global Median, and no longer uses the individual players median?
     
  11. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    Wait, is this a rare CrazyG troll? We haven't used the player median in ages.

    G
     
  12. Txurce

    Txurce Warlord

    Joined:
    Jan 4, 2002
    Messages:
    8,253
    Location:
    Venice, California
    Bite hacked CrazyG's account.
     
    Skidizzle, vyyt and Gazebo like this.
  13. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,361
    Location:
    Malaga (Spain)
    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.
     
    JamesNinelives likes this.
  14. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,361
    Location:
    Malaga (Spain)
    I don't blame him. So many changes so fast!
     
    JamesNinelives, Gazebo and CrazyG like this.
  15. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    908
    What % modifier per tech and % modifier per city are you currently working with?
     
    JamesNinelives likes this.
  16. CrazyG

    CrazyG Warlord

    Joined:
    Oct 14, 2016
    Messages:
    4,160
    Location:
    Beijing
    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.
     
    vyyt, JamesNinelives and Gazebo like this.
  17. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    I really thought you were joking. Yes, it's been gone since before the local jump.
     
    JamesNinelives likes this.
  18. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    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
     
    JamesNinelives and Rekk like this.
  19. CrazyG

    CrazyG Warlord

    Joined:
    Oct 14, 2016
    Messages:
    4,160
    Location:
    Beijing
    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.
     
  20. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,254
    Gender:
    Male
    Location:
    Little Rock
    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
     

Share This Page