Terrain feature bug: "Fresh Water"

Padmewan

King
Joined
Nov 26, 2003
Messages
748
Location
Planet
I really shouldn't call this a bug as it's something outside intended use, but I found that if you insert, via Python, a terrain feature that provides "fresh water" (e.g. an Oasis), you will NOT get the effects of irrigation.

* The main map will show an adjacent, "irrigated" farm as generating, e.g., 3 food.
* Zooming into the city shows that same tile generating not 3 but rather only 2 food.
* The city's granary bar shows a total amount of food that equals the unirrigated (lower) value.

The reason why this arises for us is that one of our improvements inserts a "fresh water" terrain feature that's part of our game's terraforming mechanism. Has anyone else run into this? Any thoughts on where this discrepancy might be handles in the SDK? (Where are per-tile yields calculated in the C++ ? I can go looking tonight, but if anyone knows offhand it would give me a head start...)
 
OK, it seems that either the game periodically "sweeps" for irrigation (but not every turn), or when irrigation is added, it has to be through cultural borders and not diagonally? Here's the setup:
Code:
XFX
I*#
X#X
* = city
X = not in culture
# = in culture
F = Fresh Water feature
I = Irrigated improvement

I noticed that in this setup, tile "I" does not get the irrigation bonus. (Note: I'm using Chalid's slower cultural expansion mod) However:

Code:
IF#
I*#
###
in this setup, where the total tiles controled is 9, both "I" tiles now get irrigation.

I haven't done enough testing to see if this was a coincidence or not. I thought that irrigation should spread diagonally... very weird. More testing needed, and a followup when I find out more...
 
that is weird....let me know if there's anything i can do
 
One of our team figured out that this happens when the Hothouse ("farm") is built BEFORE the Aerator. (The Aerator inserts a feature that is considered "fresh water"). However, if the Hothouse is built AFTER the Aerator, the right amount of food shows up in the city view and food count.

Apparently, the amount of food generated by the improvement is calculated once and then not recalculated. Not sure why this is the case, because I know that in vanilla Civ4, I've built a chain of farms using irrigation, then if I cut the chain somewhere in the middle, the end of the chain loses the irrigation bonus. I suppose chained irrigation is handled in a different part of the code than the initial check for fresh water.

PolishAssassin, if you can do SDK work and are interested in examining this further, I'd be very grateful!
 
Padmewan said:
you can do SDK work and are interested in examining this further, I'd be very grateful!

eh sorry, it's all Greek to me. however i find this plight to be very interesting so if you can, keep me posted on the endeavour
 
Back
Top Bottom