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 - May 19th (5-19)

Discussion in 'Community Patch Project' started by Gazebo, May 19, 2019.

  1. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,462
    Location:
    Malaga (Spain)
    The last piece of code I remember capped each need at a specific percentage over iLimit, the remaining happy citizens. But this does not match with what we are seeing.

    Could you post the current code? Maybe that could enlighten us.
     
  2. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    955
    If a city has a total deficit greater than the population of the city, does the flat reduction apply before or after the unhappiness is capped at population size?

    Eg. if I have a city with a population of 20, my only local unhappiness comes from needs with a total deficit of 25 (distress deficit 7, poverty deficit 6 illiteracy deficit 6, boredom deficit 6) and I have one building that reduces distress by 1 and nothing else, is my final unhappiness 19 or 20?
     
    Last edited: Jun 6, 2019
  3. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,339
    Gender:
    Male
    Location:
    Little Rock
    Dunno what you are talking about. There's no artificial caps.
     
  4. BiteInTheMark

    BiteInTheMark Chieftain

    Joined:
    Aug 23, 2016
    Messages:
    1,504
    Gender:
    Male
    Location:
    Germany
    Hes referring to a former version with a strange unhappiness cap calculation.
    Something like only 20% of the population can be hit by distress, then 30% of the still happy population can be hit by poverty, 40% of the still happy population can be hit by illiteracy and 50% of the rest by boredom.7
    Youve made such system in the very beginning of the happiness change (or it was atleast discussed). And I thought later on, you made it like, no single unhappiness type can have more uhappiness than 50% of the total population.

    Seriously..... WTF.
    Ive noticed now something I had warned already right in the beginning of the introduction of the public works:


    Ahmad Al Mansur has already spend over 25.000+ hammer into public works in his capital. (Public works didnt get any cost reduction by difficulty, but cost reduction for buildings enable him to spend a lot of saved hammers into public works)
     
    Last edited: Jun 6, 2019
  5. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,339
    Gender:
    Male
    Location:
    Little Rock
    No such artificial limitations exist. We experimented with it but all of that was tossed when we went local.

    Projects do not get a difficulty modifier. If the AI runs out of things to build, they will likely build public works, because they're a decent long-term investment.

    G
     
    JamesNinelives likes this.
  6. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,339
    Gender:
    Male
    Location:
    Little Rock
    I'm going to post a new mid-version sometime today or tomorrow that removes the pop modifier for unhappiness. We'll see how that treats everyone.

    G
     
    JamesNinelives likes this.
  7. BiteInTheMark

    BiteInTheMark Chieftain

    Joined:
    Aug 23, 2016
    Messages:
    1,504
    Gender:
    Male
    Location:
    Germany
    I know this, but it doesnt make any difference, if I have a decent discount on everything or a strong discount on buildings/units and be able to spend the saved hammers into public works. Public Works is another option to translate the production advantages of the AI into a game mechanic it shouldnt have. Beeing able to create infrastructure much faster which gets translated into less unhappiness one thing (and accepted), but public works is in first place another option for the AI to outperform the human, but far less an "emergency button" for the player.
    If you want an emergency button for happiness, It make no sense to pay it with hammers, cause this is already the limiting factor for infrastructure and with it happiness.

    An option I would really consider and favourise, is using food to pay the public works:
    Public works always need only one turn to be finished, but removes food from your city. The cost increase works per era and any time youve constructed it like it is now.
    To unlock the option, your cities amount of necessary total food to grow to the next citizen must be greater than the cost of the public works, else its blocked. (If you need a total of 2000 food to get a new citizen, you cant use the public works, if it needs 2100 food). This way, you can activly reduce the population of your city and with it the unhappiness, it limits the amount of times you can repeat (at the moment its unlimited) and it increases the worth of food.
    This way, public works would work hand in hand with civs like India or Spain, converting their food advantage into happiness, which allows a greater usage of their UA.
     
    Bromar1 likes this.
  8. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,462
    Location:
    Malaga (Spain)
    Exactly. Now I see "illiteracy 0: Deficit 3 (up to 0)" and I don't get how the 0 is obtained. This is not half the population of the city being already unhappy, isn't it? If I sum up all the 'ups to' it does not achieve half the population.
     
  9. Omen of Peace

    Omen of Peace Chieftain

    Joined:
    Mar 22, 2018
    Messages:
    243
    Gender:
    Male
    I'd also like to understand the "up to" - I also thought they were tied to the cap system, which in truth is not present.
    Is it "3 (reduced to 0)" or something completely different?
     
  10. Bhawb

    Bhawb Chieftain

    Joined:
    Nov 11, 2018
    Messages:
    500
    Deficit A (up to B) is translated as: this yield has a deficit of B yields per pop, but will only generate up to A unhappiness. The difference between A and B is the amount of -unhappiness from that yield that you have from buildings. The "up to" is referencing the fact that a city cannot have more unhappiness than it has population. If you had a 10 population city with over 10 unhappiness, any sources of unhappiness over the first 10 would not be applied.

    So if you have Illiteracy 0: Deficit 3 (up to 0), it means you have a deficit of 3 science per population, but you have buildings which grant a total of at least -3 unhappiness from illiteracy so there is no total unhappiness.
     
  11. CrazyG

    CrazyG Warlord

    Joined:
    Oct 14, 2016
    Messages:
    4,233
    Location:
    Beijing
    Thank you for this explanation. I had a very different understanding.

    The language used to explain the happiness system in game could be improved.
     
    wobuffet likes this.
  12. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    955
    If you have:
    Illiteracy 2: Deficit 6 (up to 4), then you have buildings that reduce unhappiness by 2, but you're near the unhappiness cap before including illiteracy, so it only partially gets counted?

    What takes priority, needs unhappiness or other sources (religious division, isolated etc)?
     
  13. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    955
    Does unhappiness reduction apply before or after the unhappiness cap?

    If I have a city with 20 population and unhappiness:
    distress Deficit 7
    poverty Deficit 6
    boredom Deficit 6
    illiteracy Deficit 6
    and one building that reduces distress by 1, what is my final unhappiness?
     
  14. Gazebo

    Gazebo Lord of the Community Patch

    Joined:
    Sep 26, 2010
    Messages:
    17,339
    Gender:
    Male
    Location:
    Little Rock
    Before. So 7(6), 6, 6, 2
     
  15. Bhawb

    Bhawb Chieftain

    Joined:
    Nov 11, 2018
    Messages:
    500
    1) Yes, that city could only take 2 more unhappiness before it hit the cap, and thus only 2 of the unhappiness was applied.
    2) It goes in order from top to bottom as displayed in game. It goes Distress, Poverty, Isolated*, Religious Divison**, Illiteracy, Boredom, Urbanization. *I'm not entirely sure where Isolated goes but I think it is in the middle here, **I'm pretty certain Religious Division goes here.

    And as G said it goes reductions first, otherwise you'd end up with some "free" happiness buffer situations. Also I think that is why Urbanization was moved to the bottom, so that the cap on specialists works out properly.
     
  16. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,462
    Location:
    Malaga (Spain)
    I guess the part that eludes me is that reductions from buildings are expressed in the 'up to' section.
    If the building reduction was applied to the deficit section that would make more sense.

    Then, if that's how it is actually calculated, then having high efficiencies should still matter. Cities should be able to have half their population unhappy, even with every building built.
     
  17. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    955
    As @Gazebo said, deficit is explicitly not happiness. It is the amount of yields per citizen that you're missing. If the reduction was included in deficit, the buildings would need to say something like "reduces the required science per citizen by one" instead of "reduces illiteracy by one".

    Deficit <value>: the number of yields missing per citizen, causing unhappiness for that need.
    Up to <value>: the maximum possible unhappiness that need can have for this city (equals the deficit value without unhappiness reduction).
    <value> from <need>: the actual unhappiness that need is currently producing (equals the up-to value unless the city has hit the max population unhappiness cap).

    What else modifies "Up to"? I remember seeing it before the static happiness rework, but I guess that was before deficit was modified to "per citizen" from "total missing".
     
    Last edited: Jun 7, 2019
  18. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    5,055
    Btw, where any recent changes made to spying? Spying used to be a solid, reliable way for me to play catchup.

    In the last 4 games, I couldn't steal a tech to save my life. In the 5 star cities early game it says....67 turns for a tech!!!
     
  19. tu_79

    tu_79 Warlord

    Joined:
    Feb 11, 2016
    Messages:
    6,462
    Location:
    Malaga (Spain)
    In this depiction, it's not clear in the UI where the building flat bonuses are applying. Let's accept that, without any building, the limits on unhappiness from needs is 50% of the city population. So, as the summation of all limits is less than half the city population, we must infere that the reductions are applied to the limit values. But this is not how we are told that unhappiness is calculated.

    Let me use an extreme example. Consider that only distress exists as a need. In a 10 pop city, only 5 pop can suffer from distress, as designed. Suppose that our food yield is so low that distress could value 7, but it is capped at 5 due to city size.
    It reads
    *) Distress 5, Deficit 7, up to 5
    Now we build a Barracks, giving -1 to distress.
    How is it going to read?
    a) Distress 5 , Deficit 6, up to 5
    b) Distress 4, Deficit 7, up to 4

    Gazebo says that the current formula works with case a, but at the UI it looks like it works with case b. If it works with case b, as it seems, then building bonuses are removing the dependency on yield efficiency, as Bite is claiming.
    If we used case a, then happiness reductions from buildings won't be noticed when deficit is too much over the cap. In the given example, we need 3 distress reductions before the city loses 1 unhappiness, because deficit is so high. If we are using case b, then one single building bonus lowers unhappiness by 1 always.
    This could explain also why happiness is so easy to handle in this iteration.
     
  20. Rekk

    Rekk Chieftain

    Joined:
    Dec 9, 2017
    Messages:
    955
    How much of your argument matters if there is no cap on any given need, which is the case here? There is only a cap on the total unhappiness.

    For example a 1 population city with 6 distress reads:
    1 from distress
    Deficit 6 (up to 6)

    Add a barracks:
    1 from distress
    Deficit 6 (up to 5)

    You're right. The reductions aren't noticed if your deficits are too high.
     
    Last edited: Jun 7, 2019
    CrazyG likes this.

Share This Page