Tetris Difficulty
I had a discussion with a friend about Tetris where we quibbled about how it got more difficult as the levels progressed. His assertion was that it had only to do with the amount of time given to work with a block whereas I thought that I remembered it not just being a time thing but also that easier blocks (squares, long rectangles) came less frequently.
Does anyone know how this was implemented and how difficulty increased as levels progressed?
Solution 1:
As far as I know (and I've done quite a bit of reading about Tetris lately), no official version of Tetris changes its piece-selection method as the game goes on.
Assuming you're asking about the NES version, the only difference as the levels progress is the speed that the blocks fall at.
Here is the falling speed for the levels, in the number of frames it takes for each piece to drop one cell towards the bottom. The game runs at 60 frames/second, so a value of 60 would mean it moves down one cell per second, a 6 is 10 cells/second, etc.
Level Drop speed
(frames/line)
00 48 (0.8 s)
01 43 (0.72s)
02 38 (0.63s)
03 33 (0.55s)
04 28 (0.47s)
05 23 (0.38s)
06 18 (0.3 s)
07 13 (0.22s)
08 8 (0.13s)
09 6 (0.1 s)
10-12 5 (0.08s)
13-15 4 (0.07s)
16-18 3 (0.05s)
19-28 2 (0.03s)
29+ 1 (0.02s)
(source)
For completeness, the randomizer always works as follows:
- Pick a (pseudo)random number from 0-7, representing the 7 possible pieces and one "dummy number" (7). If it comes up as 7 or the same number as the previous piece, go to step 2. Otherwise, give the piece represented by the chosen number.
- Pick a (pseudo)random number from 0-6, and give the piece represented by the number.
So there's a lower-than-normal chance of getting the same block twice in a row, but that's about it.
Solution 2:
Most used psuedorandom numbers, I would guess. Its entirely possible to make it even harder by giving less-optimal blocks, and maybe some versions do.
For an extreme example of this check out Hateris:
http://qntm.org/files/hatetris/hatetris.html
Use this replay code to see a PRO battle the evil algorithm:
56AA AAAA AAA6 AAAA AAAA 8AAA AAAA AB55 AAAA AAAB 00AA AAAA AA9A AAAA AAA6 0AAA AAAA A96A AAA8 AAA9 A808 AAAA AA9A AAAA AAAB 55AA AAAA A82A AAAA AA97 5AAA AA9A AAAA A6AB 5AA6 AAAA 6AAA AAAA C02A AAAA AABF BEAA AAA9 E9AA AAA9 AAAA AAFE AAAA AD5A AAAA F0AA AAA9 BF00 AAAA AA9B AD56 AAAA FC02 AAAA AABA C02A AAAA AB5A AAAA BAAA AAB6 AAAA AB55 6AAA A02A AAAA A82A AAAA ACAA AAAC 02AA AAAA FE9A AAAF EAAA 9D5A AAA9 6AAA AD57 AAAB C2AA A9BF 00AA AAA6 BBF0 0AAA AABA D56A AAC0 2AAA AAD6 AAAB AAAA DAAA A80A AAAA 82AA AAB5 5AAA B2AA A0C0 AAAA AFDA AABF AA9D 5AAA 5AAA 57DA A6AB C2AA 6FC0 2AAA 6BBF 00AA AAEB 00AA AA03 5556 AA02 AAA8 282A AB0A AAB2 AAB6 AA9D AAB5 02AB 55AA 80C2 AAB0 22AB AAD6 AB55 AA00 AA40 AA79 A
Solution 3:
According to Wikipedia, "Most implementations use a pseudorandom number generator to generate the sequence of tetrominoes". In my personal experience, the difficulty affects only the speed in which the pieces fall, even though it seems like that I piece that you want so much is never going to come.