.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 - The Artificial Idiot (http://forum.shrapnelgames.com/showthread.php?t=46741)

Executor December 9th, 2010 01:52 AM

AI - The Artificial Idiot
 
Does anyone know exactly how the battle mechanics work, how the AI determines which battlefield spells to choose? I was under the impression that the most powerful spells researched were used, but that theory fell in water just now.

I had a rather big battle as MA Ermor, which involved 16 communion slaves and at least that much communion masters.
After the initial scripting the AI chose to cast only banishment and paralyze for some reason( enemy army mainly consisted of unfrozens, archers and a few tarts), which inevitably led to me being slapped by a far lesser army.
Now, given that the communion gave each communion master theurg a S5D5 magic base, and that I had every spell researched, I come to wonder why the AI chose to, well throw the battle?

iRFNA December 9th, 2010 02:50 AM

Re: AI - The Artificial Idiot
 
They were bribed by the enemy.

Numahr December 9th, 2010 07:13 AM

Re: AI - The Artificial Idiot
 
A nice feature to add would be a "preferred spell" the mage would try to cast after scripting is over. Oh well.

Rytek December 9th, 2010 10:26 AM

Re: AI - The Artificial Idiot
 
Lots of times the AI will go with something sub-optimal. Without going in to the whole making the ai better debate the best thing to do is to script the win before the AI takes over :)

Now, just from the description of the fight, Banish doesnt sound like a horrible spell. 16 slaves means your masters had +4 to holy level. Spamming level 6 and 7 banish doesnt sound like too terrible a spell to cast. Thats +2 penetration with 0 fatigue and a huge area. Paralyze would also seem to be a good spell to pick if targetting the Tarts.

Saying that, I think unfrozen are the best summons in the game and are often underestimated especially in a cold dominion. Good hits, superb MR, good damage(some even come with magic weapons) If your opponent had cast just an antimagic that boosts their MR to 20 and they are gonna walk thru even serious banishment spam.

Of course the better spell the ai could have switched to instead of banish is witherbones.

Depending on what type of troops you have as blockers you can rarely go wrong with stellar cascade spammed with 32+ mages.

Calahan December 9th, 2010 11:11 AM

Re: AI - The Artificial Idiot
 
I have a fair idea how the casting AI operates (currently working on a mod dealing with this exact issue). But I'm not going to go into the details of the matter here. Since I don't want the (guaranteed) hassle from any of the *individuals in* the community, and who think they know better based on some random game they played six months ago while watching a fast-forwarded battle replay. (so you can thank them for the reason why I, and other experienced players, no longer share detailed knowledge very often)

