tjs282
Stone \ Cold / Fish
As with all AI-upgrading, the answer is "In theory, yes; in practice, not reliably"Does the AI understand how to upgrade workers? For example, if I create a faster more expensive Serf with Feudalism and have the standard worker set to upgrade to a Serf, will the AI upgrade them?
The AI will generally only upgrade any unit if it has sufficient gold in its Treasury to make the upgrade on the same turn that the upgradeable unit happens to pass through a Barracks-town. AFAIK, it does not deliberately cycle obsolete units (back) through Barracks-towns just for the purpose of upgrading them. That said, when D=0 units (e.g. unmodded Workers) are threatened by a nearby hostile unit, the AI will almost always retreat those units to the nearest friendly town. If that town happens to have a Barracks, the units may then get upgraded, if the gold is available.
(In addition to allowing the production of Veteran units everywhere, another reason why the SunTzu wonder is so useful to the AI, is that it can then also upgrade any unit in any town — gold permitting).