Problem with science overflow?

jkp1187

Unindicted Co-Conspirator
Joined
Aug 29, 2004
Messages
2,496
Location
Pittsburgh, Pennsylvania
Every once in a while, I notice that the calculated "turns remaining" science rate tends to be wrong. I thought I was imagining it at first, but I noticed this post at 'another fine Civilization forum', which I thought I would pass on for the general good.

See generally: http://apolyton.net/forums/showthread.php?s=&threadid=157232

The research overflow bug is that overflow beakers are not adjusted by the discounts.

Both the whipping and research overflow bugfixes are included in this compiled CvGameCoreDLL, you may safely put it in your CustomAssets folder and use it for games in progress.

Description:
ie: You generate 50 beakers per turn.
- You finish research on a tech at 99/100 beakers, so 50 beakers overflow [there is always +1 beaker from the ether].
- You start researching a tech with a 40% discount-bonus (so 50 beakers become 70).
- The next turn the new tech will at 121 beakers (50+71) - while it should be at 141 (70+71).

Fix:
The overflow bugfix simply involves changing line 10968 in CvPlayers.cpp

From:

Code:
    iOverflowResearch = getOverflowResearch();

To:

Code:
    iOverflowResearch = (getOverflowResearch() * calculateResearchModifier(getCurrentResearch())) / 100;


Interestingly the bug is not present in the code to display the number of turns remaining - in other words, in v1.61 there can be a mismatch between turns displayed and actual turns. This is naturally fixed.
 
Top Bottom