Re: Card AI (Improvements) Requests
Posted: 09 Aug 2014, 09:11
In AI's begin of combat phase, AI activates his Vodalian Knights over and over again, giving him several instances of flying. I control no Islands, if that matters.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=26&t=7032
These problems are caused by the AI almost always picking (cards from) the human player when making choices. It's not really fit for multiplayer yet.GregBonnu wrote:I'm also having problems with the AI having a bias against me when playing Take Possession, Control Magic, and even abilities like Sower of Temptation. I'll have a Giant Octopus & opponent B has an Avatar of Woe, Player A will then precede to use one of the above abilities on my Octopus instead of the obviously better creature.
The AI has the same bias when playing Terror and will often kill the Grizzly Bears I control while another opponent has multiple 8/8's on the field.
Pumping Goblin Balloon Brigade to make it evasive is based on potential damage over the opponent's life so I presume the human player has 10+ life so the 1 damage is too small to be worthwhile. If the creature was something like Agent of Horizons with higher power, the AI is more likely to activate it. Your check for increasing the effective power is effective enough since the other solution of checking for abilities gained is horribly painful, involving hunting the stack for other "pump" effects.Agetian wrote:Something's not right with the AI deciding to pump Killer Bees (I'm playing vs a Shandalar world opponent). The AI is continuously attacking me with two Killer Bees (0/1). It has four untapped forests yet it does not ever utilize them to pump the bees, even though I have nothing to block those bees with. At first I thought it's conserving mana for spells (in which case it's stupid to attack anyway), but it turns out that the AI doesn't pump even if it has nothing else to cast... [this is as of SVN r27155, also true for the latest snapshot in the 1.5.24 release thread].
...
P.S. I noticed that with the current AI logic (both without my modification at all - i.e. before r27158 - and with my current modification as it is in r27159) the AI doesn't pump e.g. a Goblin Balloon Brigade even once (for its flying effect) in order to e.g. attack for 1 damage when the human player has Wall of Wood in play. Not sure how to remedy this.
- Agetian
Yes, I agree, and actually holding mana is probably one of the most important concepts for the AI to implement as far as mana effectiveness goes, since there is more than one spot where this might show as the AI being "wasteful" with mana before the important spells come into play. Is there any way in the current code base to implement a "look-ahead" to try and predict what the AI will cast in Main 2 anyway given the current mana base (basically, applying the same logic as in M2 but instead of actually casting things just counting the mana that is going to be spent)? For the initial "simple" version of the solution, maybe it's possible to code a look-ahead like that and, if there is anything waiting to be cast, then hold out on pumps, at least on the ineffective ones (and "ineffective" can possibly be initially defined (for simplicity) as costing 3 or more mana or something like that).excessum wrote:The AI has no way of gauging the "value" of pumping other than obviously killing or saving a creature for card advantage. Repeatable pumps that cost 1 mana like Killer Bees or Nantuko Shade sounds reasonable but there are creatures like Zof Shade and worse around and the AI will happily waste its mana on them instead of doing something else. The fact that most sorcery-speed spells are cast after combat makes it worse since it cannot save or hold up mana in anticipation. There is no simple solution for this until the AI has a concept of holding mana to cast its spells in later phases.
AFAIK the AI considers every possible choice everytime it receives priority unless otherwise specified. Every decision it makes is completely independent unless the developer(s) specifically add code to handle specific cases (ie. I added a variable to store the AI decision for Boros Charm otherwise it "forgets" the logic and makes a separate random/stupid choice).Agetian wrote:Yes, I agree, and actually holding mana is probably one of the most important concepts for the AI to implement as far as mana effectiveness goes, since there is more than one spot where this might show as the AI being "wasteful" with mana before the important spells come into play. Is there any way in the current code base to implement a "look-ahead" to try and predict what the AI will cast in Main 2 anyway given the current mana base (basically, applying the same logic as in M2 but instead of actually casting things just counting the mana that is going to be spent)? For the initial "simple" version of the solution, maybe it's possible to code a look-ahead like that and, if there is anything waiting to be cast, then hold out on pumps, at least on the ineffective ones (and "ineffective" can possibly be initially defined (for simplicity) as costing 3 or more mana or something like that).
- Agetian
Oh, bummer, I thought it would be possible to sort of "pre-execute" the AI decision making for M2 trying to see what will be viable, but if it's not possible it certainly complicates matters... Anyhow, I might be looking a bit into the AI code soon enough, so if I dig anything useful up I'll try to improve the code base to the best of my ability.excessum wrote:AFAIK the AI considers every possible choice everytime it receives priority unless otherwise specified. Every decision it makes is completely independent unless the developer(s) specifically add code to handle specific cases (ie. I added a variable to store the AI decision for Boros Charm otherwise it "forgets" the logic and makes a separate random/stupid choice).
The concept of having a proper AI decision matrix was bounced around but nobody ever got around to building it since it is hideously complicated and tedious.