How to make AI build less anti-air?

Redox

Warlord
Joined
Jun 15, 2011
Messages
134
I am trying to make AI build less anti-aircraft guns and SAMs, but can't quite figure out how to do it. I would like the AI to have not more than 15-20% of its units as anti-air (instead of current half :crazyeye:). As far as I understand, changing flavors is the easiest way to do it. Mobile SAM for example has the following flavors:

FLAVOR_DEFENSE = 10
FLAVOR_MOBILE = 4
FLAVOR_ANTIAIR = 25

Does anyone have experience on how to do it best? Set Defense = 0, and Antiair = 10 so it's below that for jet fighter? Or set antiair = 0, so AI will just get a couple of them randomly, like it does with anti-tank guns?

Another question I have: there is an XML file defining unit formations. Could it be useful to change ani-air AI type from UNITAI_COUNTER to something else and then explicitly include them into some formations?
 
I think the best thing to do would be a guess-and-check system. Adjust the AA flavor, play a game. If it's how you want it, keep it. If it needs further adjusting, adjust. It's hard to give an exact value as flavors don't necessarily flow linearly, and certain flavors have different weights than others. :)
 
It's hard to give an exact value as flavors don't necessarily flow linearly, and certain flavors have different weights than others.

Yeah, that's what I have found out too. I have kinda struggled to get the results I wanted so was just wondering if anyone had experience reining in the numbers of AA units in late game.

I guess I'll have to take guess-and-check for a final answer :think:
 
Why don't you give the anti-air unit a <MaxPlayerInstances> then you know AI can't spam anti-air even it wants to ;)
 
Why don't you give the anti-air unit a <MaxPlayerInstances> then you know AI can't spam anti-air even it wants to ;)

That's a nice one, I didn't think about it. I can limit each one at 4, for a total of 8. This won't help minor civs, but should be about right for major civs :goodjob:

I normally try to avoid hacks, but flavors are just not my cup of tea.
 
Back
Top Bottom