256 points · by gcmeplz · 3d ago · 114 comments
But if I'm testing myself and trying to beat the Heart on A20 once again, I'm nearly guaranteed to skip it.
It rates "War Paint" really low too for example.
You can say "well then it should change the other aspects of its playstyle" but... have you got an A20H winstreak of 19?
Basically any difference between your perception of the game and this model's should be modelled as "I can learn something from this model", not "this model is doing something wrong".
Perhaps the model sees the cost is not worth the benefit?
Instead I think players just don’t like all of a sudden committing to a different play style. Also consider that it doesn’t really make sense to take past the first few floors so it’s usually just not an option.
Sort of unrelated, but I've made comments about how Slay the Spire 1 decks could take on the nightmare that is Dread Act 3 in STS2, and I've been lambasted for this.
I'm sure it's not that hard to do a deeper statistical analysis, but I've been saying, you just see a lot of really good cards in 1 and win. 2 is much more about value piling, which was sufficient until A10. Dread forces you to have good decks, but you often don't get offered the broken synergies as much.
I play exhaust ironclad in dread maybe once in 4 wins at this point, it just does not show up as much. Which can be seen as a good or bad thing - deck diversity etc.
Which is not to say one game is easier than the other (though I think Dread > A20H right now, not for good reasons). However, the peak and frequency of OPness of STS1 decks is not to be understated.
the model aims to learn to play “ideal Spire”, an abstract version of the game where random outcomes are drawn truly at random, instead of from a seeded RNG. This is the version that players generally agree is more interesting (optimally solving “real Spire” would involve reverse engineering the seed)
Is this different from how the real game works? I thought cards games had some thumbs on the scale: instead of truly random, you might get a random sort of N items, which gets shuffled after you have seen all entries. So, randomized, but you can only every encounter so much good/bad luck.Edit: reading a little further, there are indeed some weaknesses in the standard gameplay randomness, so this version is slightly different.
People normally don't know about it, and the ones that read about it use a mod to patch it out, because the point of the game is obviously not to learn the pseudo RNG by heart. But of course a neural network would start to exploit this very quickly because it can't tell the difference between what's a "real" game mechanic and what isn't.
HN Discussion of the above: https://news.ycombinator.com/item?id=48552844
As far as I know it was discovered after the full release. They may not have wanted to break old seeds.
And its pretty trivial to benefit from once you learn some of the rules. For example if your first combat is not a Cultist, your first mystery room is always an event.
1. the game UI displays the seed of the run. so, combined with full white box knowledge of the game's code, you should be able to reconstruct the current rng state of the game & deterministically predict what the various rng-based outcomes will be, without save loading. this goes completely against the intended experience of the game.
2. with full white box knowledge of the game's code, even if you didn't know what seed you were playing, perhaps it is possible - after enough observations during a run - to infer the game's rng state, say for draw order? no idea if this is actually plausible but I believe similar attacks to infer rng state have been done successfully in the past - e.g. against early online poker implementations that seeded their rngs in a weak & predictable way.
edit: there are also issues with correlated rng, where a weakness in how individual rngs are seeded & how the rng state depends upon the seed means that different rngs used for different game functions that the devs intended to be independent are actually heavily correlated with each other. here's a great writeup of the issue for sts2 (in early access) that was fixed by the devs a few months ago: https://tck.mn/blog/correlated-randomness-sts2/
This is unlike correlated randomness, which as you've noted is a real problem that many players have used mods to correct.
I also find it pleasantly surprising that this could be trained on a single GPU in a reasonable amount of time. I don't think the exact GPU is ever mentioned though. I'm guessing it's a typical gaming GPU like a 5080, rather than something like an H100?
It might also be that macro provides the bigger levers to improve win rate, so micro gets starved. A significantly more optimal deck can win with poor micro, but a significantly suboptimal deck loses even with advanced micro.
It seems like putting more emphasis on micro wouldn't be hard in this setup? You could isolate and replay encounters with this.
My bot could block and attack with basic cards, and regularly beat the act 1 boss, but never got better than that.
I realized I needed more games and more data, but wasn't interested enough to further mod the game for more speed.
My take away was that any game could be solved with PPO if only you can generate enough data to train on.
Did you learn a lot about packaging something like this for real world problems or is it always about fixing the specific issues on the game itself as the complexity even of the closed system is high.
Is that a possible future? What part of that future is already here?
The reason why this engine plays as well as it does is that it's full of battle-tested heuristics, learned over the course of its training run.
For an LLM to do this to an unseen game, it must be able to look at just the rules, and put together the appropriate heuristics.
Some of those, like "HP lost is bad, gold gained is good", are trivial for an LLM to put together - it has an edge over a randomly initialized engine. A highly capable LLM would have a far better starting point than a randomly initialized AlphaZero-style policy.
But discovering the "deeper truths" is far less trivial. It's often hard to tell whether one card or the other will be familiar at a given point without trying both and seeing them unfold. Which may involve something like training a "sub-engine" very much like this one?
Here's a few ideas though that I think have potential here for next experiments.
1. Try out something like recipe in variance reduced policy optimization which tries to model how lucky the random outcomes were, and subtract the luck from any advantage and credit-assignment signals. In theory over large enough training sets, the luck cancels out, but you can in cut down the training speed / data volume needed massively if you can get this working. https://arxiv.org/abs/2605.19235 is the original paper I used for reference, and also found a great implementation of it that seems pretty solid for reference with uno over here: https://github.com/TanishkBansode/uno-ataraxos/blob/main/doc...
2. A cool idea that seems to reproduce on games, and easy to do for a modal based game where you start with a perfect simulator, is to do a pretraining pass on the network, with a aux head that just predicts the game state as a function of the current state + action. Basically instead of starting from a random network at the start of self play, you start with one that knows how to predict the consequences of actions. You can generate the data for that brute force from random play to generate huge volumes of data cheaply, if you already have a simulator, and it takes the exact same inputs as the final network so works great as a way to get the game dynamics into the shared trunk before you start to train it towards skillful play. https://www.kaggle.com/competitions/pokemon-tcg-ai-battle/wr... Has a great write up from a model trained to play the pokemon tcg showing how it was cheaper overall to add this starting phase in that game, since it sped up the rest of the training more than it cost to add that extra phase. I suspect that might also align things better in general so the later generalization is stronger when it can reuse structure that maps to the real game dynamics.
3. I've also had a bit of luck with approaches like go-explore. https://arxiv.org/abs/1901.10995. You basically keep around a bank of slightly rarer off policy id game states, and start runs from those states, not always from a cold start fresh game. With a bit of work, you can seed these with states the network might be less confident about, to generate more data in those regions far far cheaper than just scaling up self play entirely to get more of these rare states at low probability. Picking the right criteria for what states to put into this bank seems tricky though and takes some experimentation to find which types of starting states are the most valuable at different parts of the training progress. Picking a few states closer to a win, even if you played it manually till near the end of the game, also gets you win feedback signals way earlier in training, and can also be a great way to bootstrap faster on a fresh network / recipe. Even mixing in a small number of these near wins, mixed with a lot of cold starts can massively speed up that initial slow start with this sort of method. For something like slay the spire, you could even collect states from trajectories winning with builds the network rarely finds the payoff for, to help teach the value network what the end game value of that build is, to help bootstrap things beyond the normal horizon your search budget can assemble. From there the normal training loop can generalize it and find the optimal version, but with a way way cheaper way to bootstrap the value function thinking the build is bad until many components all pay off.
But it plays way better than I do, so who am I to judge?
You can basically analyze this with hindsight. If it makes a "mistake", then you check whether it actually loses HP from that. If not, there's a decent chance its calculations were okay.
Here's a pretty good analysis from one of the top players (watch minute 15 to 17): https://www.youtube.com/watch?v=RRn_IUzJhhM
The run includes absolutely glaring micro mistakes, but it seems fairly solid overall.
The irony is that this makes quite clear that the "game" in StS is primarly the macro and the micro is a bit of an illusionary hamster wheel that could be elimiated without ruining the game. The game Guilderun proves this hypothesis to some degree.
Seeing this makes me think I could pretty drastically change my macro strategy.
It's very different from an RTS, where time can either be spent on micro or macro.
I watched for a bit and I saw the bot pass the turn twice with energy and an attack to play. I can't prove it, but there must be draw orders where the player takes unnecessary damage in the fight I watched.
I guess the bot isn't trained enough or the training methodology causes it to get stuck on something. I don't think this is a good example of a neural net learning a useful lesson, it's just a quirk.
The top picked neow bonuses include losing hp and max hp though. Im not sure why you are saying this.
I take your word on macro vs micro. That is very interesting and surprising. Im surprised it can make it very far like this.
edit: I watched a small amount of play and the micro did not seem poor or mediocre. Small sample size admittedly. But I wonder if it's poor micro play is being overstated.
This is funny because if you roll a Regal Pillow or Miniature Tent early on you can play a LOT more aggressively and skip block cards, as you recover more HP through the run.
I saw it play strike before bash on the first floor, losing 1 HP, and the author described it misplaying the heart fight. However, its micro in the rest of the run seemed really good, and I saw it do some clever stuff with fire breathing.
You could probably do equally well if you optimized for boringness.
You'd probably question your sanity then.
This is true in a competitive sense.
It is not true in a general sense.
Most people play games to optimize for fun...
For example, a top player can run into 5 elites (hard enemies) in a row on Ironclad, who is the character that heals after every fight. If I do that, I die horribly, so I don't. But that's because I make small mistakes in fights that lead to HP loss (micro) and pick cards suboptimally (deckbuilding). So I decide to not run into 5 elites (macro), which is actually good macro, but strictly worse than what a top player can do. So as you get better at micro and deckbuilding, you have to change your macro drastically. And the other way around too of course, all three influence the other two.
Also works in co-op, i.e. you can add it as a team-mate. There's also a mod available on steam workshop, but mods are currently in a review queue so you'll have to wait a few days to find it there unfortunately.