Just pushed to SVN, fairly major piece of work, plus a few miscellaneous bug fixes for the recent CTDs reported.
The major thing is that I have added a key sequence (ctrl-shift-R) which will force recalculate ALL modifiers and bonuses based on current assets.
The reason this is (and has been for some time) needed (for modders and SVN users especially) is that in regard to most modifiers (from various sources such as civic, building, trait, etc.) the game only maintains aggregate totals as they apply to various entities (players, teams, cities, areas, plot groups), and dead reckons them by just adding changes to the totals as they occur. What this means is that if assets change between getting something that applies a modifier and losing it again, the amount subtracted when you lose it won't match the amount that was originally added when you first got it, and thus the totals will gradually get more and more distorted (for example, switching into one definition of a civic, and then switching out later when it has a slightly different definition). It also means that any bugs which cause spurious changes to these aggregate values never get corrected.
In the latest build however, if you press ctrl-shift-R and go make a cup of coffee (this is NOT a fast operation - takes about 4 minutes in my late industrial giant map game - which is why it can never be done automatically as part of load), it will recalculate all the aggregates from first principles. It takes account of:
- Civics
- Buildings
- Projects
- Specialists
- Worked tiles
- Trade
- Leader and Civ traits
- Events that are purely defined by their XML
It does NOT (and cannot since the game never records what they did) take account of changes made directly by Python calls as a result of some trigger (like an event that relies on Python to do its dirty work). Any changes due to such events will be lost (but I don't think there are any currently).
Internally, this has been a fairly massive change, and I've been debugging it for about 3 days, so take that as a health warning. I have probably missed some contributions, so if you suspect an error post the save game of the before-recalc state together with as much detail as you can of what you think it got wrong. Note that it's actually quite hard to figure out if it got it right or not for any game in which the assets have changed, since quite large changes can actually be entirely correct - I actually spent several hours today trying to pin down why my building gold had dropped so much, but in the end it turned out to be correct - it was just that the save I had had huge distortions built up since I started it (on V15!) which made the difference between solvency and -1700 gold per turn insolvency!