[Development]AI: better Promotion Selection

Sephi

Deity
Joined
Jan 25, 2009
Messages
3,092
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)

Spoiler Example for two Specializations :

Barnaxus values Combat Promotions ten times higher than other units
Code:
		<AIPromotionSpecializationInfo>
			<Type>AIPROMOTIONSPECIALIZATION_HERO_BARNAXUS</Type>
			<iCombatPromotions>1000</iCombatPromotions>
		</AIPromotionSpecializationInfo>
Patrolling Firebows prefere Promotions that increase their moves and always pick fire2 first.
Code:
		<AIPromotionSpecializationInfo>
			<Type>AIPROMOTIONSPECIALIZATION_PATROL_FIREBOW</Type>
			<iMobility>100</iMobility>												
			<Promotions>
				<Promotion>
					<PromotionType>PROMOTION_FIRE2</PromotionType>
					<iValue>10000</iValue>
				</Promotion>				
			</Promotions>										
		</AIPromotionSpecializationInfo>
 
cool. will these be in 6.0?
 
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.
 
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)
 
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:
 
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.
 
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.
 
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?
 
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.
 
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...
 
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.
 
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.

Code:
[b]XML[/b]:
		<AIPromotionSpecializationInfo>
			<Type>AIPROMOTIONSPECIALIZATION_PILLAGE</Type>
			<iMobility>100</iMobility>
			<iWithdraw>200</iWithdraw>												
		</AIPromotionSpecializationInfo>																								
[b]python:[/b]
		#Pillage Units
		if iGroupflag==16:					
			pUnit.AI_setPromotionSpecialization(gc.getInfoTypeForString('AIPROMOTIONSPECIALIZATION_PILLAGE'))						
			return 0
 
Top Bottom