I.e., I want to make them have a minimum of the max free units for a city, and 2-3 for a castle etc, and to boost it by say, 25-50% when an enemy army enters the territory.

I presume its somewhere in the descr_campaign_ai_db.xml, but as I have only the sketchiest knowladge of xml, any help would be appreciated.

even a communal breaking down of how one would actually doit, and the parameters affect, would be great :)

Cheers,

HDD