In the debugger right now working on tactical AI. And I’ve wondered just how many spells there potentially are in a given game. The current number: 175 (not counting strategic).
Wow! This is what I have been hoping for.
I am curious, how does the AI know which one to use?
It's complicated.
Right now, I make use of AI values in the XML as a base plus I look at the class of spells.
New variables I'm looking at is how many turns the unit has taken, the number of ranged units on each side, the overall disposition of each side, which tiles I can move into without the other team being able to hit me, which spells the other side has, how effective my spell is likely to be compared to their spell resistances, how much mana I have, how much health they have (no point in wasting spells on wimpy units), how wounded I am, how close the nearest unit is, what shards I have firmly under control, what units are coming up in the move list, what spells are currently queued up to be cast, the range of my particular spell, how much mana the other player has (so I can try to roll the dice on whether the other player is likely to cast a spell).
Like I said, it's complicated.
That's now.
In YOUR build it is:
for i = 1 to num of spells
should I cast spell = rand()%;
Will the final AI have any randomization (if value of expected outcome of possible AIs actions isn't the same)? Little randomized AI could be sneaky
That is going to be some sweet tactical AI. I can't wait to try it out.
I would say I wish I could be a fly on the wall, but then you are a frog...
Yea, the AIPriority value I randomize so that it's not too predictable. But randomness won't change the fact that the AI won't cast a wind shield when there are no archers.
Such a tease. Is one of em Dispel Magic? We need a dispell-spellllll!
I like this.
Aha! The AI does cheat! I don't know how much mana my opponent has.
Sure you do. It's in foreign policy.
Touche.
Also, bear in mind, you'll never see all those spells in a single game. But if you look in CoreSpells.xml you can see quite a few of them if you want spoilers.
I have been studying the current spell list to get a better idea of what I can use for my Ivory Towers Mod. There are alot of good spell functions, but some of them are bugged right now for modding.
That reminds me. Will the AI be able to specialize in Earth Magic when it starts next to an Earthshard? I remember you saying something about checking to see if a shard was safe from attack in some thread.
The AI values different shards based on what the make up of their casters are.
Does this AI work also apply to when I choose AutoTurn? Or is that a different AI?
Actually that would be something useful to know in the tactical battle screens. What shards you have and how much mana and shards your opponent currently has.