As many know, the AI is generally not very smart with their houses. Some common examples:
But one thing that is particularly outstanding and detrimental is that they do generally not build any additional houses that are NOT part of their AIV, even when they suffer from severe "underpopulation".
Unless, of course, if they do not have any AIV in use at all - because no AIV (with matching index) has been found - in which case the AI often happily builds (and rebuilds) a variety of typical castle buildings, arranged more or less randomly around their keep and including things such as granary, trading post, armoury, recruitment buildings, breweries, inns, bakeries, mills, weapon production buildings, and... houses!
Hence, I think it might be possible, and would be REALLY awesome, if the AI would place additional houses "randomly dotted outside their castle" when the AIV-builtin houses do not suffice.
Not only would this be a rather simple but effective fix for all those default (and mod) castles that have way too few houses altogether, but it would also make many more castles viable on maps where some of the regular AIV-builtin houses cannot be built due to obstacles in the way (neighboring castles, terrain, map borders, you name it...). Moreover, some particularly "resource-ful" maps can bring a number of castles to the edge of their population capacity when for once ALL possible external buildings can be built in the AI-specific maximum amounts (e.g. 10 pitch rigs for the Caliph).
Last but not least, the problematic "quarry and ox tether behaviour" of the AI (see here for more details: https://github.com/Sh0wdown/UnofficialCrusaderPatch/issues/5#issuecomment-435641283) also can bring some, otherwise completely fine, AI castles to and well beyond their population limitations.
I've had games where one AI dominated _completely_ for several dozen game years, but then the ox tether count exceeded what population was available, effectively paralyzing the AI, preventing it from finishing off its half-dead opponent, and even losing it the game eventually as the enemy could fully rebuild, stock up on troops and gold, and strike back with little resistance...
Having said all that, I really do think this would be very useful. But of course I do not know for sure if - by "abusing" the AIV-less house building or other means - this would be doable with manageable effort.
That would require adding actual program logic, new functions and checks, instead of a mere change of some branch conditions and static data. I rather suggest just using my fixed vanilla castles. They do have enough houses.
Evrey is probably right. Though, it sounds interesting that the AI builds houses as needed if they have no castle schemes. Maybe I will have a look at that one day.
That would require adding actual program logic, new functions and checks, instead of a mere change of some branch conditions and static data.
Of course it wouldn't be trivial. Though, as I said, without AIVs, the AI already does place buildings somehow semi-randomly, so possibly that behaviour could somehow be "hooked up" to be used elsewhere... maybe...
I rather suggest just using my fixed vanilla castles. They do have enough houses.
Anyway, while I definitely appreciate your vanilla fixed collection (and modded castles with sufficient (spare) housing in general), map design and excess ox tether spam can cause issues even with castles that would have more than enough housing "normally".
Having said that, though, of course there are more pressing issues and bugs that have higher priority than this.
I think I'm not gonna change anything in this regard, since you can disable the AI's production-sleep-setting now and simply add additional houses to the AIV castles if needed.
Most helpful comment
Evrey is probably right. Though, it sounds interesting that the AI builds houses as needed if they have no castle schemes. Maybe I will have a look at that one day.