.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   AI for Mages Using Gems (http://forum.shrapnelgames.com/showthread.php?t=38408)

DonCorazon April 13th, 2008 11:57 PM

AI for Mages Using Gems
 
I am trying to figure out how many gems I need to give a mage who is going to cast 2 low level buffs for which he has the skill and then a big spell that costs 3 gems and will need 1 gem to give him the skill necessary to cast (buffs and big spell are all in the same school).

So if I give the mage 4 gems, will that be enough? My fear is that the AI sees he has the relevant gems in his inventory and uses them to reduce the fatigue cost of the 2 buffs he is casting so when it comes time for the big spell he won't have enough gems.

In that case, I guess I would need 6 gems - 2 that the AI will burn on his buffs (even though that is not what I would want), 1 to boost him so he can cast the big spell, and 3 for the big spell itself.

Thanks

Saulot April 14th, 2008 12:17 AM

Re: AI for Mages Using Gems
 
If the important spell is the first one scripted, you can go with just the base gem requirement. In your example and otherwise, it's generally a good idea to give extra.

IIRC, it's also an important thing to consider that mages won't use more gems than their level for certain purposes.

AI gem use is a tricky subject, and mostly receives complaints when it does something you didn't want, but nobody considers it when it does what you do want.

DonCorazon April 14th, 2008 12:30 AM

Re: AI for Mages Using Gems
 
I need the buffs to protect me from the big spell so I may not be able to do it given the gem shortage.

Thanks.

Amhazair April 14th, 2008 07:30 AM

Re: AI for Mages Using Gems
 
Which are the minor buffs you want to cast? If they are in the 20/30 fatigue region my experience is that they won't use extra gems most of the time. If it's going towards 50, they will almost certainly use a gem for it.

Zeldor April 14th, 2008 02:58 PM

Re: AI for Mages Using Gems
 
The bad thing is that they get gems left they can cast some really ugly spells, like mass protection against abysia http://forum.shrapnelgames.com/images/smilies/happy.gif So better script them some gem-using spell after the one that you want to cast. So if they have gems cast they waste it on that, not something dangerous. And if not - at least they will pick instead another spell that does not require gems.

Tuidjy April 14th, 2008 05:23 PM

Re: AI for Mages Using Gems
 
I have always been amazed how the AI has no concept of harming its own men.
I have had an Arco human mage in a huge human army cast rain of stones against
enemies that were absolutely no match for my guys, killing some mages and about
a hundred of my archers. Yes, he also wiped out the Maverni opposition, but
who cares? They would have been dead anyway.

vfb April 14th, 2008 06:15 PM

Re: AI for Mages Using Gems
 
Must have gone something like this: Snakebite leader, Bravo Six, for the record, it's my call. Dump everything you got left ON MY POS. I say again, I want all you're holding INSIDE the perimeter. It's a lovely war. Bravo Six Actual and Out.

sansanjuan April 14th, 2008 06:25 PM

Re: AI for Mages Using Gems
 
Quote:

Tuidjy said:
I have always been amazed how the AI has no concept of harming its own men.
I have had an Arco human mage in a huge human army cast rain of stones against
enemies that were absolutely no match for my guys, killing some mages and about
a hundred of my archers. Yes, he also wiped out the Maverni opposition, but
who cares? They would have been dead anyway.

Would be interesting if commanders/mages had an intelligence attribute (with all the potential implications). Low value IQ commanders would be prone to instigate "friendly fire" and general gem abuse. Smart ones would take advantage of knowing likely battle outcomes (each battle might be run internally with multiple passes, first pass with no magic either side, second as scripted, etc....?). These outcomes would be weighed by each side's mages per each IQ attribute with smart mages pulling up a lawn chair and watching if they deem there is no need to risk unleashing death from above on the entire battlefield. Of course there are way too many permutations and randomness for perfection but might be useful for obvious ones like you've cited. Dom4?

-SSJ

Tuidjy April 14th, 2008 07:49 PM

Re: AI for Mages Using Gems
 
> Dom4?

Dom4 on a Cray supercomputer, maybe... Naah, no way.

There are so many possible actions a mage can take that if you were to have even
one percent of the possible 50 round battles generated, you will not host the
turn on Cray in a day.

sansanjuan April 14th, 2008 11:59 PM

Re: AI for Mages Using Gems
 
Quote:

Tuidjy said:
> Dom4?

Dom4 on a Cray supercomputer, maybe... Naah, no way.

There are so many possible actions a mage can take that if you were to have even
one percent of the possible 50 round battles generated, you will not host the
turn on Cray in a day.

So we all chip in.... http://forum.shrapnelgames.com/images/smilies/wink.gif

I was wondering what % of a turn's cycles are spent on animation creation. If that was surpressed... For your specific scenario I wonder if even a single iteration might be useful. Just a thought.

-SSJ

fantasma April 15th, 2008 04:59 AM

Re: AI for Mages Using Gems
 
I think the unpredictable and sometimes stupid mage is perfectly normal.

Imagine yourself in a situation where the sky is torn apart, the earth shivers, lightnings flash, etc, etc, a few hundred/thousand monsters are crying and milling about and slaughtering each other and you in the middle of this have exactly the fraction of a second to ponder all the implications of possibly several hundred options.

Sure, you make the right decision 10% of the time, if you are lucky!

Of course it's annoying when you watch the replay with a cold beer in your hand and scratch your head and think oh my god!

My mages cast mass protection always against Abysia! And Aby had more pyromages on the field than troops...

capnq April 15th, 2008 06:56 AM

Re: AI for Mages Using Gems
 
Quote:

sansanjuan said:I was wondering what % of a turn's cycles are spent on animation creation. If that was surpressed...

Animations are only relevant for watching the replay; there's no reason to calculate the visuals while the battle is being resolved.

Tuidjy April 15th, 2008 01:10 PM

Re: AI for Mages Using Gems
 
While the animations take a great deal of processing power, and skipping them will
reduce the run time considerably, the move selection still takes quite a bit of
time. Not convinced? Replay a major battle, and hit 'n' a few times. This will
skip the animation, and just do the number crunching. It still takes a few
seconds. With hundreds of choices per mage, ten mages on each side, and 50 rounds,
the total number of possible battles dwarfs the number of atoms in the universe.

Yes, some branches may get curtailed, some spells may be ignored as obviously bad,
etc... But it is still a matter of writing better AI, not running exhaustive searches.

sansanjuan April 15th, 2008 03:16 PM

Re: AI for Mages Using Gems
 
Quote:

capnq said:
Quote:

sansanjuan said:I was wondering what % of a turn's cycles are spent on animation creation. If that was surpressed...

Animations are only relevant for watching the replay; there's no reason to calculate the visuals while the battle is being resolved.

ok. I'm a bit intrigued...

So when the .trn file is being generated with the battle sequences, every unit ends up with a "this is what unit-x did this turn", etc. etc.? As the battle engine cycles through commanders and units each unit reacts to every appropriate unit on the battle field for both friends and foes (morale check, can't move there, can swing at bog beast, etc.)? The computational heavy lifting results from all these (each unit's) array checks. If so I can see why it's a bugger to finesse the AI into "deep and clever" code. Thematically I do agree that some mages would nuke their own friends due to panic. I also still am convinced a single attribute (IQ) that would leverage a single with/without magic iteration might be doable. I may be full of hooey... wouldn't be the first time. http://forum.shrapnelgames.com/images/smilies/wink.gif

-SSJ

Edit: We'd call it the "mage watches battle in lawnchair" iteration. Perhaps only useful if they are the only mage in play for that battle.

Darkstone April 15th, 2008 04:04 PM

Re: AI for Mages Using Gems
 
Like others have hinted before, I think a big part of this is perspective.

We have a bird's eye view of the situation. Mages are in the battle itself. It's hard to see the enemy. Perhaps they're stacked a dozen deep, or they're beyond a group of your own troops. Frankly, considering the situation, the mages do a hell of a good job.

sansanjuan April 15th, 2008 10:48 PM

Re: AI for Mages Using Gems
 
Quote:

Darkstone said:
Like others have hinted before, I think a big part of this is perspective.

We have a bird's eye view of the situation. Mages are in the battle itself. It's hard to see the enemy. Perhaps they're stacked a dozen deep, or they're beyond a group of your own troops. Frankly, considering the situation, the mages do a hell of a good job.

Upon reflection... you are probably correct. Likely on average the mages chose significantly wiser spells than I would have scripted.
-SSJ


All times are GMT -4. The time now is 08:24 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.