Reinforcement learning Β· Search Β· Distillation

Teaching a machine to play Slay the Spire like a top streamer.

Slay the Spire is a deckbuilding roguelike with enormous branching: hundreds of cards and relics, random draws, hidden enemy intents, and a 50+ floor run where one bad fight ends everything. Spire Pilot is a from-scratch AI that plays Ascension 20 Ironclad β€” the hardest difficulty β€” aiming to win as reliably as a skilled human. Below is the architecture at a glance, and the live runs page shows every decision it makes, as it makes them.

2
brains: combat & out-of-combat
1200+
MCTS sims per move
57
floors to a full clear (the Heart)
Where it actually stands β€” honest, not hype

This is a research system in active training, not a finished bot. It has one verified A20 win β€” a full 57-floor Heart kill in the real game client. The ~90% figure is the goal β€” roughly a skilled Twitch streamer β€” and every training cycle chips away at the gap. Current, real numbers live on the live runs page β€” watch it play, wins and deaths alike.

scroll to explore ↓
Coming soon β€” join the waitlist

Get your runs reviewed

Upload a run and the A20 bot reviews every decision: which card it would have drafted and why, how much HP each fight should have cost, and β€” for any fight β€” a step-through replay of the bot playing your exact spot. Join the waitlist and be first in when it opens.

Floor 12 Β· card reward example report
Uppercut bot's pick Β· +3.2% win
Anger your pick
Skip

One announcement email when it launches β€” nothing else. Uploads may be used (anonymized) to improve the AI.

How it works β€” architecture at a glance

Two brains, one run

A run splits cleanly into two decision problems, and the AI uses a dedicated model for each. They talk to each other: the map brain asks the combat brain "how much will this fight hurt?"

βš”οΈ

The Combat Brain

Inside a fight, every turn: which cards to play, in what order, on which target. It sees the literal battle state as a set of typed tokens and runs a Monte-Carlo tree search guided by a transformer that predicts the fight's outcome.

  • Input tokenized battle state
  • Model entity-token transformer
  • Decision MCTS + CVaR risk selection
πŸ—ΊοΈ

The Out-of-Combat Brain

Between fights: which path to take on the map, which cards to add or remove, what to buy, how to resolve events. It scores whole run states with a win-probability net that reasons over your owned set of cards and relics.

  • Input deck + relics + run context
  • Model owned-set attention net
  • Decision path planner over win-prob
Combat outcome head β†’ danger estimate β†’ Map path planner
How it works - inside a fight

One specialist network per encounter

There is no single all-purpose combat AI. Every boss, elite, and hallway fight has its own neural network - a Slime Boss specialist, a Gremlin Nob specialist, and so on - because each fight punishes different mistakes. When a fight starts, the matching specialist is loaded.

Fight starts: Slime Boss
loads
combat_state_enc10.pt Cultist
combat_state_enc18.pt Slime Boss
combat_state_enc37.pt Bronze Automaton

The specialist reads the whole battle as a set of tokens, one per thing on the board:

CARDSevery card in hand, draw pile, and discard, with its upgrade state and cost
ENEMIESeach enemy's HP, its telegraphed intent for the coming turn, and its status effects
PLAYERHP, block, energy, and active powers
RELICSevery relic owned, with its counters
POTIONSthe potion belt - usable mid-fight

The network has several output "heads" - separate predictions made from the same read of the battle:

Input
battle-state tokens
->
Transformerattends over every token
->
Output heads
Valuehow well the fight will end: survival and remaining HP
Death riskthe chance this position gets the run killed
Policywhich card plays, potion uses, or end-turn look promising
Auxiliaryincoming damage over the next turns; how much damage and block the current hand can generate

The auxiliary heads never pick a move. They exist to force the network to actually understand the fight: a net that has to predict next turn's incoming damage must model enemy intents, not just guess.

On top of the network runs a Monte Carlo tree search written in C++. Live, it simulates about 1200 possible futures per decision:

1
Try lines. The search plays out card sequences in a fast simulator: attack first or block first, which enemy to hit, when to drink the potion.
2
Score the endings. The specialist network scores each resulting state - how the fight ends from here, and with how much HP left.
3
Pick the safe-best line. A risk-averse rule (CVaR) judges each line by its worst outcomes, not its average, and refuses lines with meaningful death risk even when their average looks good.
How it works - between fights

Every choice priced in win probability

A separate run-level model estimates the probability of finishing the run - and beating the Heart - from any map state: the deck with upgrades, relics, potions, current HP, gold, and the actual map layout ahead.

Every out-of-combat decision is scored the same way: "how does win probability change if I take this?"

Card rewards and removals

A card joins the deck only if the run wins more often with it than without it. Skipping is a real option, and so is paying to remove a Strike.

Shops and campfires

Buy, or save the gold. Rest, or smith an upgrade. Each option is a different future run, and each future gets a win probability.

Pathing

The planner reads the actual map: which rooms a route visits, which fights it forces, and what those fights will cost.

The two brains talk through a fight-cost model
An encounter-outcome model, trained on the combat specialists' real results, predicts the expected HP loss and death risk of each upcoming fight on a path. That lets the planner route around an elite the current deck cannot afford, or rest before a boss instead of smithing.
How it works - training

The flywheel: how the models get better

The models improve in a loop: play, mine the failures, retrain, and only ship a new version when it is provably no worse anywhere and better somewhere.

1
Self-play against a stronger teacher. The models play thousands of fights in the simulator at a much higher search budget than live - slow, but strong.
2
Distill. Each specialist is trained to reproduce the teacher's judgment plus the actual fight outcomes.
3
Mine every death. When a real run dies, the worst decisions in it become permanent test cases. This "tactical suite" currently holds about 250 of them.
4
The ratchet. A candidate replaces the live model only if it fixes something new while still passing every case the current model passes. The bar only moves up.
5
Ship and archive. Winners deploy automatically, and every model version is archived off-site, so any change can be rolled back.
Where the work is right now
This system is under active development. The current focus: teaching the value models to correctly price desperate-but-winnable states - fights that are still winnable if the risky line is played well - and making better use of potions.