Magic auto-drafter

This is kind of cool.

I’ve had an idea for a while to make an automatic draft picker for Magic: the Gathering. The idea was to use a sort of naive Bayes approach, using the records of previous drafts to estimate:

  • the probability that a player, given a pack with cards A and B, will pick A over B;
  • the probability that a player, given a pack with card A and having already drafted card B, will pick A over the other cards in the pack.

The idea is that the former gives an estimate of card quality, and the latter estimates the influence of earlier picks on each card. To use this in a draft, you (that is to say, the program that’s doing it for you) just multiply all the probabilities together for each card, and pick the one with the highest score.

So I finished coding it up this morning. Then I trained it using four Magic 2010 drafts from the MtG website (e.g. this one), then re-ran our draft from a couple of weeks ago, to see what would have happened if we were all replaced by auto-drafters.

The results are below the fold. And it’s not completely ridiculous. It’s probably less focused in colours than it could be; maybe there’s some tweaking to be done by weighting the influence of previous picks. But at a glance, I can’t see anyone’s card pool that couldn’t be made into, say, a two-colour deck with a third splash. (Edit: Now that I think about it, this is probably true of any 45 random cards. Hmm. Well, most of the pools have a strong leaning towards two or at most three colours, and Andrew C could almost get away with mono-green.)

Bizarrely, it’s drafted a red-blue deck for me instead of the white-green deck I actually played (although I did feel bad about not using that first-pick Lightning Bolt in the second pack).

There are a few hiccups because the training set of four drafts wasn’t big enough – there’s no way Ajani should have gone fifth pick, for example. I’m optimistic that throwing more data at it would make it better. In an ideal world, I’d somehow get hold of the results of every Magic Online draft to pump through it, and it would represent the collective wisdom of every online player everywhere.

In fact, if anyone from Wizards would like to do this, let me know. :)

Actually, that’s not as silly as it sounds. (Well, letting me do it probably is.) There’s already an AI of some kind controlling the online draft simulator. That could be something similar to my system, or it could just be a hand-crafted pick order along with some kind of futzing to get it to pick roughly consistent colours. It’d be interesting to find out how it works. (But they’ll never tell us.)

Interestingly, some kind of auto-picker could be useful for Magic Online. If you don’t pick a card within the time limit in an online draft, it randomly picks one for you. (At least, it was random last time I checked. I haven’t drafted online for a while.) MO has recurring problems with lag and dropped connections, so it would make a lot of people very happy to have an auto-drafter that makes vaguely intelligent choices when they can’t do it themselves.

Now, it can’t be too good, or you could start relying on it to do the draft for you. This could be a showstopper, since the outcome of a draft is supposed to depend on the players’ skill. (In fact, there’s a good chance that someone in Wizards has already had this conversation.) But maybe an auto-drafter that’s not a genius, but knows not to take the basic land and will generally pick playable cards in your colours, would be just enough of a safety net that people wouldn’t be driven to mass killings when their connection drops. Maybe.

I might put the code up later (after I do a cleanup and/or rewrite – it’s pretty ugly right now). Meanwhile, keep reading for the results of the re-draft.

Edit 2: I tried doubling, then quadrupling the effect of the already-drafted cards on the next pick. This puts nearly everyone solidly into two colours. (Unfortunately it leaves Mr Shellshear with an impressive blue-white deck, and anyone who remembers our first Lorwyn draft will realise what a bad idea that is. Apparently some people do just open all the good cards.) I’d post the new results, but I’m wary of picking at this too much, and would rather just leave the original results as they are until I get around to cleaning up the code.

Andrew S

Blinding Mage
Veteran Swordsmith
Rhox Pikemaster
Siege Mastodon
Craw Wurm
Flashfreeze
Emerald Oryx
Lurking Predators
Prized Unicorn
Relentless Rats
Megrim
Duress
Goblin Piker
Island
Forest
Lightning Bolt
Pacifism
Centaur Courser
Ice Cage
Essence Scatter
Celestial Purge
Open the Vaults
Assassinate
Glorious Charge
Sign in Blood
Kelinore Bat
Raging Goblin
Lifelink
Shatter
Swamp
Protean Hydra
Guardian Seraph
Merfolk Looter
Razorfoot Griffin
Giant Spider
Giant Spider
Oakenform
Drudge Skeletons
Lava Axe
Wurm’s Tooth
Wall of Fire
Wall of Faith
Bountiful Harvest
Tome Scour
Swamp

12 white
10 green
7 black
6 red
5 blue
4 land
1 artifact

David K

Razorfoot Griffin
Drowned Catacomb
Craw Wurm
Birds of Paradise
Diabolic Tutor
Essence Scatter
Wind Drake
Horned Turtle
Runeclaw Bear
Siege Mastodon
Telepathy
Shatter
Angel’s Mercy
Coral Merfolk
Convincing Mirage
Nightmare
Cudgel Troll
Prodigal Pyromancer
Acidic Slime
Illusionary Servant
Veteran Armorsmith
Ice Cage
Elvish Visionary
Elvish Visionary
Lava Axe
Kindled Fury
Mist Leopard
Wall of Faith
Wall of Faith
Swamp
Overrun
Borderland Ranger
Whispersilk Cloak
Righteousness
Prodigal Pyromancer
Excommunicate
Stampeding Rhino
Canyon Minotaur
Coral Merfolk
Fog
Zephyr Sprite
Burning Inquiry
Unholy Strength
Shatter
Plains

12 green
10 blue
8 white
8 red
3 black
3 land
1 artifact

David MM

