View Full Version : [Development]AI: better Promotion Selection


Sephi
Oct 28, 2009, 12:53 PM
Wildmana 6.0 will have a new System for the AI to select Promotions. Every Unit will have a Promotion Specialization. They are fairly easy to add. Some Feedback would be nice when the AI isn't choosing Promotions optimal (like Barnaxus not picking Combat Promotions)


Barnaxus values Combat Promotions ten times higher than other units

<AIPromotionSpecializationInfo>
<Type>AIPROMOTIONSPECIALIZATION_HERO_BARNAXUS</Type>
<iCombatPromotions>1000</iCombatPromotions>
</AIPromotionSpecializationInfo>


Patrolling Firebows prefere Promotions that increase their moves and always pick fire2 first.

<AIPromotionSpecializationInfo>
<Type>AIPROMOTIONSPECIALIZATION_PATROL_FIREBOW</Type>
<iMobility>100</iMobility>
<Promotions>
<Promotion>
<PromotionType>PROMOTION_FIRE2</PromotionType>
<iValue>10000</iValue>
</Promotion>
</Promotions>
</AIPromotionSpecializationInfo>

[to_xp]Gekko
Oct 28, 2009, 05:46 PM
awesome :goodjob:

blade117
Oct 29, 2009, 05:02 PM
cool. will these be in 6.0?

DioAurion
Oct 29, 2009, 10:32 PM
Making end-game heroes value strength and heroic strength promotions might be a good addition. Overpowering the enemy with brute force has always been an AI specialty after all.

xienwolf
Oct 30, 2009, 01:11 PM
So you'll list a specializationType on a unit using this framework? Will you allow units to have multiple Spec Types listed? Adding new ones by promotion might be useful, so that if they happen to get certain promotions (Say, Orthus's Axe) they can change/augment their promotion pathways. And having the attachment of a pathway be able to be modified on a per-leader basis might be of some use, mostly in terms of Adept/Mage units which are shared across the board, but can sometimes have different preferences for spheres (like if the leader is Summoner type)

[to_xp]Gekko
Oct 30, 2009, 01:23 PM
it would be a nice idea to have Barnaxus retire to the capitol after he got combat V I think, since it's way better to keep him off danger than using him to fight. maybe also teach the AI to definitely attach a commander to him if they get one and he's not combat V yet. if at all possible of course :D

btw, why do patrolling firebows value mobility a lot? this may be a dumb question since I'm not really sure what patrolling means, and I notoriously suck at choosing promotions :lol:

Afterthought_bt
Oct 30, 2009, 02:30 PM
So you'll list a specializationType on a unit using this framework? Will you allow units to have multiple Spec Types listed? Adding new ones by promotion might be useful, so that if they happen to get certain promotions (Say, Orthus's Axe) they can change/augment their promotion pathways. And having the attachment of a pathway be able to be modified on a per-leader basis might be of some use, mostly in terms of Adept/Mage units which are shared across the board, but can sometimes have different preferences for spheres (like if the leader is Summoner type)

On a similar vein re: adepts/mages, it might be an idea to have them upgrade in the two fields that give them the extra promotions in the Arcane Mastery module. (E.g both Fire and Water so that they can get the Master of Fire & Water promotion.) If they gain Death III from a spell book, then go for Shadow III, maybe? Although, having said that, getting the AI to keep them alive to get to the promos might be tricky.

Sephi
Oct 30, 2009, 06:28 PM
So you'll list a specializationType on a unit using this framework?

specializationType is choosen in Python to allow some flexibility. Some units like missionaries go by UNITAI, most go by GROUPFLAG and a few go by UnitType or a combination.

Arcane Units still have their own python functions to use. I planned to convert them to the new system, but not sure anymore if it is worth the effort. All the mechanics like stackvalue (so not all adepts pick up enchanted blade unless luchuirp) or picking promotions just to be able to level up aren't needed for other units.

Sephi
Oct 30, 2009, 06:30 PM
Making end-game heroes value strength and heroic strength promotions might be a good addition. Overpowering the enemy with brute force has always been an AI specialty after all.

shouldn't they value frist strikes higher to that they can't be overwhelmed with huge numbers of units easily?

Deon
Oct 31, 2009, 09:41 AM
I'd say, it's fs-combat-fs-combat-fs-etc. promo order for END game heroes, because heroic str/def doesn't add a lot (for a mere 10 str hero one Combat promotion adds as much as 2 hs AND 2 hd so as 4 promotions total), and combat promos make a big difference, and as it's being said first strikes help alot.

[to_xp]Gekko
Nov 02, 2009, 03:09 AM
regarding Barnaxus again: would be great to teach the AI to use him to level ASAP, which would basically mean farming XP off barbs and other weak targets. barbsmasher or patrol would be good unitais for that I guess...

hbar
Nov 29, 2009, 02:42 PM
don't know if this is active yet, but i have noticed that a lot (i.e. stacks of 4-6 axement) of barbarians have guerrilla I as their only promotion, even though they are just attacking my cities.

[to_xp]Gekko
Nov 29, 2009, 04:30 PM
yeah, I've seen the AI has a liking for guerrilla promos too.

Sephi
Jan 02, 2010, 08:37 AM
added two specializations for the barbs now (attack and city attack), so they shouldn't pick guerilla that often.

I am sure this system will pay off in the future. Making AI Pillage units prefere withdraw and mobility promotions was really easy.


XML:
<AIPromotionSpecializationInfo>
<Type>AIPROMOTIONSPECIALIZATION_PILLAGE</Type>
<iMobility>100</iMobility>
<iWithdraw>200</iWithdraw>
</AIPromotionSpecializationInfo>
python:
#Pillage Units
if iGroupflag==16:
pUnit.AI_setPromotionSpecialization(gc.getInfoType ForString('AIPROMOTIONSPECIALIZATION_PILLAGE'))
return 0