Designing a better deck for highlevel MP AI

Discussion in 'Deck Building' started by turinturamba, Dec 11, 2013.

  1. I feel the current high level bot teams (Mom and cardotron) are not all that much fun to play against. This is mainly due to the fact that they behave very stupidly and try to make up for it by using overpowered cards that are not even available to the players. So let's try to build a deck for the AI that plays to its strengths without blatant cheating (some cheating is allowed).

    So here are my rules:
    - Build a deck using only items available in the game.
    - AI build is not limited by powertokens

    First we have to consider the limitations of the AI:


    The AI:
    - Does not consider attachments at all.
    - Does not buff cards well.
    - Has no concept of playing defensively and keeping its team together, always charges into attackrange.
    - Does not understand positive terrain attachments well.
    - Does not focus fire
    - Does not understand combo cards well.
    - Is easy to outmaneuver


    So here is my first draft trying to work around these limitations as much as possible:

    Xianhalzil
    Level 13 Human Priest

    Robfrale
    Level 10 Human Warrior

    Angrinn
    Level 20 Dwarf Wizard
     
    Scared Little Girl likes this.
  2. Flaxative

    Flaxative Party Leader

    So those would be the decks of the AI? Seems cool. I like how you built to the strengths of the AI (i.e. berserking in whenever possible). Though I'd be okay with upgrading some of those cards to green or purple just to make them a bit more dangerous.

    (And actually I'd rather the AI be smarter.)
     
  3. neoncat

    neoncat Feline Outline

    The next issue of MM ought to include an AI contest!
     
  4. Flaxative

    Flaxative Party Leader

    For all the AI programmers amongst us? Sounds fun but also like BM would have to put out vastly different tools.
     
  5. Jon

    Jon Blue Manchu Staff Member

    I'm all for this. I don't see why we couldn't take a deck like this and build an AI to use it. Perhaps we'll even swap it in to replace Cardotron's deck.

    I don't think we're ever going to build an AI that can compete against a human without cheating, i.e. using decks that wouldn't be allowed for human players. So I would relax your constraint and allow yourself to use ANY cards in the game.

    I'm also open to any thoughts you have about simple things we could do to the AI to make it more competitive. We can obviously hard code in constraints like not attacking someone with a Nimbus on, but that's always going to be a fragile way to do things.
     
    turinturamba likes this.
  6. Flaxative

    Flaxative Party Leader

    Patches like those might be imperfect, but I do think they'd help a bunch...
     
  7. Player1

    Player1 Mushroom Warrior

    Well, some observations for the AI first. (based on my single player experience long long ago):

    First, the AI algorithm:
    1. There is some optimum range variable that AI will try to maintain. Melee guys: 1, stab guys: 2, range guys: 2+;
    2. If the distance between any enemy is less than optimum range; AI will run away from enemy. I think the AI is smart enough to recognize multiple enemies, IE, they will not run into another melee enemy. Probably some algorithm that maximize the sum of distance between all enemies.
    3. If an enemy is in sight; attack enemy with random attack.
    4. If no enemy is in sight or need to run; try to move within line of sight of enemy so the AI can attack next turn. I think the AI sometimes violate its optimum range variable here.
    5. Otherwise, move towards closest target. The AI seems to have some sort of path finding implemented which allows them to move toward their target in mazes (Stanford treasure fight).
    Some general observations:
    1. At AI's turn, it seems to select a character to move/attack at random.
    2. AI have a random chance (10%?) to pass its turn.
    3. AI have very limited understanding of positioning short of the optimum range variable described above.
    4. AI have no understanding of unit attachments and terrain attachments.
    5. There is some weight given to Victory Squares which the AI will try to remain in.
    With that in mind, I think its obvious the AI is poor at playing wizards and priests. It makes sense therefore, for the AI to play mostly warriors with its all out attack mentality. In particular, step attacks is particularly nice because AI is terrible at positioning. Whats the best step attack in game? Nimble strike. How to get the most nimble strikes on a warrior? 2 Vibrant Pains. So then, I would put in 2 warriors with 2 Vibrant Pain each.

    Now the next question is priest or wizard? AI probably is bad at playing either. Now, it is unlikely that we can make an AI competitive all the time, but we can make the AI competitive SOME of the time. What this means is that AI should favor RNG and hit-all cards. Since we know AI sucks at tactical plays anyways so we will try the hardest to deny the player the opportunity to play tactically. The best card to destroy tactical positioning play? Whirlwind (enemies). Similarly, whats the most reliable way to deal damage to all targets? Firestorm (AI can cheat and get more than 1 resistant hide). Therefore my vote for the 3rd guy is a wizard with whirlwind (enemies) and firestorm.

    TLDR: 2 warriors with loads of nimble strike, 1 wizard with WW(E) and firestorm.
     
  8. Phaselock

    Phaselock Bugblatter

    You can build an AI that doesn't cheat and still be competitive. The bottleneck here is the time it takes to decide what best to do isn't (a) likely to be fast enough if your heuristics involve some form of deep search and (b) will bog down the server when running multiple instances. Anything else isn't going to be intelligent enuff and will prolly be broken/deciphered by humans once out of the gate.

    No offense. AI doesn't use item decklists and you might wanna read the dev blog (http://www.cardhunter.com/2012/05/the-ai-in-card-hunter/).
     
  9. Player1

    Player1 Mushroom Warrior

    AI doesn't use item decklist is irrelevant to me as I did not suggest a decklist. That link is interesting. But it didnt really show us things that we didnt already know from general observations. Eg, AI will prioritize attack; AI values move much more than pass; some weight is given to VS and units tends to maintain a certain range.
     
  10. Martin K

    Martin K Goblin Champion

    @Phaselock: Thanks for the link.
    So for AI attacking PCs with Nimbus / Resistant Hide, there seems to be an issue with the attack card ranking on the monster side. Does the AI take revealed PC cards and attachments into account? If a monster has, say, Powerful Hack, but can only reach a PC with Nimbus, that card should get a massive priority penalty. It doesn't need to be completely zero, the AI is allowed to make mistakes, but it could play a bit smarter.

    Right now, the AI seems to massively prioritize attacking whichever PC has the least hp. I'm playing 3 clerics right now in high-level SP. I have quite a lot of Nimbus in my deck. I've beaten those maps quite easily just by keeping my guys close and nimbussing whoever is on low hp.
     
  11. Kalin

    Kalin Begat G'zok

    What do people think of this? I'm giving the AI 12 major tokens, but otherwise sticking to normal deckbuilding rules.

    2x Ninja:
    Dwarf Warrior
    Vibrant Pain
    Vibrant Pain
    Vibrant Pain
    Lieutenant's Cap
    Bern's Untouchable Mail
    Slippery Shield
    Winged Track Shoes
    Superb Impaling
    Perfect Ferocity

    1x Chaosmage: (spams attachments to push off Nimbus)
    Dwarf Wizard
    Staff Of Burning Ice
    Sub-zero Staff
    Firebrand Mantle
    Barnum's Burning Bauble
    Teak Horn
    Rod Of Winds
    Xander's Boots
    Perfect Toughness
    Advanced Pyromancy

    Not sure what to use for the last arcane item. Also, it may be better to have one ninja and two chaosmages. Problem is, we can't really test this ourselves.
     

  12. I do not think that warrior AI would be much fun to play against. One trick ponies are pretty boring. Additionally the warrior deck is very light on damage and the AI is not all that good with step moves, frequently wasting them when frozen. The AI also does not understand hard to pin down, so slippery shield is bad.

    I like the idea behind the wizard, but I do not think the intended effect of pushing attachments off would work often. However I think it would be a fun deck to play against because it is so unpredictable.
     

  13. Some things that could help the AI, hard to say what is simple and what is not without knowing your AI code:

    - Prevent the AI from using move cards if it has only 2 cards left and it is not threatened. (I.e the valuation of the square it is standing on is not substantially lower than other reachable squares). Would prevent the AI from stupidly charging ahead and exposing itself.
    - Make the valuation of squares dependent on the number of cards in hand. The fewer cards an AI has, the lower the value of squares close to enemy chars is.
    - Prevent the AI from using the move effect of combo cards (Hard to Pin Down, Surging Shield Block, Dodge, Jump Back)
    - Increase the valuation of a square if it is closer to its allied chars. (Probably not easy to get right without unintended weird results)
    - Add a tag for untargeted heals, so the AI understands that it should only use them if at least one char is damaged.
    - Increase the value of cards from characters close to enemy characters. Should hopefully have the effect that the AI plays through one char, before moving others.
     
  14. Kalin

    Kalin Begat G'zok

    Which is why he has Bern's Untouchable Mail. And if he doesn't draw the armor, there's a chance he'll get hit by the chaosmage's AoE attachments, pushing the encumber off.

    The AI is horrible about using Dodge, but Hard To Pin Down is a true Block, so even if the AI moves stupidly, it still cancels the attack. And I expect the AI to use it to move towards the closest player char, which is a decent strategy.
     
  15. The AI usually uses it as a run card. It does not understand that it is almost always better to keep it in hand until it triggers.
     
  16. Gerry Quinn

    Gerry Quinn Goblin Champion

    It needs to understand something about attachments. 'Path of Knives' could be renamed 'Suicidal Impulse' when attached to an AI character!

    Focus-fire would also make it stronger. A big difference between a human and an AI player is that the human knows which enemy he or she is trying to kill first, and will opportunistically focus on one which makes itself vulnerable.

    However, I think things like attachments are a higher priority because they are more harmful to the illusion of AI. I doesn't really matter so much how good or bad the AI is; what's important is that you feel it is giving you a good game. So it's more important that it not do very silly things (like wizards moving unnecessarily with Path of Knives on) than that it do clever things.
     
  17. Suggested AI Tactics:

    * If target [has nimbus] ignore target, UNLESS attack can inflict status or cause target to discard cards, or unless AI has enough cards to inflict 3 statuses on target in hand.
    * AI no longer passes a turn first, unless AI has no viable cards to play, or is dominating the capture point (s).
    * AI will prioritize attacking wizards first, then priests, then warriors GENERALLY.
     
  18. bluesage

    bluesage Mushroom Warrior

    Mentioned this elsewhere, but one problem with putting Demonic Power into the AI deck is that the AI will happily cast it even when they are at 3 life or below...
     
  19. bluesage

    bluesage Mushroom Warrior

    I think the biggest thing that could be done to improve the AI is simply having it actually consider all the visible cards (including cards in hand and attached cards) before taking an action. We don't expect the AI to be able to make good guesses about unrevealed cards, but it should be able to avoid taking actions that are blatantly self-defeating.

    Specifically:

    * If you attack character X with card Y, what do we KNOW will happen based upon visible cards? If the answer is "you will do zero damage because they have Nimbus on" or "your attack has a 0% chance of penetrating their visible armor" or "your attack has a 16% chance of making it past their two visible Parry cards" then perhaps a different action should be preferred.

    * Similarly, another thing the AI should always consider is "will this action kill me or my ally". If you are at 3 life, you should probably not cast Demonic Power or Backbiting Strike (unless your armor guarantees you will survive). If your ally is at 2 life, you should likewise be careful about casting Unholy Wellspring on them.

    To some extent, I think card-specific coding is absolutely required, and is nothing to be ashamed of. Any smart human player certainly treats an enemy buffed with Inpenetrable Nimbus or Martyr's Blessing very differently, and so should the AI.
     
  20. bluesage

    bluesage Mushroom Warrior

    To answer the original poster's question, how to build a good deck using for the current AI:

    1. The AI is bad at dealing with attachments, so Arrogant Armor and Purge-type effects (like Shrug It Off) will help minimize that disadvantage.

    2. I would not suggest using all step attacks, since their damage is weak and the AI won't have any buffs to improve them. Instead, a mix of step attacks and huge damage attacks like Obliterating Hack.

    3. For Wizards, I don't think that Whirlwind cards work to the AI's advantage, since the AI seems to cast these cards at random times rather than only when they would be advantageous. Instead, I would suggest just putting lots of big attack cards on the wizard, like Obliterating Spark, Arcing Spark, Fireball.

    4. For defense, load up the chars with top quality blocks/armor like Absorbing Block, Toughness, etc.

    Actually, I think Cardotron already does a lot of these things. But it does also include some cards (like Dodge) that the AI uses poorly, and effectively end up being dead cards.

    The other thing to experiment with might be different combinations of characters. Instead of always having cardotron run 1-1-1, maybe try all combinations of characters (3 wiz, 3 war, 3 priest, 2 wiz 1 priest, 2 wiz 1 war, 2 war 1 priest, etc) and see which ones are most effective. I'd be curious to see where each combination ends up rating-wise. Plus it would add some variety to the random AI matchups.
     
    turinturamba likes this.

Share This Page