09  ·  AutomatedSpike  ·  active
projectsabout

Sydney

09 · AutomatedSpike

Magic decks I wouldn't think to build

I've always liked seeing a new Magic brew where the cards fit together in some unexpected way. I wonder what reinforcement learning would come up with: more one-ofs, perhaps, or cards that look wrong until you play enough games with them.

That's the idea behind AutomatedSpike. The difficulty is that to find out whether a deck is good, something has to play it reasonably well. So there's a deck-building problem and a piloting problem tangled together.

The early experiments below used a tiny pool of Plains and nine vanilla creatures. Later work moved onto XMage and real starter decks. That's still a long way from evaluating arbitrary Modern brews.

pythonxmageargentumbehaviour cloningreinforcement learning
The pieces

Something to build decks, something to play them

The project separates the rules, the player, the deck search and the evaluation.

The brewer proposes a deck change, the pilot plays it, and the evaluator compares the results. The environment handles the game rules and records the replay. Keeping those jobs separate helps when a result looks odd: was it the deck, the player or the engine?

The pilot only gets information a player is allowed to see. The evaluation settings are fixed before a run, so a promising-looking result doesn't change its own test.

I looked at both XMage and Argentum. XMage covered more of the cards in a sample of real Modern decks, so that became the route beyond the little Python engine. Argentum remains a useful smaller comparison.

The first version

Starting with a very small card pool

The Python starter engine only accepts its small whitelist, but within it there are real choices about mana, mulligans, attacks, blocks and damage assignment. It gave the pilot something bounded to learn before dealing with a full card database.

Each game saves its actions and observations so I can replay it and check what happened. The early 800-game confirmation run reproduced both the engine transcripts and the policy reruns.

The pilots

Learning from a scripted player

The first teacher is a hand-written player. It estimates damage, keeps blockers back when necessary and chooses spells it can afford. It gives the learning system a starting point.

The early student only learned combat. It copied the teacher first, then had a few reinforcement-learning updates. Playing lands and sequencing spells still belonged to the teacher, so these results only describe part of a player.

FIG. 1 · the teacher against two weak baselines
800-game check, frozen heuristic teacher
(Hoeffding lower bounds, simultaneous)

                 opponent   wins / n    lower
  24 Plains      random     200 / 200   0.880
  24 Plains      naive      190 / 200   0.830
  26 Plains      random     200 / 200   0.880
  26 Plains      naive      184 / 200   0.800

gate: lower bound > 0.55 in every stratum  -> passed
From docs/experiments/starter-prototype.md. Win = 1, draw = 0.5, loss = 0. No draws, errors or truncations occurred.
Comparing runs

Trying not to fool myself with a good run

evaluation/statistics.py, evaluation/promotion.py.

Seeds, decks, opponents and game counts are fixed before confirmation runs. The reported bounds are deliberately conservative, because trying lots of variants makes a lucky result quite easy to find.

Attempts are recorded before games start, including failures and interruptions. A technical failure voids the run. There are also checks that the rules and hidden-information boundary behaved as intended.

The early results

Copying the teacher was easier than improving on it

These are the restricted-pool experiments. They were useful for finding what to work on next.

FIG. 2 · the first learning run against the teacher
learned combat student, 304 games, 16 per cell

                       random  naive  teacher
  untrained scorer      15/16   5/16    0/16
  behaviour cloning     16/16  12/16    3/16
  + 4 RL batches        16/16  13/16    4/16
304 games, no technical outcomes. Wins out of 16 per cell, pooled over two deck mirrors. Source: starter-prototype.md.
  • The first RL version won 4 of 16 against the teacher; cloning alone won 3 of 16. That sample couldn't distinguish them reliably. A later guarded model did better in another comparison, but there still wasn't enough evidence for the strength claim I wanted to make.
  • The first deck search didn't establish an improvement either. Replacing a Pillarfield Ox with a Plains looked better in the sample, but the uncertainty was far too wide to know whether it helped.
  • Some new attack and block positions exposed mistakes in both seats, so the planned confirmation run had to wait. Fixing those positions eventually got the guarded player through the starter checks, without showing it was better than the teacher.
  • A combat-search rewrite fixed individual positions but didn't change the scores in a small XMage comparison. Another reminder that a sensible code change isn't automatically a stronger player.
Real decks

Collecting things to try

Goldfish snapshot

An early collection pass normalised 135 Modern archetype pages into 143 distinct deck lists. The much larger set of linked deck pages was still mostly queued.

Provenance

The collection keeps the source captures and resolves card names against recorded evidence, so an odd list can be traced back to where it came from.

Gaps

Some sources were blocked or needed credentials. The collection is incomplete.

More recently

Moving onto XMage

The later notes are in the 8 October 2026 Arena v1 report.

Arena v1 plays real starter decks in XMage: Burn, Green Stompy, White Weenie and Black removal. It combines a public-information heuristic player with determinized search. That opens up more interesting deck experiments than the vanilla-creature pool.

The report records a Burn-list improvement of 0.121 in win rate on 3,200 fresh confirmation games. That's a result in that particular experiment, rather than evidence that it can brew or pilot arbitrary Modern decks.

Open question

What I'd like to see is a deck with an idea I wouldn't have come up with myself, played well enough that I can take the result seriously. That's still the interesting question for me.

MaterialsPython, XMage, Argentum, SQLite
VintageOctober 2026
StatusActive research, restricted pool
Sourceprivate
Press / for the other projects09 / 12
Index12 / 12

  • 01Tauri ExplorerMy file explorer · Rust and Svelte · notes on building it
  • 02ScrivoMy Markdown reader and editor · Typora-style live preview
  • 03BallastMy mood diary · Markdown files · desktop and Android
  • 04Quickshell barMy Hyprland bar · agent state and quota pacing
  • 05Tableau FrogData exploration · linked charts · AI experiments
  • 06LambdaQueryPython-to-SQL compiler · started in 2017, revisited in 2026
  • 07Ashen CathedralA first-person Diablo experiment · Unreal Engine 5 · paused
  • 08Brood War AIBrood War agent · imitation learning · work in progress
  • 09AutomatedSpikeMagic deck search · learned pilots · XMage experiments
  • 10Zheng Shang YouOur family card game · learning agents · playable version
  • 11EskivA game from high school · recreated during Covid · search-based bot
  • 12Intuition on the Central Limit TheoremCentral limit theorem · interactive mathematical exposition
↑↓ move↵ openesc closeTap a project to open it