Ok - turns out a lot of the building choice of inappropriate building (order) is down to AIWeights in the XML. I thought we'd removed all of these a year or two ago except for a very few special cases. Turns out TONS of buildings have them. Basically it invalidates all tuning work on the AI, since they have a larger effect than most any tweaks to the AI will have.
I am going to change the code to utterly ignore them for now, since that will improve the decision making for MOST buildings (but break a few special-cased ones that do need them). Since I was laboring under the misapprehension that the XML wasn't using them apart from a few necessary cases, we'll have to start from scratch retuning the ones that need it, so expect a month or so before we can get the AI back to a sensible build order with a basis where AI tweaks can actually work correctly. I strongly suspect that the things that will break are likely to be buildings built by units (so anything to do with subdued animals, possibly captives, etc.). However, if I don't remove them there is no way to make the AI take its own decisions since the AIWeights are basically overriding them, so this is a necessary first step.
I am going to change the code to utterly ignore them for now, since that will improve the decision making for MOST buildings (but break a few special-cased ones that do need them). Since I was laboring under the misapprehension that the XML wasn't using them apart from a few necessary cases, we'll have to start from scratch retuning the ones that need it, so expect a month or so before we can get the AI back to a sensible build order with a basis where AI tweaks can actually work correctly. I strongly suspect that the things that will break are likely to be buildings built by units (so anything to do with subdued animals, possibly captives, etc.). However, if I don't remove them there is no way to make the AI take its own decisions since the AIWeights are basically overriding them, so this is a necessary first step.