DEV Community

Cover image for Part 0: "Who are you?" and "Why are you doing this?"
Doron
Doron

Posted on

Part 0: "Who are you?" and "Why are you doing this?"

A series about training an AI agent to play Slay the Spire. Technical content starts next week.

My name is Doron, I'm a software engineer working for Intel. For the past 12 years, I've been building software for AI accelerators of various kinds, such as the much-maligned Intel Gaudi.

To build software for AI infrastructure, one needs at least a rudimentary understanding of how AI models work. Wake me up in the middle of the night and I can recite the series of computations comprising a transformer model.
At Intel this is considered "AI expertise".
However, I've never defined a network architecture, nor have I trained a net unless you count the time I had to debug why Resnet-50 training was converging to 0.5% accuracy less than the state of the art.

The other big gap was using AI. My day job lends itself to very narrow use of AI, mostly to perform research and write first drafts of documents. I wanted to use coding agents for, you know, coding, but it's been about three years since I got to write any meaningful amount of code.

The last piece of the puzzle is Slay the Spire. Since I was 5 or so, I've had at least one strategy game to pass the time with. I've played Chess, Poker, Bridge, Magic: the Gathering, Hearthstone and some less-known games to varying degrees of competitive success. StS is a single-player game with an absurdly high skill ceiling. It was released in late 2017, and until the release of its successor (creatively named "Slay the Spire 2") top players kept finding ways to do better (as measured by overall win-rate, and the crowd-pleasing "win-streak" metric).

I picked up StS in late '20, during COVID-19, and have not really put it down since, accruing about 3000 hours of play over the past six years. When not playing the game, I've often watched top players stream their games on Twitch, trying to learn from them. Interestingly, top players disagreed on some key decisions, which made me wonder who's right and how could we tell, since it's nigh-impossible to do so just by playing1. As AI kept pushing boundaries in game-playing, from Go to Chess to Hold'Em and so on, I kept hoping a university or a frontier lab would tackle StS, but none have.

Looking on GitHub, I found ForgottenArbiter's spirecomm which included a POC simple AI with some heuristics, xaved88's bottled_ai that was a set of canned strategies claiming 20-52% winrate (depending on the character) at A20 (the highest level of difficulty) and two dedicated attempts to allow agents self-play: MANGO1234's AlphaStS, an AlphaZero-inspired implementation focusing on combat only and gamerpuppy's sts_lightspeed, a full reimplementation of the game engine in C++, unfortunately focused on the Ironclad character.

So, I decided to try and bridge the gap. Using Claude I will train an AI agent to play Slay the Spire well, thus teaching myself how to play well, as well as getting some hands-on data science experience and learn how to use coding agents. I've emailed Megacrit to ask for their blessing (since it was clear to do so would require modifications of their game and since an agent trained on their game could be considered their IP) and set out on my way in February '26. Six months later, I'm still not where I wanted to be. However, when Anthropic announced Fable 5, one of its headline results was that it "reached the game's final act three times more often" than Opus 4.8, so at least I'm in good company.

I've made many mistakes in this project, most are quite amusing. I plan to share them over a series of weekly posts. At some point posts will catch up to current progress, at which point I expect the publication rate will slow down to when I make actual breakthroughs.

1 - due to RNG elements in the game, as well as the small gap to begin with, the number of games players would have to play to make any claim with statistical significance is staggering. Moreover, it would be impossible to separate variables since players vary in other, subtler ways

Top comments (0)