General Happiness Issues

Except for war weariness I dont have any happiness problem in the lattest patch. I dont stop growth, my cities are focused on production since im playing domination thou.
 
I will try a new game and try to repeat the outcome of my last game, but I cant promise I will achieve it till maybe the next version is online (and with it all the collecte information get useless :cringe:)
What do you guys think about the happiness drop in my savegame?
What do you think about the 4 toppics i meantioned in the first comment?

Edit: I can't believe, rounding errors are able to increase or decrease my need modifiers that way. But, if it's really that way, even the new version will not fix it, cause you can't fix rounding errors. But I will check the median values in my cities, if they have changed greatly.
I'm not too experienced with the mod yet to identify the causes and effects, but I agree I've seen massive jumps on my happiness. It's been a non-issue for most of the game, but now I've entered the Industrial era and my happiness dipped from 20 to -10.
Did this happen in this version? Did it happen in one turn?
 
Last edited:
On a totally unrelated note, how does one mute another user on these forums?
upload_2018-10-15_22-7-38.png
 
What exactly happen when you mute someone? You don't see his posts at all o or his posts are censored?
 
OK, please help me in finding my error:
Gazebo said, happiness jumps are a result of rounding errors (but he never said, in which part of the calculation the error happens), but he also said, such jumps will not happen anymore, cause the global median is now saved in every city.
The conclusion, the rounding errors are happening in the global median calculations.

The problem is, if rounding errors happen in global median calculation, those rounding will happen all the time. And complete random. No matter what you do in your empire. And cause the 4 medians are independent of each other, the chance, all 4 are getting a rounding error in all your cities at the same time, are really low.
Additionally, everyone reports those issues after researching a tech (which sometimes lead into a new era) or the conquest of an AI.
The chance, such rounding errors happens for all 4 instances at once and only if you research a new tech is.... Close to Zero.

Additionally I watched a huge decrease in need modifiers for all my cities, even nothing in those cities or my empire have changed.
The global median has nothing to do with my personal need modifiers. What was causing this tremendous decrease of need modifier?

Any idea?
 
OK, please help me in finding my error:
Gazebo said, happiness jumps are a result of rounding errors (but he never said, in which part of the calculation the error happens), but he also said, such jumps will not happen anymore, cause the global median is now saved in every city.
The conclusion, the rounding errors are happening in the global median calculations.
That isn't where a rounding error happens. This is what I think happens.

Let's say that you have a 20 pop city. Now let's say you need 5 culture per citizen to keep them happy. You would have 0 boredom with 100 culture. What if you have 99 culture? You would kind of get 1/5 of an unhappiness. However, it rounds up to 1 happiness. So if the same thing happens with illiteracy, poverty, and distress, you might be generating 4 unhappiness on that city, even though your "true" total would be a fraction of that.

If you have several cities with the same situation, you see how it can swing so wildly. The issue really isn't the global median as a concept. The issue is rounding, you cannot have fractional happiness. And because happiness is split into so many different categories across different cities, a tiny change can alter the rounding a lot.
 
OK, please help me in finding my error:
Gazebo said, happiness jumps are a result of rounding errors (but he never said, in which part of the calculation the error happens), but he also said, such jumps will not happen anymore, cause the global median is now saved in every city.
The conclusion, the rounding errors are happening in the global median calculations.

The problem is, if rounding errors happen in global median calculation, those rounding will happen all the time. And complete random. No matter what you do in your empire. And cause the 4 medians are independent of each other, the chance, all 4 are getting a rounding error in all your cities at the same time, are really low.
Additionally, everyone reports those issues after researching a tech (which sometimes lead into a new era) or the conquest of an AI.
The chance, such rounding errors happens for all 4 instances at once and only if you research a new tech is.... Close to Zero.

Additionally I watched a huge decrease in need modifiers for all my cities, even nothing in those cities or my empire have changed.
The global median has nothing to do with my personal need modifiers. What was causing this tremendous decrease of need modifier?

Any idea?

If I understood it right, the problem was that as happiness is dealing with integer values, the slowly changing global median has the effect of not changing happiness for a long time, and then at the next slight increase (without a clear incident for the players to see) the happiness in a city suddenly jumps up. This happens for every city individually. Now, the problem was that these happiness flips probably tended to cluster as apart from some exceptions, the infrastructure level in and around your cities will be similar resulting in similar yields for your cities. That's why many of your cities may have the happiness jump at the same (or a close) time, resulting in a large happiness swing in total. The probability of that happening is even larger when needs change faster, as a result of a researched tech for instance.