Gravedigger
Earthquake
Looming Shade
Howl of the Night Pack
Negate
Howling Mine
Merfolk Looter
Bountiful Harvest
Negate
Mind Rot
Duress
Trumpet Blast
Trumpet Blast
Forest
Mountain
Shivan Dragon
Dragon Whelp
Tendrils of Corruption
Warpath Ghoul
Razorfoot Griffin
Weakness
Weakness
Ignite Disorder
Mind Rot
Bramble Creeper
Burning Inquiry
Kraken’s Eye
Duress
Unholy Strength
Mountain
Sleep
Air Elemental
Gravedigger
Borderland Ranger
Weakness
Essence Scatter
Lightning Elemental
Levitation
Weakness
Solemn Offering
Holy Strength
Jump
Convincing Mirage
Spellbook
Swamp

14 black
9 blue
8 red
4 green
4 land
3 white
3 artifact

David Mc

Dragon Whelp
Mind Control
Dread Warlock
Divine Verdict
Phantom Warrior
Griffin Sentinel
Darksteel Colossus
Negate
Disentomb
Fiery Hellhound
Solemn Offering
Unsummon
Yawning Fissure
Yawning Fissure
Plains
Lightning Bolt
Snapping Drake
White Knight
White Knight
Essence Scatter
Canyon Minotaur
Negate
Dragon’s Claw
Jump
Goblin Piker
Sage Owl
Bramble Creeper
Fog
Jackal Familiar
Island
Indestructibility
Terramorphic Expanse
Polymorph
Coat of Arms
Pyroclasm
Sparkmage Apprentice
Divine Verdict
Palace Guard
Fiery Hellhound
Fiery Hellhound
Bramble Creeper
Relentless Rats
Viashino Spearhunter
Serpent of the Endless Sea
Mountain

13 red
11 blue
8 white
4 land
3 black
3 green
3 artifact

Andrew C

Pacifism
Stormfront Pegasus
Borderland Ranger
Safe Passage
Palace Guard
Black Knight
Enormous Baloth
Deathmark
Oakenform
Mist Leopard
Wurm’s Tooth
Jump
Regenerate
Burst of Speed
Island
Chandra Nalaar
Howl of the Night Pack
Cudgel Troll
Celestial Purge
Deadly Recluse
Deadly Recluse
Windstorm
Fiery Hellhound
Diabolic Tutor
Nature’s Spiral
Mold Adder
Mold Adder
Bramble Creeper
Trumpet Blast
Forest
Great Sable Stag
Pacifism
Rod of Ruin
Centaur Courser
Emerald Oryx
Giant Spider
Entangling Vines
Excommunicate
Excommunicate
Ponder
Silvercoat Lion
Ornithopter
Naturalize
Tome Scour
Island

20 green
9 white
4 red
3 blue
3 black
3 artifact
3 land

Steven

Giant Growth
Bog Wraith
Lightwielder Paladin
Vampire Aristocrat
Looming Shade
Rampant Growth
Dread Warlock
Armored Ascension
Act of Treason
Fabricate
Regenerate
Holy Strength
Fog
Yawning Fissure
Swamp
Hypnotic Specter
Mind Shatter
Terramorphic Expanse
Child of Night
Dread Warlock
Wall of Frost
Siege Mastodon
Excommunicate
Drudge Skeletons
Mind Rot
Canyon Minotaur
Holy Strength
Holy Strength
Raging Goblin
Plains
Lightning Bolt
Doom Blade
Rhox Pikemaster
Consume Spirit
Veteran Armorsmith
Ice Cage
Howling Banshee
Soul Warden
Looming Shade
Lava Axe
Angel’s Feather
Ponder
Lifelink
Firebreathing
Swamp

14 black
11 white
7 red
4 blue
4 green
4 land
1 artifact

Darren

Berserkers of Blood Ridge
Soul Warden
Deadly Recluse
Snapping Drake
Ajani Goldmane
Safe Passage
Wind Drake
Acolyte of Xathrid
Bramble Creeper
Panic Attack
Fabricate
Raging Goblin
Disorient
Bramble Creeper
Plains
Ball Lightning
Serra Angel
Elite Vanguard
Ponder
Safe Passage
Llanowar Elves
Entangling Vines
Oakenform
Siege Mastodon
Silvercoat Lion
Zephyr Sprite
Regenerate
Naturalize
Serpent of the Endless Sea
Plains
Gravedigger
Stone Giant
Clone
Veteran Armorsmith
Righteousness
Sparkmage Apprentice
Entangling Vines
Rise from the Grave
Alluring Siren
Panic Attack
Ponder
Sage Owl
Disorient
Jackal Familiar
Forest

12 blue
10 white
9 green
8 red
3 black
3 land
0 artifact

Michelle

Divination
Goblin Artillery
Sparkmage Apprentice
Essence Scatter
Phantom Warrior
Gargoyle Castle
Illusionary Servant
Zombie Goliath
Zephyr Sprite
Zombie Goliath
Act of Treason
Acolyte of Xathrid
Demon’s Horn
Angel’s Mercy
Mountain
Whispersilk Cloak
Gorgon Flail
Veteran Swordsmith
Twincast
Rampant Growth
Inferno Elemental
Snapping Drake
Negate
Seismic Strike
Canyon Minotaur
Megrim
Serpent of the Endless Sea
Burning Inquiry
Angel’s Mercy
Mountain
Fireball
Stone Giant
Manabarbs
Harm’s Way
Tendrils of Corruption
Safe Passage
Llanowar Elves
Glorious Charge
Drudge Skeletons
Acolyte of Xathrid
Silvercoat Lion
Runeclaw Bear
Disentomb
Trumpet Blast
Island

11 red
9 blue
8 black
7 white
4 land
3 green
3 artifact

No comments

No comments yet. Be the first.

Leave a reply