About Statistical Drafting

AI-powered draft assistance for Magic: The Gathering

About

Statistical drafting is a draft assistant for Magic: the Gathering. It provides pick orders based on your current deck, trained on top player data from 17lands.

Usage

The rating column indicates the strength of a card on a 0-100 scale, with the synergy column showing an adjustment for your current deck.

Cards can be stored in a temporary pack with the compare button. Picking a card adds it to your deck.

The find card button can be used to search for cards by name.

There are various filters at the top of the page, similar to card data page on 17lands.

Importing from Clipboard

Decks can be pasted from the clipboard in several formats.

The format for MTGArena Deck->Export is supported. It looks like this:

1 Hivespine Wolverine (BLB) 177
1 Galewind Moose (BLB) 173

For real-time desktop usage, picks can be copy & pasted from the 17Lands -> Event History -> Picks page. Cards on that page have the following format:

Thopter Fabricator
Transit Mage

For issues or feature requests around importing from clipboard, please email me!

Project Goals

The goal of this project is to provide the drafting community with high quality pick orders.

This is enabled by the draft datasets provided by 17lands, which contain draft pick decisions and anonymized player information.

This data is filtered down to high volume and win rate players in order to describe the top player metagame.

New models can be released no earlier than 2 weeks after a set is released on MTG Arena, due to the current data release schedule on 17lands.

Interpreting Rating

A card's rating can be thought of as "how good would an expert player value this card in my current archetype"?

In pack 1, picking the highest rated card is generally a good strategy.

In packs 2 and 3, sometimes it's correct to take a lower rated card for curve or deck composition considerations.

Despite extensive experiments, learning deck composition from drafting data alone is challenging.

A promising future direction could be to train a separate deck-building model and use it to apply a deck adjustment to later picks (in addition to synergy).

Model Training & Deployment

The model pick order model is a small neural network (MLP) trained in PyTorch.

This neural net takes a collection vector and a pack vector as input and outputs a card rating vector.

During training, the pack vector is used as a mask to zero out the ratings for cards not in the pack.

During inference, a ones vector is used as the pack vector to show the ratings for all cards in the set.

BatchNorm and dropout layers were added to ensure smooth optimizer convergence, as well as an exponentially decaying learning rate.

The typical premier draft model takes ~20 minutes to train for 100-150 epochs on CPU.

For a typical set, ~70% of model-predicted picks agree with the top-player picks.

For deployment, the models weights are exported to ONNX and run client side in the browser.

Full details are available on Github in the model training and front end repos.

References

  1. AI Solutions for Drafting in Magic: the Gathering - model benchmark on Draftsim pick dataset
  2. Predicting Human Card Selection in Magic: the Gathering with Contextual Preference Ranking - neural nets with triplet loss on Draftsim dataset
  3. Ryan Saxe draft AI - used models trained on 17lands data to reach high Mythic

Contact

Contact: daniel.brooks@alumni.caltech.edu