Ridiculous Tetris Piece Spinning

Modern-day Tetris contains some weird techniques. Some time back they regularized the ruleset of Tetris, using a confidential, yet mostly deduced, system called the Tetris Guideline. Although there are some games that go outside the guideline in some ways, modes that are called standard Tetris, or just plain “Tetris,” must stick to the guideline as a condition of their license agreement.

The Tetris Guideline, by now, has been part of the game for longer than it’s existed without it, but the most popular versions of the game, the Gameboy and NES ports, existed before the Guideline became a thing, so many people who mostly played that version may not be aware of how the game has changed since those days.

Some aspects of the Guideline are a bit controversial, like allowing infinite spin. Others have to do with regularizing how pieces move when rotated, which has some unexpected consequences.

These two short videos contain demonstrations of Tetris piece spinning. Now, I know for a fact that some of these spins are not part of the Tetris Guideline, especially those that involve spinning the “O” piece, the 2×2 square. Apparently a couple versions of Tetris support spinning this piece, even if it doesn’t make sense, and it has the potential to behave in odd ways. It’s interesting to speculate on the exact kind of drugs the spin algorithm is using when they allow pieces to warp into completely enclosed regions.

Here are the videos. Tetris Spins From Satisfying to Cursed (2 1/2 minutes):

And an “All Spins Tutorial” (6 minutes):

While some of the spins are not possible in standard Tetris modes, many of these are. Some games even reward you for pulling them off.

Let’s Learn About Pixel Scaling and Rotation

When you start using emulators, it won’t be long before you’re brought up against the choice of which scalers to use, a bewildering collection of options with names like Nearest Neighbor, AdvMAME3x, and RotSprite.

Resizing pixel images in an intelligent way is a difficult problem for many reasons. Most techniques intended for use on photographs won’t apply, since they’ll produce unacceptably blurry results when applied to extremely low resolution art. Pixel art is designed so that every dot matters, and adding new pixels carelessly can cause problems, such as Mario flipping us the bird in the right-hand image below:

Mario vs MMarrioo:A possible result of bad upscaling.

Additionally, being done frequently in real-time emulation, scaling algorithms must be fast. Yet the fastest solution, called Nearest Neighbor, produces very blocky results, and also only really works well if images are scaled up to an integer multiple of the original in X and Y dimensions.

A good backgrounder of various issues is available from an old blog post here, but there’s been some interesting advancements in the field since then. RotSprite is a good contemporary solution that also can rotate pixel art images well.

The problem of rotation is made simpler by a nifty trick that’s used by many image editors and libraries. It turns out you can rotate an image by an arbitrary amount with three simple shear operations. (If you don’t know what shearing is, it’s just tilting an image by some amount in a direction. It’s pretty awesome that this works since shearing is easy to do.)

Example image borrowed from the above linked page. I’m amazed this works.