Trait Driven AI

Afforess

The White Wizard
Joined
Jul 31, 2007
Messages
12,239
Location
Austin, Texas
One of the things that I really noticed in Civ4 BTS & Better Ai is that the AI doesn't play up to it's strengths. If the AI is an industrious leader, it should be more inclined to build wonders, since it can complete them more quickly. If it's philosophical, it should be gunning for anything that gives GPP. I think the AI could be dramatically improved if it was taught to play up its strengths.
 
One strength they will never master: speaking to the souls of llamas, in order to electrify them. For Electric Llamas can be a deadly geomagnetic weapon, under the right circumstan... *ahem*

I think they do prioritize any buildings and units their traits give them bonuses towards making, but I would guess that's about it. So yes, in theory this is a good suggestion. However there are some issues with it. You cover Industrial and Philosophical, but what about the others?

What is it supposed to emphasize more than normal for Creative... culture? In my mod Creative has a percentage culture bonus in addition to the fixed +2 per turn, but this doesn't exist in vanilla, so what would be the point of emphasizing culture production more than normal? If anything you'd want to emphasize it less than normal since the trait already has you covered, in a sense.

Imperial will already cause an increased emphasis on Settlers from the production bonus it gets to them; what more should it do differently?

Is a Charismatic leader supposed to engage in wars more often just because if he did, he would be able to train more higher level units at a faster rate? What if taking on wars would be an extremely bad strategic decision for such an AI player in many specific situations he might find himself in?

And so on. The point is, not all traits lend themselves to improvements in AI performance via emphasis shifting. I would argue only a few, like the two you cite, do. And I don't really like the idea of significant changes to AI behavior unless all the traits weigh in with effects. It gets a little confusing because in my mod Industrial provides a hammer bonus on certain tiles in the same manner as Financial, which is what I'm used to, rather than a wonder production boost... And in my case it would be wrong to shift their emphasis in all cases since more buildings or units may be the right way for them to go with the extra production. I suppose there's no harm in trying to do something with Industrial, Philosophical, and probably Financial as you suggest, though in that case you'd want to cover the Colossus similarly, and such. And I'm not POSITIVE these things aren't ALREADY being taken into account -- I'd have to look at the code.

But anyway. I'm tellin ya... Electric Llamas. They're the answer.
 
If it could be achieved in much the same way as <ImprovementWeightModifiers> and <UnitAIWeightModifiers> in the leaderheads.xml file then it would be suitable. Perhaps a <BuildingWeightModifiers> tag so that each leader AI can be customized towards both their personility and there trait bonuses. Not only would it lead to a greater variety of AIs but also can fit in easily with other mods.
 
Industrious AI's already tend to have higher WonderBuildProbs on average.
 
Well, in some aspects, the AI already plays a little by the traits, atleast in the part regarding half-priced buildings and will most likely take most of the other bonuses in consideration when building stuff for the cities ( or workers/settlers ) in minimally decent sense.

The area where the AI definitely does not take traits in consideration is in military planning, but that is because the AI has little more military strenght analysis tools besides the soldiers count. How could you tell to the AI that doing a little more of melee units is a decent idea a priori because of the Agg free promo if the AI has zero idea of the effects of a promotion in actual combat sense ( same for protective )? How to reasonably value the XP bonus of charismatic in terms of military strength if the AI has no idea that a promo in general makes a unit stronger? How to make the AI value the GG points bonus of Imp trait when fighting inside borders and, worse , insert that in a coherent strategy?

Those are all issues that would have to be solved before we could even think on making the AI "play by the traits"
 
Top Bottom