Brad Wardell's views about technology, politics, religion, world affairs, and all sorts of politically incorrect topics.

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).


Comments (Page 1)
on Feb 11, 2012

Wow! This is what I have been hoping for. 

I am curious, how does the AI know which one to use?

on Feb 11, 2012

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()%;

 

on Feb 11, 2012

Frogboy
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 

on Feb 11, 2012

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... 

on Feb 11, 2012

Gandhialf

Quoting Frogboy, reply 2for 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 

 

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.

on Feb 12, 2012


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).

 

Such a tease. Is one of em Dispel Magic? We need a dispell-spellllll!

on Feb 12, 2012

Frogboy
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.

I like this.

on Feb 12, 2012

Frogboy
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)

 

Aha! The AI does cheat!  I don't know how much mana my opponent has. 

on Feb 12, 2012

Sure you do.  It's in foreign policy.

on Feb 12, 2012

Touche. 

on Feb 12, 2012

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.

on Feb 12, 2012

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. 

on Feb 13, 2012

seanw3
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.

on Feb 13, 2012

Does this AI work also apply to when I choose AutoTurn? Or is that a different AI?

on Feb 13, 2012

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.