This is addressed in the New version by tying the happiness changes for every city to that city's growth event. As these don't happen at the same time usually, but are quite wide-spread, this should smooth out the happiness curve. The integer jumps of happiness are still there, they are just much more predictable now as they happen at city growth.
 
That isn't where a rounding error happens. This is what I think happens.

Let's say that you have a 20 pop city. Now let's say you need 5 culture per citizen to keep them happy. You would have 0 boredom with 100 culture. What if you have 99 culture? You would kind of get 1/5 of an unhappiness. However, it rounds up to 1 happiness. So if the same thing happens with illiteracy, poverty, and distress, you might be generating 4 unhappiness on that city, even though your "true" total would be a fraction of that.

If you have several cities with the same situation, you see how it can swing so wildly. The issue really isn't the global median as a concept. The issue is rounding, you cannot have fractional happiness. And because happiness is split into so many different categories across different cities, a tiny change can alter the rounding a lot.
If that's the case then unhappiness per need in every city could be stored as multiplied by 100 and total unhappiness in a city would be a sum of all unhappiness per need divided by 100.
So instead of:
Code:
5 * [ round(1/5)] = 5
it would be:
Code:
5 * [ round(1/5 * 100)] / 100 = 5 * 20 / 100 = 1

That change wouldn't affect happiness calculations outside a city, only inside.
@Gazebo is it feasible?
 
OK, thanks for the replies. Your arguments are understandable. But still. The rounding error would happen all the time. In every turn. In every city independently. Not concentrated on one point for all 4 happiness categories and all cities same time. The chance this is happening is nearly zero.
Let's say, the chance for the happening of a rounding error of one category in one city is 50%. The chance this is happening for all 4 categories in one city is 0.5^4=0.0625 - > 6.25%
The chance this is happening at same time in 4 cities (16 rounding errors) is 0.5^16=0.0000152 = 0.00152%.

Additionally, the biggest happiness jump happened in the uploaded save game. It changed by 60 in one turn in a 6-city empire. Do you want to tell me there's happening 10 rounding errors for 4 values in every city?

The probability of that happening is even larger when needs change faster, as a result of a researched tech for instance.
But this is changing only the modifier, not the median itself.

Rounding errors of median also don't explain why empire wide my need modification went down by 50% in every category in every city, after Polynesia was conquered. The only possible influence by that is the changed tech median, which lowered my tech lead by one tech.
 
OK, thanks for the replies. Your arguments are understandable. But still. The rounding error would happen all the time. In every turn. In every city independently. Not concentrated on one point for all 4 happiness categories and all cities same time. The chance this is happening is nearly zero.
Let's say, the chance for the happening of a rounding error of one category in one city is 50%. The chance this is happening for all 4 categories in one city is 0.5^4=0.0625 - > 6.25%
The chance this is happening at same time in 4 cities (16 rounding errors) is 0.5^16=0.0000152 = 0.00152%.

Additionally, the biggest happiness jump happened in the uploaded save game. It changed by 60 in one turn in a 6-city empire. Do you want to tell me there's happening 10 rounding errors for 4 values in every city?


But this is changing only the modifier, not the median itself.

Rounding errors of median also don't explain why empire wide my need modification went down by 50% in every category in every city, after Polynesia was conquered. The only possible influence by that is the changed tech median, which lowered my tech lead by one tech.
You might be right. I'm not convinced of the rounding thing either. But it is useless to insist, since G thinks that was the problem. Just prove him wrong with a new save game.

Besides, linking pop size to tech median values has another benefit of simply ignoring irrelevant civs that might be moving the median when eradicated.
 
You might be right. I'm not convinced of the rounding thing either. But it is useless to insist, since G thinks that was the problem. Just prove him wrong with a new save game.

Besides, linking pop size to tech median values has another benefit of simply ignoring irrelevant civs that might be moving the median when eradicated.
Moving the median after one less AI didnt cause any problems, in most cases those are backyard nation with low tech. After they disappear, the median rises and all other nations get happier.
But it might be a future feature, if those backyard nations have low pop and get more happiness, cause the modifier scales the median higher than it would be with the normal median, it could help a bit. But in the same time, tall play science nations in the mid of big low tech nation would suffer more by the penalty. I am open for it, maybe you could check one of your games and calculate the new median by the formula and look if there's a major difference. The pop and tech information is easy to check.
 
