3 ms·
I wondered if this was using a machine-learning style AI and it was, among other things, learning the state of the random number generator so it could predict p
by elihu 5y ago
I wondered if this was using a machine-learning style AI and it was, among other things, learning the state of the random number generator so it could predict pieces accurately more than one turn out? (And if not, how would you prove that it wasn't? Perhaps tweak the game RNG and see if the AI performs badly?)
Looking at the github repo, it looks like it's actually more of a classical AI doing traditional game tree search. There is some interesting code around the RNG, though: apparently the RNG does make certain piece sequences more likely than others, and there's a lookup table for the probability of the next piece given the current piece:
https://github.com/GregoryCannon/StackRabbit/blob/master/src/server/piece_rng.ts https://github.com/GregoryCannon/StackRabbit/blob/master/src...
I suppose one could extend this to be a 3-dimensional lookup table with the probabilities of the next pieces given the last two pieces, or to extend it to 4 or 5 or (if you had infinite resources) 100. At some point you'd know enough to be able to predict the next piece with 100% accuracy.
- mdavidn 5y agoThe NES version is quirky, as your link points out. It's best described as an 8-sided die, with rolls for 8 or the previous piece triggering a single reroll. The probability of the next piece being an "I" do not increase after a long drought. Newer versions of Tetris give random permutations drawn from a 7-tetrominoe bag, so the longest possible drought between two "I" pieces is 12 tetrominoes.
- karmasimida 5y agoIf it is a pseudo RNG then you can try a autogressive seq2seq model and see how it is doing. If it is a true RNG, then good luck, it would be unpredictable by definition.
- ineedasername 5y agoAnyone know what would be a good source of entropy on a NES system for a good RNG?
- jenscow 5y agoI'm guessing, the only thing available that was unpredictable is the user.. so things like the input timings.