HOME

Machine Learning for Star Realms

Stats on your games against machine learning model opponents.

I love the deckbuilding game Star Realms. To learn more about strategy, I used machine learning techniques to train computer models that play better than I can. If you're not familiar with Star Realms, learn to play it first before reading this page, or else this info won't make much sense.

I trained the models using a 2-million-parameter neural net architecture inspired by the original AlphaGo paper and subsequent AlphaZero research. They are entirely trained on self-play, with zero human training or influence except for the ability to check for obvious game-winning moves within a single turn. The best model I trained, Level 5 (1283 ELO) is trained on 23 million self-play games and it beats me in around 64% of games (70% of the time when it goes first and 58% of the time when it goes second).

On this page you can try playing against some of the computer models I trained and see statistics about their strategy. The models above do not cheat, but they do constantly make use of all available information according to the digital game rules, including the cards in both discard piles, the cards in their deck (but not their order), and the (combined unordered) cards in your deck+hand. Hopefully you'll find it interesting or learn better strategies and ideas for your own games too! Note that the variance of Star Realms is very high, so a handful of games won't reveal your true playing strength. For example, hypothetically, if you're good enough to win exactly 60% of games against a specific ML model, then you'll need to play at least 92 games to be confident (95% confident) that you're actually better. Fortunately, it's possible to finish a game quickly in just a few minutes (though you'll want to think longer to play your best).

Loading your local game…
← Home

Your stats

Completed games saved in this browser. Draws and unfinished games do not count as wins or losses. Charts run from earliest to latest decided game; error bars show 95% Wilson confidence intervals.

Results by opponent level
OpponentWinsLossesDrawsWin rateCumulative win %

Strategy

I analyzed game data from my best-performing model (Level 5 in the opponent list above), to attempt to understand the strategies it had learned. Below are a series of interactive charts that answer questions like:

The charts show data from 10,000 self-play games, along with 95% confidence intervals for each datapoint. Negative action values mean that the model prefers taking no action (eg. not acquiring any card). Just because the charts imply a specific strategy, doesn't mean it's necessarily "correct", because my Level 5 model isn't perfect (for example, I don't think always scrapping explorers on turn 5 is correct). But if Level 5 is better than you, you might learn something helpful from the data below:

Some examples of the insights:

Loading strategy charts…

Settings

Home · resume later

Choose a card to scrap

Select a card to scrap. Each option is shown once per available target.

Home · resume laterDecision required

Choose an option

Choose an option to continue your turn.

Resign this game?

This ends the current game and gives the win to your opponent.

Local models

Downloads, imports, and names stay in this browser. Imported models are never uploaded.

Add an opponent

.actor.npz, converted .astro.gz, or .model.php export

Opponent names