Virtue health is not fractional

omniclast

Prince
Joined
Aug 27, 2014
Messages
478
I have played around in IGE, and I've discovered that fractional health from virtues isn't actually fractional. It only applies when fractions from that specific virtue reach the nearest whole number. Fractions from different fractional virtues do not add together.

First off, you'll notice that in the health breakdown the "health from Virtues" number is always a whole number. This could just be a rounded description, so I tested whether fractional health would cancel fractional unhealth. (Note, net health always rounds up in the player's favour.)

Say you have one city with 3 population, your health will be:
(1 x -4) + (3 x -0.75) + 9 base = -4 + -2.25 + 9 = 2.75 = 3

We would expect that adding 1 trade unit x 0.5 h would yield 3.25 and round up to 4. It doesn't; health stays at 3. Nor does 3 military units x 0.25h increase health to 4. It only increases when you add 2 trade units or 4 military units.

So the whole number health from virtues really does appear to be a whole number.

Next, fractional unhealth does not stack. So for example With Public Security (0.25h / military unit) and Profiteering (0.5h / trade unit), you would expect that 2 military units and 1 trade unit would add together to give you an additional 1 health. They do not. In order to get 1 health from either, you need either 4 military units or 2 trade units; the fractions don't add together.

Not only does Magnasanti not stack with other fractional virtues, it does not stack between cities. You only get 1 health from Magnasanti when you have 5 buildings in the same city. Also, the 1 health doesn't kick in until the turn after the 5th building is completed (though I can't confirm that since you don't actually build buildings in IGE).

This suggests that each virtue has its own counter towards whole health numbers, rather than actually adding fractional health. In Magnasanti's case, the counter is specific to each city.

TL;DR:
- Magnasanti is actually 1 health per 5 buildings in a city
- Public Security is actually 1 health per 4 military units
- Profiteering is actually 1 health per 2 trade units

Not sure this will significantly affect anyone's play, but if you see weird errors when you're between -1 and 1 that you can't figure out, this is probably why.
 
Since it appears the programmers used integer variables for health, it doesn't round, but truncates the results...

It appears the same thing is happening with trade routes also.
 
Since it appears the programmers used integer variables for health, it doesn't round, but truncates the results...

It seems weird that it truncates each virtue individually, rather than adding them together and then truncating. This seems to be similar to how the health penalties are applied -- each city loses X% from its yield, the yield is truncated, and then added to the total.

If they used integers for all the intermediate data this would make sense, but they clearly didn't. City yields are shown as fractional on the city screen, and unhealth from population is fractional in the health dropdown -- so the non-integer values are actually stored somewhere, and then deliberately converted to integers before being summed.

The exception case being unhealth from population. Population from all cities is considered a global variable, so effectively unhealth from all the cities is added together before rounding. Kind of annoying that unhealth is calculated that way but virtue health isn't.

Anyway the main gripe I have is with the incorrect tooltips. If it says 0.25 health per unit, you really should be getting 0.25 health per unit...
 
BE Health is a renamed Civ V happiness with a much less severe penalty.
Which behaved exactly the same way:

(Monarchy's bonus for pop wasn't fractional but instead was every other citizen reduced pop unhappiness by 1.
Universal Suffrage wasn't fractional but instead every other specialist in a given city reduced specialist unhappiness by 1, starting with the first. [In a non capital, there was interaction with Monarchy in the capital.])

As to science yield in cities which does have a fraction with BNW (maybe G&K as well), behind the scenes, that's actually an integer as well. (A display of 32.54 is stored internally as 3254. This wasn't changed for BE.)
 
Universal Suffrage wasn't fractional but instead every other specialist in a given city reduced specialist unhappiness by 1, starting with the first.

I didn't know this. Seems like something they should make clearer in the descriptions, especially since they've gone a lot further with fractional health in BE.

As to science yield in cities which does have a fraction with BNW (maybe G&K as well), behind the scenes, that's actually an integer as well. (A display of 32.54 is stored internally as 3254. This wasn't changed for BE.)

Really? Because in practice the full decimal value isn't used. With two cities and OERs, and with -10% culture penalty, you will have 2.70 culture in your cap and 1.80 culture in your first city, but you will only have 3 culture globally -- which would mean the numbers are being added as 200 and 100 rather than as 270 and 180.
 
I didn't know this. Seems like something they should make clearer in the descriptions, especially since they've gone a lot further with fractional health in BE.

Really? Because in practice the full decimal value isn't used. With two cities and OERs, and with -10% culture penalty, you will have 2.70 culture in your cap and 1.80 culture in your first city, but you will only have 3 culture globally -- which would mean the numbers are being added as 200 and 100 rather than as 270 and 180.

Culture didn't get the X 100 variables in BNW (or G&K), only Science and Food did.
My guess is that BE continued this practice of only giving the precision to science & food.
 
Culture didn't get the X 100 variables in BNW (or G&K), only Science and Food did.
My guess is that BE continued this practice of only giving the precision to science & food.

They wanted much more fine-grained control over Science and Food growth rates and multipliers. Getting 10% science still means something when you have only 3bpt.

If you want more control over culture (i.e., less rounding) you could (mod) multiply all the culture numbers in the game by 10.

Heck, multiply all the yields by 100 and you could suss out the TR dynamics much more easily.
 
Since it appears the programmers used integer variables for health, it doesn't round, but truncates the results...

It appears the same thing is happening with trade routes also.

We've seen this with culture already. That -10% unhealth culture penalty pre-patch was actually much worse because than 10% it was effectively -1 culture per city, from cities that had only 3-5 culture.

Does this apply to the %Health building buffs? +20% health seems a LOT worse all of a sudden. Bionics Lab, we hardly knew ye.
 
Top Bottom