As per this thread at apolyton and this thread at RBCiv I have fixed the code for whipping, such that it works is a much more sensible way.
Specifically:
For more info on the way it's broken in CIV just check one of the linked threads.
The use of this mod will not break save game compatibility, you can take it in and out of CustomAssets at will.
You can download the fixed CvGameCoreDLL.dll (includes CIVGameSpeedInfo.xml):
WhippingFix_CoreDLL.zip (~1.2mb)
This should go in your CustomAssets folder.
The only cpp changes are in CvCity.cpp which you can download separately:
WhippingFix_CvCityCpp.zip (~37kb)
If you know what to do with this you'll know where to put it .
C++ Code Changes:
There are two sections of modified code, both in CvCity.cpp
In the function int CvCity::hurryCost(bool bExtra) near the bottom the production bonuses are applied with rounding up instead of truncation.
The function int CvCity::hurryProduction(HurryTypes eHurry) has been rewritten with basically the code from hurryCost, but inverted.
XML Changes:
In the Epic gamespeed section of CIVGameSpeedInfo.xml the field iHurryPercent is changed from 67 to 66.
I believe this code to work 100% because I pretty much just modified the existing code in a simple way and also duplicated the code in a spreadsheet to quickly "test" a wide range of cases.
More testing can't hurt though.
Specifically:
- Production Bonuses are handled in a sane way.
- The "truncation error" is fixed which resulted in very specific hammer counts giving exceptional value whips.
- The penalty for whipping with 0 hammers invested is always applied correctly.
- CIVGameSpeedInfo.xml has been adjusted to fix whips on epic - they now give 45 hammers instead of 44.
For more info on the way it's broken in CIV just check one of the linked threads.
The use of this mod will not break save game compatibility, you can take it in and out of CustomAssets at will.
You can download the fixed CvGameCoreDLL.dll (includes CIVGameSpeedInfo.xml):
WhippingFix_CoreDLL.zip (~1.2mb)
This should go in your CustomAssets folder.
The only cpp changes are in CvCity.cpp which you can download separately:
WhippingFix_CvCityCpp.zip (~37kb)
If you know what to do with this you'll know where to put it .
C++ Code Changes:
There are two sections of modified code, both in CvCity.cpp
In the function int CvCity::hurryCost(bool bExtra) near the bottom the production bonuses are applied with rounding up instead of truncation.
The function int CvCity::hurryProduction(HurryTypes eHurry) has been rewritten with basically the code from hurryCost, but inverted.
XML Changes:
In the Epic gamespeed section of CIVGameSpeedInfo.xml the field iHurryPercent is changed from 67 to 66.
I believe this code to work 100% because I pretty much just modified the existing code in a simple way and also duplicated the code in a spreadsheet to quickly "test" a wide range of cases.
More testing can't hurt though.
Comment