The Workshop

AlphaDefect AI wins up to 80% of Slay the Spire 2’s hardest runs

Official Slay the Spire 2 screenshot from the game's Steam store page.
Slay the Spire 2 in an official Steam screenshot. The AlphaDefect agent plays the game headless, without this presentation layer. — © Mega Crit, via Steam (editorial-use). Source · Image rights

Four researchers have built an AI that wins between 62% and 80% of Slay the Spire 2 runs at Ascension 10, the game’s hardest regular difficulty. Their paper, “AlphaDefect: Expert-Level AI for Slay the Spire 2”, was posted to arXiv on 23 November. Qiyue Chen (Université Paris-Saclay), Taian Yu (University of New South Wales), Junpei Komiyama (Mohamed bin Zayed University of Artificial Intelligence) and Haobo Huang (The Chinese University of Hong Kong) wrote it. Mega Crit, the game’s developer, is not listed as a participant.

The system trains one network per character with proximal policy optimisation, a reinforcement learning method. The network makes every decision in a run, including card picks, map routes and rest-site choices as well as combat. Playing greedily, which means always taking its top-rated move, it wins 62–77% of runs on seeds it has not seen. A limited lookahead raises that to 68–80%. According to the paper, human runs uploaded at the same difficulty were won 11–20% of the time.

How the team got the game to run without graphics

AUTOMATON’s Japanese report on the paper explains the setup. The team loaded the game’s compiled code and replaced only its presentation layer, so runs play out headless at 5,000 to 10,000 decisions per second. The engine also hands the AI facts any player could work out, such as damage after modifiers or HP at the end of a turn. The paper’s ablations show how much this matters. Without the identities of cards, relics and enemies, the agent won no runs. Without the pre-computed consequences, it won 8.3 points less often.

Training the six characters, including The Fool added in version 0.113.0, took about 25 days and 14.2 billion decisions on the beta branches v0.111.0 and v0.113.1. Lookahead runs only when the network’s favourite move has less than 90% probability. It simulates the alternatives with hidden information such as draw order randomised. With lookahead, Defect reached 80.3%. A bilibili livestream of the agent recorded 645 wins in 866 runs.

The human comparison has limits. AUTOMATON notes that the 11–20% figure comes from the unofficial Spire Codex database, whose uploaders may not represent all players. Among players with 20 or more uploaded runs on the five original characters, only 0.9–5.1% won more than 80% of the time.

Stone Humidifier, more rests and no surrender

Komiyama, who says he has played the series for thousands of hours, described the agent’s habits in an interview with AUTOMATON on 27 November. Its favourite Act 1 Ancient relics include Stone Humidifier and Lava Rock. Humans tend to avoid such picks because they pay off late. Komiyama thinks the AI can afford them because its early-game play is strong. It also fights more elites and rests more often than people do. “The AI has no concept of giving up a run,” he said.

The paper lists weaknesses too. Between 47% and 68% of greedy losses happen at Act 3’s double boss fight. The agent also narrows its strategies. Komiyama said the Silent mostly plays poison and has largely dropped knife builds. He said a first agent stronger than humans took two to three days on one PC with an RTX 4090 and 96 CPU cores. Gains are now slowing, and a 0.1-point improvement takes days. He is looking for hardware or cloud sponsors to scale to 10–100 machines. In his view, an 85% agent is still well short of top players, who he says win 95–99% of runs.