1:
A feature category xml file should be doable and reusing the approach from CivEffects it should be possible to make a tag, which can be from either of 2 files.
2:
I wonder if we should make feature removal that complex. After all there can only be one feature on a plot at once, meaning in theory one remove feature buildInfo will be enough. It will then look up <iTime>, <Yields>, <iCost> and <Button> from feature, featureCategory, buildInfo in that order, moves to next if empty. CivEffects can then get allowRemoveFeature where it lists each feature and feature category.
In CivEffects, add a tag and bool that can unlock or obsolete access to a Buildinfos entry. Consider moving <TerrainMakesValids> and <FeatureMakesValids> from Improvementinfos.xml to Buildinfos.xml.
I totally agree that it should be possible to say invent a farm for plains and then later allow farming wetlands. Right now we need multiple improvements for that (I think), but somehow having multiple buildInfos for the same improvement doesn't sound good either.
Potential issues:
- different buildInfos can have different hotkeys, meaning it might not be the same key for the same improvement
- if one buildInfo is for plains and another is for light forest, then light forest on plains will have two buttons for the same improvement
- buildInfos are looped frequently. Having a nice and
I wonder if we should set some base info somewhere, which is automatically applied to the default CivEffects (the one given to all players). Next CivEffects can add allow combos, like farm+wetlands, which is then cached like so much else in CivEffects. When testing canBuild, it checks the player for allowImprovement and if the improvement is allowed for that terrain or feature. This would allow one BuildInfo for each improvement, but at the same time it can expand using CivEffects.
While this is about improvements, I would say we should do the same for routes, allowing techs, which unlocks building roads through swamps etc. Hills and peaks should also be mentioned here..... somehow.
Speaking of build speed, I'm wondering if the build time should be multiplied by 100 when reading xml, meaning if you write 5 in xml, it becomes 500 build points internally. Workers then apply 100 points each turn instead of 1, which means it still takes 5 turns to build. The difference is that if we say give +50% work speed, adding 1+50% = 1.5 -> 1(int rounding) will still make it take 5 turns while 100+50%=150 will take 3 turns. In other words it will allow speed modifiers other than just double speed. The same goes for improvement upgrade time (when worked). Right now it also suffers from this, meaning giving 10% faster upgrade (or 90%) doesn't do a thing. Upgrading with 110 (+10%) will in fact speed up an upgrade, which takes say 20 turns.