AI Improvement

All about getting the AI less baka...
Post Reply
Szei
Posts: 218
Joined: Sat Nov 15, 2008 8:14 pm
Location: USA

Re: AI Improvement

Post by Szei »

wololo wrote:I think Szei meant "activated abilities" instead of "tap abilities".
To answer: The AI should select the target "correctly" most of the times. It "knows" if a card has a good or bad effect, and will cast the good ones on its cards, and the bad ones on your cards.(This has been the case since the beginning)
There are a few cases for which the AI isn't always efficient (it will always cast swords to plowshares on your creatures), and sometimes for which it is completely lost (it will always cast hardcoded spells on your cards, assuming they are "bad")

Edit: if you find card or effects that the AI casts completely incorrectly (i.e., casting it on its cards when it should obviously ast it on yours, or the other way around) please let us know
Quoted from the 2nd AI Deck Competition thread.


-Beacon of Immortality is currently recognized as a 'bad' card. Should be 'good'.
-Deathbringer Liege's tap and destroy abilities are recognized as 'good'. Should be 'bad'. (This was in 0.9, it might have been changed in 0.10, haven't had time to check).

If I find more, I'll post them.
Image
Rob
Posts: 33
Joined: Sun Aug 16, 2009 7:34 pm

Re: AI Improvement

Post by Rob »

The AI will cast Damnation, Pestilence and Pyroclasm without any creatures in play.
I suspect all cards like these may suffer the same fate.

AI does not choose the most appropriate land to play from its hand.
The AI has 6 lands 4 swamps and 2 mountains and a red card that requires 2 red mana and one colorless.
The AI may play 3 swamps before it ever plays a mountain. Or may play a swp, mtn, swp, swp, mtn.

Image Image Image
Image Image
· Poof!! · Backlash ·
mickey_brown
Posts: 217
Joined: Sun Sep 13, 2009 6:32 am

Re: AI Improvement

Post by mickey_brown »

Some of the dumbest things I've seen the AI do have probably been mentioned. Sometimes it won't block any of my creatures even though I'm going to kill it.
It will attack with creatures that have 0 attack.
It will drop multiple wrath of god/damnation cards in a row.
wont try to chump block the strongest attacker.
Szei
Posts: 218
Joined: Sat Nov 15, 2008 8:14 pm
Location: USA

Re: AI Improvement

Post by Szei »

mickey_brown wrote:Some of the dumbest things I've seen the AI do have probably been mentioned. Sometimes it won't block any of my creatures even though I'm going to kill it.
It will attack with creatures that have 0 attack.
It will drop multiple wrath of god/damnation cards in a row.
wont try to chump block the strongest attacker.
The last two points seem like they would be harder to implement. The third would require the AI to know what to do for specific cards... the fourth point requires the AI to use a more complex strategy. 'Chump blocking' the strongest attacker isn't *always* the best move. The first point I have noticed all too often. I don't believe it would be too difficult for the AI to perform a check to see if it will die if it doesn't block. It's especially stupid when the AI wouldn't even lose creatures from blocking, but still chooses not to block and so suffers defeat... (see my example on the previous page). The second point also appears like something that would be simple to fix but as I haven't actually worked on Wagic, I wouldn't know.
Image
mickey_brown
Posts: 217
Joined: Sun Sep 13, 2009 6:32 am

Re: AI Improvement

Post by mickey_brown »

The AI needs to
1.)Start with the strongest attacking creature, and check to see if any of its defenders are strong enough to survive blocking it. If so, it blocks with it.
2.)Repeat step 1 for each attacking creature, starting with the strongest and ending with the weakest.
3.)If it doesn't have a creature remaining that is strong enough to block an attacking creature, it must determine if not blocking that creature will cause it to lose. If so, it has no choice but to block anyway.
4.)If the attacker isn't strong enough to kill the AI, but it has a high attack (lets say >4) and doesn't have trample, the AI chump blocks with its weakest defending creature.

As for wrath of god, damnation, ect...
When the ai plays any spell that "targets all X"
it needs to check if the enemy actually has any X.
Xitoshi
Posts: 7
Joined: Wed Dec 30, 2009 10:03 pm

Re: AI Improvement

Post by Xitoshi »

mickey_brown wrote:The AI needs to
1.)Start with the strongest attacking creature, and check to see if any of its defenders are strong enough to survive blocking it. If so, it blocks with it.
2.)Repeat step 1 for each attacking creature, starting with the strongest and ending with the weakest.
3.)If it doesn't have a creature remaining that is strong enough to block an attacking creature, it must determine if not blocking that creature will cause it to lose. If so, it has no choice but to block anyway.
4.)If the attacker isn't strong enough to kill the AI, but it has a high attack (lets say >4) and doesn't have trample, the AI chump blocks with its weakest defending creature.

