AI Personalities

Within CoreAIDefs there's the opportunity to create more than the single AI personality that is provided, and within a number of other files you can adjust the AI priority regarding spells, improvements, etc that it can access. I experimented with a new personality, AI_Magic, and limiting the AI to specific city buffs in an attempt to learn how the AI prioritizes in CoreSpells. Based on Pariden's early city buffs, I dramatically lowered the priority of Propoganda and Inspiration (into negative numbers), and raised the priority of Sovereign's Call and Meditation. But, I'm not seeing any changes... the AI still casts the former spells before the latter.

If creating AI personalities is actually impossible, then that would explain things. Assuming you can, however, actually create new personalities, I'm trying to find out what I'm doing wrong.

I feel like my issue revolves around how to structure the following:

<AIData AIPersonality="AI_General">
       <AIPriority>5</AIPriority>
</AIData>

How do I properly add the AI_Magic personality to this AIData section? I've tried a multitude of different ways, none seem to work (my knowledge about programming is pretty nil, but I'm a pretty smart guy). Assuming I did, at some point, structure it correctly, then perhaps the problem is with internal calcuations of priority, ie somewhere else the priority of the former spells is still outweighing the latter spells? The question then becomes, is there a command such that the AI would not access a spell, for example, under any circumstances (a true 0 priority)?

Thoughts? Thanks.

BigDunc

4,785 views 4 replies
Reply #1 Top


Have you tried applying your changes to the standard general personality? Just to know if your changes do have an effect. Once you know for sure those changes work you can concentrate in trying to move those changes to a new personality instead of overriding the default personality.

Reply #2 Top

Yeah, I've tried that. I've been playing around with AI_General priorities and it's still pretty quirky.

For example, there doesn't seem to be a way of denying the usage of spells to the AI. In other words, <AIPriority>0</AIPriority> prioirity doesn't seem to work as an "off" value. I've also tried entering negative numbers, but this doesn't work either. Either AIPriority is an absolute value or it's being multplied by another value somewhere making it a positive value on occasion.

Having the ability to turn off access to spells, weapons, armor, and items would greatly benefit the AI's use of resources. If we could create personalities that efficiency could be used in different ways to create very different feeling AI factions. Right now, they all seem to share the same thought pattern. I feel like this not only creates a blander gaming experience, but it's also making the AI a weaker opponent.

Reply #3 Top

I remember a Frogboy post where he said making the AI use spells correctly was difficult. It is entirely possible the current implementation is a workaround that has nothing to do with the AI priority system. If the game isn't using the values in that file for casting AI, because of a hard-coded workaround for instance, then manipulating them would be futile.

Reply #4 Top

The AIPriority system is definitely in use. Using city buffs I tweaked some values higher and turned some values 'off.' The higher values showed up more often while the 'off' buffs were still cast. I've also played around with the priorities for ability spells (those used by monsters) and changes can be seen.

AIPriority is also used in CoreWeapons and CoreArmor, but not CoreItems, but what it is used for isn't clear to me. If it's used for determing what gear is equipped, shouldn't Items also have values? If it's used for determing AI actions in combat, shouldn't Armor be free of priorities (as the priorities for skills and spells contained within armor are already in CoreAbilities and CoreSpells)? If these priorities are used for designing units (which the AI does outside of prebuilt units, I've played with that too) why are there values for the unique weapons like Scythe of the Void? It has to be that CoreWeapon priorities play a role in AI tactical choices on some level. If that's true, why aren't there <AIPrefType>AIPrefType_CUTTING</AIPrefType> type entries that relate to magic? All in all it just seems like magic plays a very small role in the AI's decision making.

I have no doubt it's very difficult. But I wonder if investing in multiple personalities and the ability to "turn off" spells wouldn't help.