By Paul Knight

The Tin of Tetris Mints

This is the first post in the ongoing series Tetris Randomizers.

Hello, how are you doing? Good, good. Please, have a seat, make yourself comfortable. Can I offer you some tea? This is going to take a while.

Today we’re going to talk about Tetris. Despite what you may have heard, Tetris is not only a videogame. It is also a philosophy, a genre, a craft, an aspiration, an aperitif, and even a religion. You can place it on the bookshelf right between the Tao Te Ching and Madoka Magica.

One day my very kind friend James gave me a tin of Tetris mints. The mints were shaped like Tetris pieces, and the tin itself was a lovely T piece. You can buy some for yourself on Amazon if you like.

Of course the first thing I did was dump out the mints to count them and figure out what randomizer they were using. Sorry, what did you just say? “What is a randomizer?” Oh. Oh.

I suppose we’ll start there.

Tetris seems simple enough on the surface. The playfield is 10×22 cells large. Game pieces of four cells called “tetrominos” fall from the top of the playfield. The player can rotate them 90 degrees at a time as they fall. Once a piece settles into place, another starts falling from the top. If an entire row of cells is filled by pieces, it is cleared and the player scores points. Rows that are above the deleted row shift down.

I’m sure most of us have played Tetris in one form or another. It’s not a complex game in the way that Dota 2 or EVE Online are complex. But this is not to say Tetris is simple. God is in the detail.

Consider this: let’s say you have a T piece that is slowly dropping. You rotate it so the longest side is to the right, and then you move the piece all the way to the right of the playfield.

Now you press the rotate button. What happens?

A T piece is shoved against the side of the playfield.

By “NES Tetris” I mean Nintendo’s version, not Tengen’s. The history of Tetris’s IP rights is fascinating in itself. David Sheff’s book Game Over: How Nintendo Conquered The World devotes an entire two chapters to the story.

The answer is it depends. It depends on the specific rules of the version of Tetris that you’re playing. In some versions, such as the NES Tetris, nothing would happen. In more recent versions of the game, the T piece will shift over one cell to the left so it can rotate. This is called a “wall kick” and most modern games implement it—in fact, it’s required in the standard mode of any officially licensed Tetris title these days.

There are so many little details and subtleties about Tetris like this. If you hold down the left button, how quickly does the piece move over? Do you have a window of time to slide a piece once it touches another? When exactly does the game end (when any piece extends past the top of the playfield, or only when a new piece can’t spawn)? All of these things seem minor, but they contribute to the feel of any individual Tetris game. Some feel more like action games, emphasizing fast reflexes and quick decisions. Others feel more like puzzles, rewarding thoughtful decisions and careful planning.

One of the most important details—and yet one of the least visible—is the algorithm that any particular version of Tetris uses to randomly select the next piece. At first glance this shouldn’t be that complicated. After all, there are only seven tetrominos, which players call I, O, T, J, L, S, and Z. Shouldn’t it be enough to just roll a seven sided die and use that to choose the next piece?

The seven pieces of Tetris.

But think back to the games of Tetris that you’ve played. What is the most annoying thing you think about during a game? I mean, sure, there’s the nagging, ever present worry that Final Fantasy has only had one good game in the last fifteen years, but besides that. The most annoying thing that happens is when you’ve set up that perfect empty column and all you need is an I piece to score those sweet, sweet Tetris points, but the I piece doesn’t seem to be coming anytime soon.

If you're a good enough player to recognize that this screenshot is kind of fake in that I totally had an I piece that I dropped in the center, you'll probably excuse me for manufacturing a situation that looks dire but isn't. Incidentally, the mode I was playing uses a 7 piece bag randomizer, so the I piece isn't far away.

Tetris players call this a “drought,” and it can ruin games. And even beyond the obvious problem of never getting an I piece when you need it, a long sequence of S and Z pieces is not very fun at all. Tetris designers are well aware of this and write their games to reduce the chances of this happening. They use all kinds of weird schemes that try to avoid the worst possible cases of a truly random number generator while keeping the game challenging and interesting.

To my knowledge, no officially licensed Tetris game rolls a seven sided die to choose the next piece.

Over the next few days we’re going to explore some of the different piece randomizers that Tetris games use. It’s a weird world of good intentions, bad math, and it stands as one of the most salient examples of how the tiniest details can have tremendous effects on a game.