In April 2011, I published the source code to a piece puzzle game here at YouTube. You can see it here: http://youtu.be/V65mtR08fH0
In addition to being playable, the game also had a built-in AI using a state-of-art real-time algorithm by Pierre Dellacherie, extended by me for multi-piece look-ahead. But the video showcased the AI for really quite a short time.
I meant to publish a second video in which I show how good exactly the AI is.
Then came the summer, and came the Feast of Tabernacles, and came Hanukkah, and the video got a little delayed. But here it is. In this video, I pit two instances of that AI against each others, and see how long they last.
See for yourself. Keep in mind that the game features pentominos -- five-block pieces which are really difficult to work with. With tetrominos only (4-block pieces), the AI would keep playing almost indefinitely, never getting a game over, at least not within the 15 minutes limit of this video, even with the penalty rows (no 20G mode).
Background music:
-- Betrayal at Krondor bgm 31, played through ADLMIDI
Source code and resources: http://bisqwit.iki.fi/jutut/kuvat/programming_examples/tetre/
The whole video series:
-- http://youtu.be/JDnypVoQcPw -- Creating a rudimentary TETRIS clone in GW-BASIC
-- http://youtu.be/V65mtR08fH0 -- Improving the game by rewriting from scratch C++, added AI
-- http://youtu.be/-j9AG2I0f3Y -- Illustrating the AI's power with tetrominos and pentominos
-- http://youtu.be/ukXDCBewnsg -- Illustrating the AI's power with only tetrominos
-- http://youtu.be/zQZLK8r1NFs -- Illustrating the AI's power with tetrominos, pentominos and hexominos
-- http://youtu.be/7kHnnkVlBKI -- Testing the AI at tackling octominos. Not good.
-- http://youtu.be/Yw02EkQE3Cw -- Illustrating the AI's power with tetrominos on a half-width field.
Interestingly, I've had the AI crap out on me before 15 minutes. Granted, this wasn't the look-ahead version AND it was built into a Windows screen saver, but still.
JosephCollins 1 month ago
@JosephCollins Which AI? You know there are an infinite possible ways to implement an AI that plays Tetris. Some algorithms fare better than others.
Bisqwit 1 month ago
It's hard to relate with those weird five-block pieces, because I've never actually played a game like that before. Could you show us an example of the AI playing traditional Tetris?
jwcsh 1 month ago
@jwcsh There we go: video ukXDCBewnsg
Bisqwit 1 month ago