Pazyryk
Deity
- Joined
- Jun 13, 2008
- Messages
- 3,584
Too much speed posting -- can't keep up...It's a hard-coded solution to the problem that there is nothing in the database that links a feature to the build that removes it. So when you build a plantation on a resource that's in forest, you actually kick off two builds - BUILD_REMOVE_FOREST and BUILD_PLANTATION. BUILD_PLANTATION "knows" (from the BuildFeatures table) that it has to remove the forest but there is nothing to tell it what "build" does that.
The generic solution is to add a "RemovedBy References Builds(Type)" column to the Features table and then use that to work out what build is needed to remove feature X
Edit: Except that isn't going to work for Ea, as you have multiple ways to remove feature X (slash-and-burn or chop) depending on adopted tech. Going to need a FeatureRemove table with FeatureType, BuildType and TechType columns.
I can do the table. Is that easier than coding a "smarter dll AI" that can look for allowed remove builds and select one that works? Note that the mod only allows 1 for a player at a give time (it takes away the tech that allows slash-burn at the same time that it gives tech allowing the chop).
Edit3: Strike above. Need new columns in Builds table: "PrereqPolicy", "DisallowTech" and "DisallowPolicy".
The other (possible) complication is that some civs (based on policy) can improve a given resource without removing a feature, others have to remove the feature. This all works fine for human. It would work also for AI if it was done generically by testing what builds could be done on a given plot. But now I suspect that is not the case.