It is currently 15 Aug 2018, 18:38
Text Size

How do i share 3 decks tailored to the mad AI's limitations?

by BetaSteward

Moderators: LevelX, BetaSteward, North, escplan9, noxx, Aurum, fireshoes, jeffwadsworth, TheElk801, CCGHQ Admins

How do i share 3 decks tailored to the mad AI's limitations?

Postby Efferio » 22 Apr 2018, 18:33

This is only my second post to the forums so apologies for everything I might be doing wrong 8-[

First off, here's my question: would anyone be interested to try out 3 decks specifically tailored for the mad computer, so it will play with a slightly better chance of winning against you?

And if so, what's the best way of making those decks available here: some type of download link like a handle to a google drive file, or an attachment appended to a post, or just the entire card lists as whole posts?

Here's the background story: For all kinds of reasons, with most decks the mad computer hardly ever wins against a human opponent. If it does win then it's typically because the human player happened to be super unlucky with mana development (= drawing lands only, or none at all). As a fun challenge, I've been spending some time playing against the AI by giving it various AI-limitations-tailored decks to see if it can nevertheless make a reasonably effective sparring partner, for testing my "legit" decks against a bit more seriously than just for early mana issues.

There seem to be three sets of issues with the AI:

1) It's almost completely compulsively rule-based = immediately executes a programmed set of very simple rules without first evaluating the outcome of its actions or considering alternatives to see if it will come out ahead or not. In that sense it's not intelligent but rather an automaton.

2) Some cards simply won't be played correctly, because the AI either makes no meaningful choice, or it chooses completely randomly rather than picking the obviously best option.

3) Quite a few decks will cause the AI to crash in a recognizable pattern, where it first slows down significantly by taking forever to complete the phases of its own turn, then freezes up completely while its timer stops counting down. Once frozen it won't recover until my laptop is completely rebooted. Quitting and restarting mageframe after it's gone into slow mode but before the freeze happens doesn't help either, that too requires a full reboot to fix.

For issue (1) an example of a very simple compulsive rule is: if the card text includes the verb "may" then the AI always carries out the effect or option specified after "may". If it has Necropede and other creatures out on the battlefield while the human opponent has none, then destroying Necropede always results in the AI putting a -1/-1 counter on one of its own remaining creatures.

Two examples of issue (2): If the AI's opening hand includes a land that requires sacrificing land or returning land to its hand, it will play the condition-limited land and then immediately destroy/return it. For the return-a-land-to-your-hand type, it will keep trying turn after turn so it never gets anywhere with its mana development. Or if a card requires making a choice like a particular color for protection, or a creature type that will be affected, then the AI often chooses randomly. It plays Council Guardian by picking a random color, so the guardian often ends up with protection from a color that no player is actually playing with.

Other cards or effects won't get played at all, most notably the AI never does any spell countering. (1) + (2) means the AI cannot play counter-based control decks effectively at all. Certain decks with lots of blue cards might still work for it (lots of flying creatures and permanent-tapping/returning effects?) but I haven't tried that route at all yet.

It would be fun if the AI could be made smarter in future updates of xmage, but that's not a criticism. All the massive work that goes into continuously improving the xmage platform and adding/fixing cards is an amazing achievement, and obviously takes priority.

In fact, I'm happy to deal with the mad computer as is and treat it more like a deck-building puzzle: what exactly are the rules it adheres to, which decks stay out of server-freezing trouble, and is it possible to create decks for it that will be reasonably effective despite its complete lack of choice-making and forward-thinking abilities?

Obviously that means picking cards with minimal shoot-in-the-foot potential due to its type (1) compulsions, as well as leaving out all cards which cause type (2) issues. Not ideal, but there are so many other cards that are trouble-free, so it doesn't really have to hold back the mad AI from scoring wins at least some of the time. The freeze issue is harder to deal with. It crops up quite often and even when testing some very similar red-heavy decks I haven't been able to pinpoint why one deck doesn't cause the AI to freeze frequently while another does. So that has turned out to be a process of elimination by trial & error.

