Correlated randomness in Slay the Spire 2
19 points by icefox
19 points by icefox
I have so many questions?
(2) would - to a practical degree - immediately resolve any correlation concerns.
(3) would actually mean that none of this ever mattered: the concern about learning from prior RNG output would never have entered the picture (it sounds like the C# rng is a "small sample count needed to identify the seed" rng, which is not necessarily a bug for an insecure rng)
Why do they need different RNGs to prevent "randomness within a combat from influencing future card rewards"?
Because they want two players playing the same seed to get the same sequence of card rewards, even if they do slightly different things leading up to that point. Otherwise two playthroughs of the same seed would feel completely different.
Similar to how you would want e.g. the particle system to have its own random number generator. It would defeat the purpose of having a seed otherwise.
(1): There's a game mode in Slay the Spire where you can compete with other players to do as well as possible in a game starting with a particular seed. So you can repeatedly play the same run with the same seed, and get recognized if you do well. If randomness within a combat could influence future card rewards, this game mode would devolve to players figuring out what arbitrary stuff they need to do in combat (e.g. dragging the combat out for an extra round so that the combat draws a few more bits from the RNG) to get a good card reward after.
(2) and (3): the Slay the Spire devs are amazing game designers and awful at code architecture. You can infer this purely from playing the game: there are bugs in the UI that would simply be impossible if it were reasonably designed, and the speed of the animations effects the game play, there are race conditions all over the place in this card game. Given this generally poor architecture, I wouldn't expect that the decision of what kind of RNG to use was carefully thought out.
Why do they need different RNGs to prevent "randomness within a combat from influencing future card rewards"?
I'm not sure, but this should make "similar" runs possible with the same seed (and that's often used e.g. during speedruns in specific categories)
Yep - I'm not very knowledgeable about C# RNG, but I can speak to the game demands here a little here. The expectation that small changes in combat execution (e.g. the order in which cards are played on a turn) shouldn't be able to affect card rewards means that speedruns of a seed don't reduce to an RNG-manipulation game of identifying a sequence of actions that happens to produce stronger card rewards than any other.
Couple this with a fairly large number of "pools" of randomness (card rewards, random events, items available in shops...) and I think I can see how the devs ended up with a whole bunch of random seeds which correlate in weird ways.
The blog post is excellent and has a lot of useful detail, very grateful to the author for laying it all out to facilitate an easy fix!