dylansan
Warlord
But it doesn't though? In order to show 0 (max 6) it already has to calculate that 6. How does making the 6 the main piece of information require any more code or computation? Either of my examples would only use numbers which are already present in the current implementation, plus some simple division in the second example.Current algorithm stops calculating unhappiness from the other needs when the population is reached, so it avoids running some unnecessary code and improves performance.
I think previously, if the unhappiness limit was reached before calculating a need, it would skip it as you mentioned, though G has already changed that, I believe. But think about what that meant. You argued that "You know now that 0 illiteracy (max 6) means that you have a severe problem with illiteracy that is not hitting yet because the city is already 100% unhappy." But previously (and I didn't realize this), that information wasn't shown at all, so there was no indication that there was any problem at all with your city's science, even if it was actually the yield with the biggest deficit. That's terrible. You can say it's rare, but it's going to happen in every single game, especially at the beginning, when build order and yields have the biggest impact on the future progression of the game.But since this situation may only happen rarely, and given that G is willing to make the code compute every potential unhappiness, it could be shown as you did in your first example.
13 unhappiness (limited to 4 due to population)
Showing zero is better than not showing it at all, but why not just focus the tooltip on which deficits are highest, if that's the information you want? The other numbers are mathematically arbitrary. The unhappiness of a city is always the sum of all the deficits of all the needs, capped at the population. Putting that unhappiness into "distress" slots before "poverty" before "illiteracy" is purely a UI implementation and therefore is not accurately representing the state of the game. You could just as easily do illiteracy first, then culture, etc. and nothing would change functionally, but the player would interpret it completely differently. If the player's interpretation of the same game state changes depending on an arbitrary choice of which yields to calculate first, then there is no "correct" choice. My examples don't use "slots" or any extra layer of obscurity. The illiteracy will always go down when you improve science. If poverty is higher than distress then you know your gold deficit is higher than your food/prod deficit. And it's clear that you have to reduce 13 unhappiness, not 4, to see a difference in your empire's actual happiness.