On the plus side, there nevertheless are quite a few decks with which the AI can hold its own in one out of three games or better, even against a moderately intelligent opponent (myself) playing all kinds of super duper multi-choice cards or carefully timed effects. The 3 decks I've been sparring with that are largely free of the freezing issue, and capable of averaging 1 win out of every 3 games against my better "legit" decks are a green-black poison/deathtouch deck with rapid mana growth, a black-green zombie deck with lots of pumping and graveyard effects, and a reasonably fast red/white deck with decent capabilities for burn and haste damage.
Posts: 5
Joined: 15 Dec 2016, 22:43
Has thanked: 0 time
Been thanked: 0 time

Re: How do i share 3 decks tailored to the mad AI's limitati

Postby LevelX » 24 Apr 2018, 22:21

We can add your "tuned" AI decks to the example decks in a new folder like "AI suitable decks".

You can post add the deck lists here or create an issue in the git hub project.
I will add the decks then with the next release.

And thanks for your detailed AI problem analysis.
If I got the time I look if I can fix some of the problems.

Also if you identify cards that causes the AI to freeze post the names.
I'm always looking for reproducable AI problems. That's always a good starting point to fix a problem.
User avatar
Posts: 1665
Joined: 08 Dec 2011, 15:08
Has thanked: 173 times
Been thanked: 370 times

Re: How do i share 3 decks tailored to the mad AI's limitati

Postby Efferio » 28 Apr 2018, 20:23

Ok great, I'll post them 1 deck at a time!

The following is a green/black deck with lots of deathouch, poison, infect and wither critters, combined with a selection of elves for fast mana development. One of the things the AI does very well is equipping deathtouch critters with bow- or arrow-type artefacts, then killing its opponent's strongest monsters with a single point of damage, so there are several noncombat-damage-dealing artefacts in the deck as well. (See below for some more notes viz AI behavior that occurred to me while my testing it with this deck and some variants)


1 Sisters of Stone Death
1 Blooming Marsh
1 Oran-Rief, the Vastwood
1 Reclamation Sage
1 Forest
1 Forest
1 Deadly Recluse
1 Dryad Arbor
1 Swamp
1 Indulgent Tormentor
1 Swamp
1 Scorned Villager
1 Leaden Myr
1 Gaea's Cradle
1 Graveblade Marauder
1 Golgari Keyrune
1 Deathreap Ritual
1 Gilt-Leaf Palace
1 Gnarlroot Trapper
1 Pharika, God of Affliction
1 Overgrown Tomb
1 Life's Legacy
1 Gnarlwood Dryad
1 Skinshifter
1 Phyrexian Swarmlord
1 Maze Abomination
1 Holdout Settlement
1 Hissing Quagmire
1 Duskwatch Recruiter
1 Deathcap Cultivator
1 Pathway Arrows
1 Phyrexian Juggernaut
1 Nath of the Gilt-Leaf
1 Bladed Pinions
1 Hand of the Praetors
1 Llanowar Reborn
1 Forest
1 Reaper of Sheoldred
1 Forest
1 Glistener Elf
1 Forest
1 Druid of the Cowl
1 Forest
1 Forest
1 Swamp
1 Quicksand
1 Ukud Cobra
1 Twinblade Slasher
1 Noxious Hatchling
1 Thornbite Staff
1 Darksteel Ingot
1 Jungle Hollow
1 Sluiceway Scorpion
1 Narnam Renegade
1 Ulvenwald Captive
1 Hythonia the Cruel
1 Harvester of Souls
1 Inkmoth Nexus
1 Plague Myr
1 Mortuary Mire
1 Reaper of the Wilds
1 Deathgreeter
1 Jund Panorama
1 Crypt Cobra
1 Mox Diamond
1 Swamp
1 Wolf-Skull Shaman
1 Gyre Sage
1 Orochi Sustainer
1 Bow of Nylea
1 Skithiryx, the Blight Dragon
1 Viridian Corrupter
1 Ophiomancer
1 Xathrid Gorgon
1 Glissa, the Traitor
1 Rot Wolf
1 Meren of Clan Nel Toth
1 Resourceful Return
1 Fate Unraveler
1 Forest
1 Elvish Archdruid
1 Ichorclaw Myr
1 Sachi, Daughter of Seshiro
1 Necropede
1 Volrath's Stronghold
1 Werebear
1 Sabertooth Cobra
1 Leechridden Swamp
1 Swamp
1 Swamp
1 Golgari Signet
1 Throne of the God-Pharaoh
1 Shaman of Forgotten Ways
1 Beastcaller Savant
1 Graverobber Spider
1 Virulent Wound
1 Blightwidow
1 Rupture Spire
1 Viridian Longbow
1 Forest
1 Matsu-Tribe Sniper
1 Svogthos, the Restless Tomb
1 Sultai Flayer
1 Blood Seeker
1 Immaculate Magistrate
1 Llanowar Dead
1 Wurmcoil Engine
1 Sixth Sense
SB: Blood Scrivener
SB: Stinkweed Imp
SB: Warriors' Lesson
SB: Meren of Clan Nel Toth
SB: Abundant Maw
SB: Narnam Cobra
SB: Decimator of the Provinces
SB: Signal Pest
SB: Distended Mindbender
SB: Gladehart Cavalry

