# [BTS][Resolved] Flood plain & Jungle Unhealthiness Calculation (is Fandom wiki incorrect?)

#### comrizen

##### Chieftain
From https://civilization.fandom.com/wiki/Health_(Civ4):
Both floodplains and jungle in the city's big fat cross cause unhealthiness, as follows:
• Jungle: 0.25 per tile
• Floodplains: 0.4 per tile
The total unhealth caused must be an integer, and is computed by summing each individual factor, rounding down each result. Thus, a city with two floodplain tiles and three jungle tiles has no health malus, because the 0.8 from floodplains rounds down to zero, as does the 0.75 from jungle.
In the game i'm currently playing, i had a city with 2 floodplain tiles (the city was founded on a third, but that was transformed into desert), and 5 jungle tiles in the Big Fat Cross.
Expectation according to wiki info was unhealth of Floor(0.4 * 2) + Floor(0.25 * 5) = 0 + 1 = 1.
Observed was 2 unhealth.
Upon removal of one jungle, observed unhealth was reduced from 2 to 1.

Hypothesis: Rounding down actually occurs after summing, not for each summand. Correct formula is Floor (0.4 * # of floodplain tiles + 0.25 * # of jungle tiles), not Floor (0.4 * # of floodplain tiles) + Floor (0.25 * # of jungle tiles) as the wiki states, and the wiki example is incorrect: 2 floodplain tiles and 3 jungle tiles give 1 unhealth not 0.

Does anyone have data to contradict this hypothesis? If so, what is going on in my game?

Spoiler Screenshots (top screenshot is before jungle removal, bottom is after the jungle has been removed from the gems tile) :

Last edited:

#### f1rpo

##### plastics
I think you're right. Good and bad feature health get rounded separately, but all bad features are summed up before rounding. Here's the source code: CvCity::updateFeatureHealth
Was already this way in v1.61, when the DLL source was first released.

#### comrizen

##### Chieftain
Perfect, thanks. I was thinking of looking through the code, but i didn't really know where to start looking. You saved me a ton of effort. I'll update the fandom wiki to reflect the correct calculation.

Replies
15
Views
935
Replies
220
Views
15K
Replies
29
Views
3K
Replies
135
Views
8K
Replies
341
Views
63K