But I will say that friendly fire is one of the most overriding issues with regards casting AI spell choice. As in short, a useful rule to remember is that if there's any chance at all of your troops being negatively affected by a spell, then nine times out of ten the casting AI just won't cast it (and it'll often override any such spell even if scripted). Although fatigue spells seem to operate under a different rule set.

And expecting the casting AI to cast Wither Bones as LA/MA Ermor = Epic Fail
(unless you somehow have no undead units on the battlefield yourself)

Dimaz December 9th, 2010 11:17 AM

Re: AI - The Artificial Idiot
 
Especially under darkness with non-undead mages.

Gandalf Parker December 9th, 2010 11:33 AM

Re: AI - The Artificial Idiot
 
The AI does extensive thinking, and any more would cause more complaints than now.

If you want to see the AI going thru the process then just turn on debug with a -dd switch to your game, and view the logs. Come up with some suggestions on how you would change what you see so that we can discuss it. The offer has been out there since before Dom3 was released but very few have actually bothered to look at it.

And if you want to check out how the computer player does vanilla scripting, or purchases troops, then use the (more recently released) --comptrn switch to be able to view turn files for AI players.

Executor December 9th, 2010 12:51 PM

Re: AI - The Artificial Idiot
 
Hm, interesting idea regarding FF Calahan. But that seems wrong from my point of view as I had undead (longdead) chaff and the enemy had unfrozens. Both susceptible to banishment, actually mine were quite more susceptible to it.
And yes, the battle was under darkness so shouldn't have the AI used higher precision spells?
I'm still rather confused.

I'm still happy to hear any ideas regarding how the AI works as to try and prevent future AI betrayals.

I wasn't hoping for wither bones, I didn't even expect undead troops, but I can think of a dozen spells other that could have brought me victory.

Gandalf, If I had any idea about a thing what you're suggesting I'd gladly do it, however I find myself in a complete lack of programing skills and I'd rather not get involved in things I don't understand.

Rytek, paralyze is a horrible spell if you only have chaff, and yes we know how much you love unfrozens and you're glad they won:)

rdonj December 9th, 2010 01:35 PM

Re: AI - The Artificial Idiot
 
And it's things like this that have spurred Dread Lord Calahan to attempt to create a mod to improve the spellcasting AI.

llamabeast December 9th, 2010 01:41 PM

Re: AI - The Artificial Idiot
 
Quote:

The offer has been out there since before Dom3 was released but very few have actually bothered to look at it.
I don't understand Gandalf - what offer?

thejeff December 9th, 2010 01:50 PM

Re: AI - The Artificial Idiot
 
I've looked at the debug log data quite a bit and it doesn't really seem to help with understanding why the AI does what it does. It shows which spells it considers and what ratings it gives them, but not how it calculates those ratings. Sometimes it tells you about gems or paths or fatigue, but not much about why it chose one permissible spell over another.

Rytek December 9th, 2010 02:54 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Executor (Post 765510)
Rytek, paralyze is a horrible spell if you only have chaff, and yes we know how much you love unfrozens and you're glad they won:)

Well, you said he had tarts so paralyze isnt so bad vs them. soul slay and enslave mind are better of course. And disintigrate when they are in range would be the best bang for the buck vs the tarts.

mm, I don't love unfrozens. I just think they are a tiny bit overpowered.I find it hard to justify spending W gems on anything besides them. I have no idea why you think I'm glad they won--I'm just not surprised they did.

Back on topic, I was wondering if you had a power of the spheres cast for your slaves? You never mentioned that or a northern star cast either.if the slaves were just S1,D1 maybe all of those banishment you were seeing were coming from your s1,D1 H2 slaves?

Rytek December 9th, 2010 03:09 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Executor (Post 765510)
Hm, interesting idea regarding FF Calahan. But that seems wrong from my point of view as I had undead (longdead) chaff and the enemy had unfrozens. Both susceptible to banishment, actually mine were quite more susceptible to it.
And yes, the battle was under darkness so shouldn't have the AI used higher precision spells?
I'm still rather confused.

I see the logic of this as well. But maybe something else is at work? Did the enemy hold and attack while you charged your chaffe on to his side of the field? Maybe banish was one of the only spells in range. Ive seen several of my communions default to solar rays in near similar circumstances(in the Galadia game vs Balz' mass of unfrozens)Although the ea ermor mages are not holy so no banishment option.If a mass protection or similar was cast the spell may have been discarded due to the higher protection.

Executor December 9th, 2010 03:12 PM

Re: AI - The Artificial Idiot
 
I think just PotS,
I first thought that do, I brought a fair amount of indie priests, so initially I figured they were casting it, but once I saw my main mage "BALBLABLABLABLABLABLA" (that's his name :)) casting banishment I was surprised.
Than I thought the tarts, or his troops weren't in range, but than I measured the battlefield and they were in a 10-15 range distance from the communion masters.

Swan December 9th, 2010 07:00 PM

Re: AI - The Artificial Idiot
 
this is how i often see my mages

Fantomen December 10th, 2010 05:33 AM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by llamabeast (Post 765516)
Quote:

The offer has been out there since before Dom3 was released but very few have actually bothered to look at it.
I don't understand Gandalf - what offer?

I bet you half a melon this just another round of smoke and mirrors.

Links? Post number? Who made the offer? Why has the countless calls and discussions (including input from capable people who would jump on any possibility to help) about AI been left unnoticed by the devs if they in fact have this "offer" standing?

I call bull****.

Gandalf Parker December 10th, 2010 10:49 AM

Re: AI - The Artificial Idiot
 
Sorry for late answers. Im not as responsive as I used to be and far more selective about it

Quote:

Originally Posted by llamabeast (Post 765516)
Quote:

The offer has been out there since before Dom3 was released but very few have
actually bothered to look at it.
I don't understand Gandalf - what offer?

Such suggestions have been walked in to the devs. Published in the beta group and discussed. And a number of them have generated changes to the way that some spells were treated by the ai.

Some of the discussions died here but for good reasons. People would start to discuss the actual actions of the AI and would try to suggest changes which would quickly become bogged down by IF statements. Clearly such major additions, trying to take in specific nations and situations would shift from a suggested change to a major rewrite. Still though, those discussions were worthy.

But most discussions about the AI here were not actually suggestions about the way the AI in Dom3 does things. They were discussions about AI in general in all games. And most of those were pretty insulting. Nothing I would champion in private discussions.

llamabeast December 10th, 2010 11:25 AM

Re: AI - The Artificial Idiot
 
Quote:

Such suggestions have been walked in to the devs.
What suggestions? I'm not being funny, I literally have no idea what you're talking about.

Gandalf Parker December 10th, 2010 11:42 AM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by llamabeast (Post 765636)
Quote:

Such suggestions have been walked in to the devs.
What suggestions? I'm not being funny, I literally have no idea what you're talking about.

Well anything that shows the person actually looked at what was going on and had a tweak in mind. Placing a certain spell higher or lower in consideration. Or how the AI purchases or uses its units. If a suggestion showed understanding of the actions and was reasonable then it would get forwarded by someone. Especially if the original discussion could be linked to safely.

thejeff December 10th, 2010 01:55 PM

Re: AI - The Artificial Idiot
 
I'm not sure what "higher or lower in consideration" means. As near as I can tell, the spells the AI tries are given ratings based on their likely effects. My assumption is the way to change this would be to change the weighting of the different types of effects: direct damage vs stun damage vs protection buffs, etc, etc.

Would suggestions like:
Lower the weighting of battlefield summons.
Increase the weighting of the path booster spells.

count as useful suggestions? Because I've certainly seen them before.

PriestyMan December 10th, 2010 01:56 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Gandalf Parker (Post 765637)
Well anything that shows the person actually looked at what was going on and had a tweak in mind. Placing a certain spell higher or lower in consideration. Or how the AI purchases or uses its units. If a suggestion showed understanding of the actions and was reasonable then it would get forwarded by someone. Especially if the original discussion could be linked to safely.

we still dont know what your talking about? linked to safely? you mean like its unsafe to link to the discussions your talking about? what?

Gandalf Parker December 10th, 2010 03:22 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by PriestyMan (Post 765646)
Quote:

Originally Posted by Gandalf Parker (Post 765637)
If a suggestion showed understanding of the actions and was reasonable then it would get forwarded by someone. Especially if the original discussion could be linked to safely.

we still dont know what your talking about? linked to safely? you mean like its unsafe to link to the discussions your talking about? what?

Why is that unclear. A reasonable suggestion would get forwarded by someone. ESPECIALLY IF the original discussion could be linked to safely. Bringing up a suggestion was one thing but it was also helpful if the discussion here could be linked to. Some of the discussions here were in tones that I wouldnt link to.

DeadlyShoe December 10th, 2010 09:08 PM

Re: AI - The Artificial Idiot
 
my only real complaint with the battlecaster AI is that it will cast unnecessary self buffs after the scripting runs out. i think it should only self buff in the first couple of rounds at most, if that. I guess the AI doesn't see the difference between 'mages' and 'thugs'.

other than that, and sometimes odd spell choice, ive found the battlecaster ai surprisingly intelligent and adaptive. sometimes its nice to just be on Cast Spells, because it will pick things based on range and need. And its smart enough not to cast scripted spells that arnt useful anymore- most games arnt nearly that clever, they'll follow the plan down in flames.

i think most complaints come as a result of late game competitive multiplayer where theres a HUGE amount of spells available...drastically increasing the # of spells the AI can choose from and dramtically REducing the chances the spell you want casted is casted. Also, the AI doesnt understand lategame synergistic combos as well as it might.

in this particular case, a lot of the problem seems to just be that the mages are also priests. ive noticed that the AI heavily prefers Holy spells, presumably because of the low fatigue cost.

Loren December 10th, 2010 10:41 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Gandalf Parker (Post 765508)
Come up with some suggestions on how you would change what you see so that we can discuss it. The offer has been out there since before Dom3 was released but very few have actually bothered to look at it.

One fairly simple one: When the script runs out add a couple of additional options:

Cast defensively and cast offensively.

The former would encourage the caster to buff himself or other friendlies, the latter would pretty much exclude buffs.

thejeff December 11th, 2010 12:07 AM

Re: AI - The Artificial Idiot
 
"Summon" would be a nice addition to "cast offensively" and "cast defensively".

Sometimes you want the ever-growing horde of undead. And sometimes you're just getting one more phantasmal warrior instead of raining lightning down on their heads.



Another thing that would be really nice, but that falls afoul of Gandalf's dread "If" test would be a little situational awareness for defensive buffs. Start with the obvious, don't cast protection on people with heat auras. Or a little more complicated, boost the chance of defensive buffs if the thing they defend against is happening all around you. Fireballs crashing around you, take a turn to cast fire resistance. That would be trickier to code, since it requires some knowledge of state, but I can think of ways to do it that wouldn't devolve into long if/elseif chains. You could, for example, increment a counter when a fire spell is used and then add that to the score for the other sides fire resist spell.

cleveland December 11th, 2010 12:14 AM

Re: AI - The Artificial Idiot
 
The 5-round scripting limit gives the Artificial Idiot a fighting chance...

Peacekeeper December 11th, 2010 12:21 AM

Re: AI - The Artificial Idiot
 
the AI mages should keep track of whos firing at them and try to fire back with spells. So if a group of archers are actively targetting the mage, he should be using spells to destroy the archer group.

PriestyMan December 11th, 2010 12:23 AM

Re: AI - The Artificial Idiot
 
I really think it should take into account what races the mage might have a real grudge with. i mean if there is a dwarven smith on the battlefield, he should target a goblin before anything else. even if he has to run forward to get at him. and elephants should ignore all other targets if there is even one markata on the field

TheConway December 11th, 2010 02:14 AM

Re: AI - The Artificial Idiot
 
Wait guys, I GOT IT! We just extend the number of script turns! HOLY ****! It doesn't even require a link to unsafe threads! If there's anything we all learned in Government class its that shifting the problem farther up the road is ALWAYS the best choice, apart from talking about mysterious hints and shadowy "classified" intel.



Has anyone here even wondered why JK would want to go through all the hell that AI improvement would entail? I can't see why.

DeadlyShoe December 11th, 2010 03:19 AM

Re: AI - The Artificial Idiot
 
there's UI issues with that and it would unavoidably add more micro. i spend far too much time scripting mages already. A better scripted AI would also create a better SP/Coop experience.

Gandalf Parker December 11th, 2010 09:12 AM

Re: AI - The Artificial Idiot
 
If I remember right, the 5-script was the reasonable amount of time into a combat that pre-combat suggestions would tend to reach. After all, Mages were considered to be commanders in their own right.

Altho, some sort of general "after that you should probably go offensive" does sound like something Kristoffer might have been willing to consider.

And like others I also do feel that buffs are imbalanced. I tend to avoid researching Alteration because of it. That tends to avoid many of the spells that tends to throw the AI off of script.

Id be willing to mention that to them but before I do Id want to do some testing to make sure there isnt a logic factor Im missing. Something that makes the mage feel nervous that I could have avoided. Ive tested formations, which does help in some spells but not in avoiding buffs. But I havent tested "our numbers vs their numbers" or "did my pretender bother to give me any protective equipment".

Executor December 25th, 2010 09:50 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Gandalf Parker (Post 765724)
If I remember right, the 5-script was the reasonable amount of time into a combat that pre-combat suggestions would tend to reach. After all, Mages were considered to be commanders in their own right.

However they turned out to be either severely mentally challenged commanders, or just folks who bought a mages diploma and didn't know what to do actually.

IMO, the main problem with late stages of the game is the limited usage of mages in battles. That's why most games revolve around SC's who are just scripted to buff and kill in 90% of the time. And usually that's the main battle strategy in almost every single game as you just can't rely on the AI scripting.
How many of you actually use armies in the late stage of the game? That's a damn fast way to lose any game. The enemy just sets up a trap and most of the time you'll be dead precisely because of the 5 turn rule.
You get that very limited amount of time to hopefully penetrate MR with certain spells, or get lucky if the enemy get's in range, and after that the mages are as good as non-existing for most parts. They quite commonly even do more damage than good.

So, would it be possible to make a "repeat" action? As in you script your mage to cast Pillar of Fire for example, and he continues to do so for the remainder of the battle.

I think this could brink to a very large battle spells diversification. For example instead of having 5 mages scripted to cast say Soul Slay and Bane Fires, who will after the initial 5 turns change to casting something like paralyze (which is in my comparison putting down a fire arm to pick up a pebble to throw at your enemies ) and fire flies, you set one mage to cast Soul Slay, one to cast Bene Fires, one to cast Pillar of Fire etc.
So instead of just relying on the initial 5 spells from your mages, after which you pray they hit something useful every now and than, you get as many rounds of the stuff you've orders for the duration of the battle. So in stead of 5x5 you get 5x50 spells.

Would this idea be feasible or am I just talking out of my ars?

Gandalf Parker December 25th, 2010 11:27 PM

Re: AI - The Artificial Idiot
 
Its one of the more feasable ideas Ive heard.
But not because it would make the battles more useful to the players. It would be more feasable because it can be made to fit Kristoffers concept of the game. Its not absolute, and not illogically over-controlling of a battle far far away. It could be pitched as just ... and at that point he is given a general statement of "and then continue doing xxxxx for the rest of the battle". It still would be able to be overridden in the usual manner, and doesnt seem to stretch the instructions beyond a simple battle plan.

Kref December 26th, 2010 11:26 AM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Gandalf Parker (Post 765508)
The AI does extensive thinking, and any more would cause more complaints than now.
...

Gandalf, why do you think so? There is a large enough list of MP games on llamaserver. MP games have heavy drawbacks vs. SP games:
player can do no more then one turn per about 3 days, and even worse - he should do so; his waiting time for turn results - three days, much more even if AI would think much longer; player don't customize game as he wants in minutes but should come to agreement with others on forum (and others should also want a game somewhere of that type and in that time); player is not sure that the challenge of the game would randomly and dramatically decrease/decrease due to someone can make a chaotic (not intended to win) warfare or leave a game. And all that for a high chance of a good intellegence of opponents. I agree that turn time may be of importance for beginners, but veterans, especially with games on large maps, generally don't like (I am quite sure) that they make turn for a few hours, and AI makes stupid decisions, also in few minutes. Processor should work for me, not I for him.

Kref December 26th, 2010 12:04 PM

Re: AI - The Artificial Idiot
 
2 Calahan:
How do you work on AI mod? I've read "modding.pdf" and didn't found anything that can improve AI, except the low-applyable methods like used in mod that raise resource costs of independents.

Gandalf Parker December 26th, 2010 12:22 PM

Re: AI - The Artificial Idiot
 
@Kref:
I agree with what you say. There are many MP games on all 3 of the large servers. And more in games on peoples on machines. But Im one of those people that doesnt think the MP outnumbers the Soloers.

As one of the main server testers for the game I often requested that anything removed for speed of hosting be set aside to make available with a game switch on the command line. Because servers (mostly MP games) dont tend to care how long the game takes to host a turn. Unfortunately we didnt get that.

BUT part of the problem is in the AI itself. Its linear and general. If you turn on debug and read the log it takes up quite abit of its time. And most improvements tend to be in trying to make it less general. Once you start that it gets pretty involved. There are way too many nations, units, strategies in this game to start trying to take them into account for every action

As to modding the AI the only thing available to us is to try and remove things we feel the AI doesnt use well, and boost things that it does

DeadlyShoe December 26th, 2010 09:33 PM

Re: AI - The Artificial Idiot
 
Yeah I was pondering just removing Holy Avenger for that reason, or making it a #onebattlespell for some units.

Kref December 27th, 2010 04:40 AM

Re: AI - The Artificial Idiot
 
2 Gandalf Parker:
I've recently sent a suggestion of my participating in AI development for Kristoffer and Johan on e-mail (including prototype SK-equipping algorithm, also it doesn't work quickly) but didn't receive an answer yet.
Perhaps I'll put here one of my suggestions right now: is it possible to make a description of all savedgames files (ftherlnd, .trn, .2h) publickly available? This would allow any part of community to develop AI as they like. To use alternative AI anyone should just make a multiplayer game and then make 2h files with alrenative AI programs.
I believe its unlikely that the formats of savedgame files contain very valuable technologies.

P.S. "But Im one of those people that doesnt think the MP outnumbers the Soloers." - I completly agree. The described drawbacks are too heavy. So, the good AI is needed for SP. I don't mind if anyone would use a quick "meat-throwing" AI, I just think that large amount of regular community would like a more sofistickated, even if it would mean a much slower, algorithm to exist. As I understand, dominions take only one core of processor. So, its easy to press alt-tab and do something else while AI thinks.

Gandalf Parker December 27th, 2010 10:54 AM

Re: AI - The Artificial Idiot
 
I cant seem to word a response for this forum. Contact me by email to gandalf at the dead.isp of Community Net to continue

Fantomen December 27th, 2010 04:06 PM

Re: AI - The Artificial Idiot
 
Quote:

Originally Posted by Kref (Post 767052)
2 Calahan:
How do you work on AI mod? I've read "modding.pdf" and didn't found anything that can improve AI, except the low-applyable methods like used in mod that raise resource costs of independents.

Calahan is altering spells in a way that keeps their effects intact, but makes them more or less attractive to the AI. For example using nextspell commands to hide effects from the AI so it thinks the spells doesn't do anything.

This way it is possible to limit the amount of spells the AI chooses from to those that are the most generally useful. The result being a much more effective AI in practice.

Initial tests have been quite successful as I understood it, I believe we can expect this mod to become very popular when finished.


All times are GMT -4. The time now is 05:20 PM.

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