Just pushed to SVN (3350):
- Fixed CTD from a logging bug (happened when city defenders were killed)
- Experimental new system for evaluating the enabled-buildings aspect of techs by the AI (see below)
It was pointed out recently that the AI is suffering in scientific progress with the current prehistoric tech tree, due to often not bothering with cultrual identity for a long time (so no elder councils). On investigation I discovered that the AI uses a totally different building evaluator for techs than it does for city build decisions. The tech one is MUCH, MUCH cruder (and has none of the improvements that we've made to the city build choice one over past revisions), and in particular totally ignored science mods on enabled buildings.
It also turns out that the AI ignores modifiers to existing buildings that come with techs (think stone tool maker!).
I have now rewritten the offending section to use a variant of the city-build-choice evaluation code (so all building evaluation is basically now in one place), and to account for modfiers from techs for existing buildings. I also gave a boost generally to research changes that are an appreciable proportion of the civs current total, in all building evaluation - thus 4 bulbs extra from a building early on (when your total is probably only 20 or so) is huge, whereas the same benefit later is worth much less - the effect is again to boost things like elder councils in the early one-city stage of the game.
Because it's experimental at this stage it will certainly need some tweaking, so to help with this I have done two things:
1) Added quite detailed logging to the BBAI log on its evaluation of techs
2) Left in the old building value calculator AS WELL as the new one (small performance hit, but it's very small) and logged both values, so the logs clearly show where things are changing (I'll remove the old version once we're happy the new one is behaving right)
For anyone with the level of interest, if you examine your BBAI logs (assuming you have it enabled to level 3), you'll see this kind of thing:
Code:
[37719.855] Player 3 (Zulu City State) calculate value for tech Cultural Identity
[37719.855] Misc value: 1
[37719.855] Corporation value: 0
[37719.855] Promotion value: 0
[37719.855] Tile improvement value: 0
[37719.855] Build value: 0
[37719.855] Reveal value: 0
[37719.855] Reveal value: 0
[37719.855] Player 3 (Zulu City State) evaluating buildings for tech Cultural Identity
[B][37719.855] Building Elder Council old mechanism value: 400
[37719.855] Building Elder Council new mechanism value: 1120[/B]
[37719.855] Building Military Standard (Animal mascot) old mechanism value: 250
[37719.871] Building Military Standard (Animal mascot) new mechanism value: 120
[37719.871] Building value: 1240
[37719.871] Player 3 (Zulu City State) raw value for tech Cultural Identity is 2241
...
[37719.902] Player 3 (Zulu City State) calculate value for tech Scraping
[37719.902] Misc value: 1
[37719.902] Corporation value: 0
[37719.902] Promotion value: 0
[37719.902] Tile improvement value: 0
[37719.902] Build value: 0
[37719.902] Reveal value: 0
[37719.902] Reveal value: 0
[37719.902] Player 3 (Zulu City State) evaluating buildings for tech Scraping
[B][37719.902] Building Stone Tool Maker is modified. We have 1 of them, total value: 160[/B]
[37719.902] Building value: 160
[37719.902] Player 3 (Zulu City State) raw value for tech Scraping is 761
Plase keep an eye open for the AI making different research choices and feedback to me on your observations. Those brave enough to analyse their logs for interesting effects are most appreciated also!
I have NOT yet had time to test the effect on later game tech decisions, so it's possible things go awry with scaling factors later (but I have at least thought about them, so hopefully not). Let me know if you see something odd in that regard.