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.
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.
Engineer? See exactly how it works, in the real code β
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.
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 + risk-aware 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
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.
The specialist reads the whole battle as a set of tokens, one per thing on the board:
The network has several output "heads" - separate predictions made from the same read of the battle:
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:
What the network senses
The combat network doesn't just guess win-or-lose. Alongside its value estimate it now predicts a slate of auxiliary "perception heads" - concrete fight-outcome signals. Forcing the network to predict them makes it actually perceive the dynamics behind a good or bad line, not just pattern-match the result.
Six heads, each a different lens on the same fight. Tap any one to see what it predicts, what it lets the network perceive, and the live misplay it fixes:
HP-aware value Winning at 60 HP beats scraping by at 5. +
End-HP distribution The full spread of how the fight ends - not one number. +
Incoming & block-sufficiency How hard the hit lands - and whether your block holds. +
Max-HP-on-kill The permanent reward hiding in a killing blow. +
Clutter - by type Not just junk cards - which junk. +
Near-term death Am I about to die - this turn or next? +
How it works: These are auxiliary heads on one shared network - trained together, they force the trunk to represent HP, damage, kills, and clutter, so better perception feeds better decisions. Each head's probabilities are calibrated inside the model file so they stay honest wherever the model runs.
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 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.