OK, thanks for the replies. Your arguments are understandable. But still. The rounding error would happen all the time. In every turn. In every city independently. Not concentrated on one point for all 4 happiness categories and all cities same time. The chance this is happening is nearly zero.
Let's say, the chance for the happening of a rounding error of one category in one city is 50%. The chance this is happening for all 4 categories in one city is 0.5^4=0.0625 - > 6.25%
The chance this is happening at same time in 4 cities (16 rounding errors) is 0.5^16=0.0000152 = 0.00152%.

Additionally, the biggest happiness jump happened in the uploaded save game. It changed by 60 in one turn in a 6-city empire. Do you want to tell me there's happening 10 rounding errors for 4 values in every city?
My post is not an argument. Its an explanation of how a mechanic works. Do you want to really want to improve this mod? Stop viewing this issue as a you vs someone else issue.

The divisions by city, division by yield type, and rouding all serve to magnify what are relatively small changed in the median tech over time.

I assure you, if we made a patch with national level happiness of just 1 kind, it would be dramatically less swingy. There are a couple of things that could cause a big swing (a civ low on tech dieing is one of them), but it would be really smooth most of the time.

I don't know how to address the above. Maybe some kind of dummy variable, or scaling happiness by a factor of 10, we need the coders to help (so please stop being so rude to G).
 
I think we are getting ahead of our selves. The first order of business is to demonstrate (on the latest patch), that a happiness drop can occur that is basically unrecoverable....that when it happens the player has no recourse in terms of buildings and luxuries to get out of the issue.

If we prove that is a true scenario, then we can dig in to why its occurring. Bite has some saves from the previous version, so we need to do the same with this version.
 
My post is not an argument. Its an explanation of how a mechanic works. Do you want to really want to improve this mod? Stop viewing this issue as a you vs someone else issue.

The divisions by city, division by yield type, and rouding all serve to magnify what are relatively small changed in the median tech over time.

I assure you, if we made a patch with national level happiness of just 1 kind, it would be dramatically less swingy. There are a couple of things that could cause a big swing (a civ low on tech dieing is one of them), but it would be really smooth most of the time.

I don't know how to address the above. Maybe some kind of dummy variable, or scaling happiness by a factor of 10, we need the coders to help (so please stop being so rude to G).
Rude? Yeah, sometimes I forget me a bit, but in this case I feel totally fooled by him. The best way to make me quiet is to simply answer with arguments, instead one word answers or zynical words.

I can now definitely confirm, at least in the last version, rounding errors of the median are not the source of the jumps.
You can check it by yourself, compare the values in the turn of the save and the turn after (second save of page 7 10-10 thread). Between the turns I discovered a technology.
The medians are changing as followed:
Distress 4,78 - > 4.806 +0,5%
Poverty 4,43 - > 4,44 +0,22%
Illiteracy 3,706 - > 3,709 +0,08%
Boredom 4,047 - > 4,039 - 0,2%

Most interesting is boredom.... The median decreased, but unhappiness by boredom increased by 5 in my empire. And why? Cause in every of my city, for every category, the need modifier increased by 20%.
I don't have the picture here, but the modifier increased from around +100% to +120%. So distress need increased from 9,56 to 10,573 for every pop. A change of 1.013. Remember, the pure median changed by 0,026.
Modified with +100%, this is 0,052. To summarize, the pure increase of the median only makes 5% of the increase. The rest is all the modifier, which hit me. And in the case of boredom everything comes from the modifier. 20% more sounds not that much. But I sold my need reduction building with 75%, and in the end, it increased by 16%. So, one -75% need reduction building didn't even cover one tech median level modifier.

And the last save I uploaded gave me 60 positive happiness, cause Polynesia disappeared. The tech median raised only by one (which should reduce the modifier in my cities by 20%), but the needs decreased by 50%. No clue what happened there. I will give you an another comparison of medians in this case, but I am pretty sure, the median will not have changed that much to explain this.
 
Last edited:
Rude? Yeah, sometimes I forget me a bit, but in this case I feel totally fooled by him. The best way to make me quiet is to simply answer with arguments, instead one word answers or zynical words.

I can now definitely confirm, at least in the last version, rounding errors of the median are not the source of the jumps.

Bite....G has been extremely clear that he will not accept arguments from previous versions. I know you don't agree with that (I also don't agree with it), but he is the man making the mod, he gets to do things his way. Providing information from the previous mod is a waste of our time at this point, because G will not consider it valid and will not make any changes based on it. If you want to actually see changes happen, we have to make arguments with the latest version....its as simple as that.
 
Back
Top Bottom