As for wrath of god, damnation, ect...
When the ai plays any spell that "targets all X"
it needs to check if the enemy actually has any X.
Do you do that when you block?

There are at least three questions you should do.

The first question is "when should I block?"
a) When you're gonna die.
b) When you can destroy a card that could be dangerous. (This involucrates, moreover, spells and habilities of direct damage)
c) When you have lot of chances to block without loose any creature. (Blocking 1/1 with 2/2 and without any card in battlefield wich can give advantage to the 1/1 creature. This almost depends on the enemy deck)

The second question is "when could I don't block?"
a) When the enemy damage is asumible.
b) When you need one of your cards, and it's preferible to keep that card in game than have more lives. (Combo cards or creatures you need in the next turn to win the game, for example)
c) When it is good to you.
As you can see, these answers are related to each deck, and his strategies.

And the third question is "I should block wich creatures with wich creatures?" This is very related to the other two questions, and the solution is different in each specific situation, depending almost on the strategies of the decks. Some general rules that can help are:
a) Try to minimize the damage the enemy would do to you. E. g. blocking an Spark Elemental (3/1, sacrifice it at the beginning of the end step) with the Tundra wolves (1/1 with first strike), or the Angelic wall (0/4) is the same, because the Spark elemental would not do damage to the player, it would die and none of your creatures would die. But if that Spark elemental has first strike and trample (because of habilities or spells), the best thing to do is block it with the Angelic wall. With more creatures, the complexity of the decision increases.
b) Try to maximize the damage that you do to enemy creatures. It is very difficult to decide, because this depends too much in the enemy's and own strategies. Sometimes is better to block a Tarmogoyf with the entire army (with the risk of loosing the battle and making it more powerful), and sometimes better to wait until next turn in order to cast a killing spell or put in game a powerful card. The best which fit this example is the Scion of the Wild (*/*, power and toughness are each equal to the number of creatures you control). This involucrates almost some damage spells and habilities, combining it witth the damage your creatures do.
Sorry about my poor english; I try my best, but it seems to be insufficient V_Vu
seguuro
Posts: 18
Joined: Sat Jan 02, 2010 12:18 pm

Re: AI Improvement

Post by seguuro »

mickey_brown wrote: As for wrath of god, damnation, ect...
When the ai plays any spell that "targets all X"
it needs to check if the enemy actually has any X.
yeah, in fact I saw the AI use Tranquility with no enchantments in play and Tsunami with no islands..

by the way, is the AI able to use any stat-modifier instant in battle? I recall it wasting a spell on its creatures after the battle..
Psyringe
Posts: 1163
Joined: Mon Aug 31, 2009 10:53 am

Re: AI Improvement

Post by Psyringe »

The AI's probability of playing cards like Wrath of God is influenced by the number of affected cards your battlefield vs the number of affected cards on the opponent's battlefield. However, the AI also assumes that any card in its deck is good for it, so sometimes it plays Wrath of God purely based on this assumption, which may turn out to be wrong depending on the gamestate.

Regarding Instants: I don't think the AI uses instants during battle, though I never did a thorough test (or checked the code) for that.
Saint
Posts: 434
Joined: Sat Jan 09, 2010 4:57 pm
Location: Netherlands

AI sometimes a bit retarted

Post by Saint »

I noticed the AI being a bit retarted since 10.1 as an example i had nothing that could block flying creatures, computer puts down a enchantment that stops me from attacking with non flying creatures. End of it all he had tons of flyers but since i had 40/40 pumped up creatures he didn't attack and i won because he coulden't draw any more cards...

Other example i have a 246/243 elf a 110/110 elf and another something high elf and a ton of tokens, the AI clones and manipulates the tokens (taking them over) instead of the gigantic elf creatures i had on the table... not the best choice in my point of view.

I'll add other retarted actions later while I continue playing but it might be something to look into :P
"The bird of the Hermes is my name, eating my wings to make me tame." - Ripley Scrowle, Elias Ashmole's Theatrum Chemicum Britannicum - 1652
Psyringe
Posts: 1163
Joined: Mon Aug 31, 2009 10:53 am

Re: AI sometimes a bit retarted

Post by Psyringe »

Yep, these are known issues with the current AI (not new to 0.10.1 though, they've always been there). The AI does not realize evasion abilities on its creatures (flying, shadow, fear etc.) and therefore often misses opportunities for riskless attacks. It also prioritizes targets depending on how much damage they dealt to it in the current game and in previous games, which often works quite well, but breaks down for decks which produce tons of tokens, or creatures with huge P/T that haven't attacked yet.

It's something we're very interested in improving, but finding an algorithm that makes smart decisions, works on low hardware, and is generic enough to not fail in other situations, isn't easy. But we're working on it. :)
Post Reply