Note1: The AI doesn't normally attack unless one or more of its creatures have higher power than the human player, even if it has oodles of lightweight creatures that would score an immediate win if it went for an all-out attack. Deathtouch is one of the few abilities that makes it choose to attack with all creatures that have it, no matter the toughness of the blockers on the human player's side.

Note2: Two other abilities that make the AI attack regardless of the power of the human player's blockers are: indestructible and undying. Double strike, first strike, flanking and color protection don't seem to register in its attack or defense decisions.

If you would have time and interest to improve the AI then my suggestion would be to start with one or more of the following as first steps most likely to improve its performance stats for a single coding task. As before, I'm not saying these should be priorities over other coding tasks, just some ideas if in case this might make sense:

a- Make the AI attack all-out when a direct win is inevitable from what it can see out on the battlefield. Especially if the human player is all tapped out and handless, so no instants or flash actions are likely (if the human has untapped mana then it could be fun to let the AI apply a semi-random decision switch that causes it to attack more frequently with fewer cards in the human player's hand and/or fewer untapped mana sources on his or her side).

b- Make the AI block with deathtouch/infect/wither/color protected creatures for the attackers color. In the case of D/I/W creatures they should block even if that will kill the blockers in question, or perhaps have a semi-random decision switch that makes D/I/W creatures block at least some of the time. At the moment it never assigns multiple blockers to one attacker, and a single blocker never blocks unless it will kill an attacker by its sheer power alone. On top of -a- above, failures to block are another major reason why it doesn't make proper use of decks designed for abundant creature generation.

c- Add an attack decision switch for creatures with one or more of the other abilities that will give an attacking creature with sufficient power the edge over the toughest blockers on the human player's side (= first and double strike, color protection, flanking)
Posts: 5
Joined: 15 Dec 2016, 22:43
Has thanked: 0 time
Been thanked: 0 time

Re: How do i share 3 decks tailored to the mad AI's limitati

Postby Efferio » 28 Apr 2018, 20:56

Number 2 is a black/white/green deck with lots of zombies and skeletons, lots of pumping and resurrection effects, graveyard-filling advantages, with some of the more fun oozes and horrors thrown in to boot. The half dozen zombie-pumping creatures aren't just there because of the zombie theme: they result in the AI attacking more frequently because its creatures more often reach power levels exceeding all of the human player's blockers in play. Mana development isn't particularly fast, but things like Black Vise and Vengeful Pharaoh can still make it delightfully unpleasant right from the early turns:


1 Desecrator Hag
1 Noxious Ghoul
1 Terramorphic Expanse
1 Swamp
1 Vengeful Pharaoh
1 Kitchen Finks
1 Swamp
1 Liliana's Reaver
1 Gray Merchant of Asphodel
1 Mikaeus, the Unhallowed
1 Quest for the Gravelord
1 Swamp
1 Jarad, Golgari Lich Lord
1 Vulturous Zombie
1 Lord of the Undead
1 Wanderer's Twig
1 Canopy Vista
1 Benefactor's Draught
1 Phyrexian Crusader
1 Stitch Together
1 Skullbriar, the Walking Grave
1 Dark Ritual
1 Black Vise
1 Dreg Mangler
1 Paraselene
1 Forest
1 Geralf's Messenger
1 Deathrite Shaman
1 Gravecrawler
1 Scattered Groves
1 Skinthinner
1 Stronghold Assassin
1 Sapseep Forest
1 Festering Mummy
1 Consumptive Goo
1 Grim Haruspex
1 Undead Warchief
1 Forest
1 Snake Umbra
1 Sudden Spoiling
1 Lord of the Accursed
1 Windswept Heath
1 Llanowar Reborn
1 Strength of Night
1 Swamp
1 Cabal Ritual
1 Heroic Intervention
1 Chainer's Edict
1 Grasslands
1 Loam Dryad
1 Fume Spitter
1 Inexorable Blob
1 Forest
1 Bone Picker
1 Krosan Verge
1 Scavenging Ooze
1 Molder
1 Stromgald Crusader
1 Sewer Nemesis
1 Wall of Limbs
1 Paragon of Open Graves
1 Zombie Master
1 Avacyn's Pilgrim
1 Diregraf Colossus
1 Death Baron
1 Phyrexian Obliterator
1 Make a Stand
1 Skinrender
1 Barren Moor
1 Desert of the Glorified
1 Renegade Map
1 Ghost-Lit Stalker
1 Kokusho, the Evening Star
1 Binding Mummy
1 Choking Sands
1 Creakwood Liege
1 Plains
1 Mana Web
1 Rotlung Reanimator
1 Rancid Earth
1 Swamp
1 Godless Shrine
1 Secluded Steppe
1 Tranquil Thicket
1 Unholy Grotto
1 Sol Ring
1 Glissa, the Traitor
1 Bayou
1 Overseer of the Damned
1 Blood Seeker
1 Wayward Servant
1 Risen Executioner
1 Desecration Plague
1 Essence Warden
1 Virulent Swipe
1 Werebear
1 Graf Harvest
1 Leechridden Swamp
1 Swamp
1 Bant Panorama
1 Isolated Chapel
1 Swamp
1 Gavony Unhallowed
1 Drana's Emissary
1 Victim of Night
1 Duty-Bound Dead
2 Woodland Cemetery
1 Ancient Den
1 Evolution Charm
1 Scourge of Nel Toth
1 Scrubland
1 Obzedat, Ghost Council
1 Twilight Mire
1 Forest
1 Wooded Bastion
1 Vault of the Archangel
1 Zombie Apocalypse
1 Ready // Willing
1 Llanowar Dead
1 Cemetery Reaper
1 Suture Priest
1 Plague Belcher
1 Ainok Survivalist
1 Tree of Tales
SB: Ghoulcaller Gisa
SB: Whip of Erebos
SB: Cairn Wanderer

Note: morph and megamorph creatures aren't necessarily played the smartest by the AI, but it definitely does play better with three or more of them, and not just for a zombie theme but also variants of both other decks. Outlast and similar abilities seem to be handled more compulsively, with outlast for example it will keep adding a counter to the creature in question, even if it would benefit much more by using it to attack or block.
Posts: 5
Joined: 15 Dec 2016, 22:43
Has thanked: 0 time
Been thanked: 0 time

Re: How do i share 3 decks tailored to the mad AI's limitati

Postby Efferio » 28 Apr 2018, 21:20

Number 3 is a white/red burn+haste deck that can give my blue-centric control decks a lot of trouble, but also performs well with decks of the green/red or red/white/black variety that have super powerful beasts/elementals/dragons/angels/demons etc with pretty hefty casting costs. In this case the combination of direct damage and haste can bypass the AI's many limitations in mounting organized multi-critter attacks or solid defense lines, because it will play them literally as soon as it has a few lands out. Some land destruction then helps keep back the human player's game, once the AI has 3 or more mana sources out.

A number of slower-to-cast creatures with indestructible or undying make for reasonable effectiveness in mid-game, if it hasn't succeeded in winning early on. It often doesn't do very well in the later stages though, because it is usually unable to hold back on any cards once it can produce the mana to play them, so X-cost cards are generally wasted on it (which is why there are hardly any in these three decks). See note below.


1 Mountain
1 Soulmender
1 Plains
1 Plains
1 Charging Cinderhorn
1 Plains
1 Akroma's Memorial
1 Plains
1 Firebolt
1 Weaver of Lightning
1 Inspiring Vantage
1 Skyship Stalker
1 Firecannon Blast
1 Needle Spires
1 Wildfire Emissary
1 Mikaeus, the Lunarch
1 Burst Lightning
1 Avacynian Priest
1 Beasts of Bogardan
1 Roast
1 Mountain
1 Mountain
1 Mountain
1 Boros Signet
1 Firebolt
1 Reciprocate
1 Mountain
1 Goblin Ruinblaster
1 Neheb, the Eternal
1 Manticore Eternal
1 Plains
1 Hound of Griselbrand
1 Blistering Firecat
1 Boros Recruit
1 Caravan Escort
1 Volcanic Offering
1 Village Messenger
1 Monastery Swiftspear
1 Thermal Glider
1 Lightning Bolt
1 Hammerheim
1 Snare Thopter
1 Mountain
1 Draconic Roar
1 Gauntlet of Might
1 Dwarven Blastminer
1 Mountain
1 Mountain
1 Mountain
1 Lightning Blast
1 Punishing Fire
1 Plains
1 Plains
1 Mountain
1 Mountain
1 Plateau
1 Plains
1 Satyr Firedancer
1 Hellrider
1 Cinder Giant
1 Blaze Commando
1 Searing Blaze
1 Sulfurous Blast
1 Outnumber
1 Crimson Acolyte
1 Tajic, Blade of the Legion
1 Legion Loyalist
1 Disciple of Law
1 Exquisite Firecraft
1 Oketra the True
1 Flameblast Dragon
1 Mountain
1 Lava Blister
1 Sandblast
1 Clergy of the Holy Nimbus
1 Fire Imp
1 Mountain
1 Chandra's Spitfire
1 Nahiri's Machinations
1 Mountain
1 Mountain
1 Cinder Hellion
1 Slumbering Dragon
1 Plains
1 Soul Warden
1 Ghostfire
1 Lightning Helix
1 Firebrand Archer
1 Zhalfirin Crusader
1 Plains
1 Figure of Destiny
1 Plains
1 Meteor Blast
1 Firehoof Cavalry
1 Guardian of the Guildpact
1 Flames of the Firebrand
1 Burning Oil
1 Boros Swiftblade
1 Plains
1 Mountain
1 Boros Reckoner
SB: Wildfire Eternal
SB: Crown of Doom
SB: Glaring Spotlight
SB: Glory-Bound Initiate
SB: Smoldering Werewolf
SB: Glorybringer
SB: Smoke
SB: Manor Gargoyle

Note: The AI has no noticeable ability to hold back on sorceries and creatures with X-based costs or massive late-game potential a la Fireball: a lot of cards that would give red or white an extra edge well into mid- or late-game stages, get wasted early on because the AI plays them as soon as it has some mana available = with not nearly enough land and other mana sources out yet to strike a decisive blow.

Mikaeus, the Lunarch is a rare exception because of its ability to tap and pump or transfer counters instead. The AI is still fairly compulsive with that creature, but overcomes that in part because it will switch to adding +1/+1 to its other creatures once it has two others out besides Mikaeus himself (instead of continuing to pump the latter till whenever). Another X-type creature it usually handles well is Mirror Entity, although sometimes the AI wastes its mana by turning all its own creatures (including the much more powerful ones) into 1/1 or 2/2 with the X-activated ability, instead of waiting for more lands first. Or by only using Mirror Entity's ability after combat damage has been resolved (in fact, a lot of the AI's creature effects seem to get activated randomly when it's being attacked, but not necessarily before damage resolution, or not necessarily in any way that changes the outcome of the combat phase).

At the other extreme, an X-cost creature the AI wastes easily by casting it as a 0/0 is Endless One - it misinterprets the X cost as meaning that's ok to cast with 0 mana, and will apparently cast it compulsively as soon as it shows up in its hand (regardless of available mana). Maybe for that card specifically a quick patch could be to ban the AI (but not any human player) from casting Endless One for less than 3 mana specifically while it's playing in "mad" mode.

The AI's overall inability to wait until it can play a Fireball-like spell with maximum mana & greatest effect, is one kind of weakness that probably won't be fixable in any simple way. It might perhaps get solved indirectly at a point where there would be so much added foresight coded into the AI, to allow it to plan three or more turns ahead - but that of course could make its server usage insanely heavy.
Posts: 5
Joined: 15 Dec 2016, 22:43
Has thanked: 0 time
Been thanked: 0 time

Return to XMage

Who is online

Users browsing this forum: Bing [Bot] and 11 guests

Who is online

In total there are 12 users online :: 1 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: Bing [Bot] and 11 guests

Login Form