Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Tetris AI strength alt view: Tetromino version

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
166 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 9, 2012

In http://youtu.be/-j9AG2I0f3Y I showcased a Tetris AI using a mixed tetromino+pentomino set. THIS video only contains tetrominos. All of the rest of the comments of that video also apply here:

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.

This is a special version in which I showcase tetrominoes only (requested by labobo). Go and watch http://youtu.be/-j9AG2I0f3Y instead.

Background music:
-- Harp song, composed by Bisqwit.

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.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (Bisqwit)

  • Wow, that AI sure knows how to play Tetris! I'll look at the code when I get a chance, but I have a question in the meantime:

    For me, the best game AI is not always the most efficient. Is the difficulty level of this AI scalable for actual gameplay? It seems that a human player would have a rather tough time prevailing against this. :-)

  • @jwcsh Yes. The "ply" affects the difficulty level. 1-ply only considers the optimal placement for the current piece, disregarding completely what might come after. 2-ply also considers the next piece, and so on. The algorithm can also be tweaked by adjusting the score coefficients; from what I understand, pretty much any tweaking to the coefficients (the "enum" penalties in AI_Run()) may worsen the AI performance, by making it disproportionally focus on particular traits in the block placement.

  • With the AI constantly looking to clear lines, that sort of made sense with the pentaminos. With tetraminos, they should be looking for 4 line scores.

  • @oEQjet The AI aims for long-term survival. A 1-ply version in non-deathmatch mode casually survives about 650000 lines by average. (This version is 3-ply; I have not profiled how long it survives by average because it's much slower.) Aiming for 4-line scores might max out the score faster, but it also reduces chances of survival, because the pieces are after all granted randomly. Line pieece~!

  • @Bisqwit In heads up mode against another AI, 4 line scores help eliminate the opponent! Then again I guess it's all down to your objectives. It sure does survive!

    What's the score for clearing 5 lines? That would be absurdly hard to do.

  • @oEQjet My pentomino set does not include the 5-block line piece that would be required for 5-line clear. Neither is there a score defined for 5-line clears. It should however be 1100 or 1200, times level plus bonuses. (Values for 1,2,3,4 line clears are 100, 300, 500 and 800 respectively.) You are right about eliminating the opponent. However, when playing against an equal opponent, it would make bad demo if both players died before 30 lines.

see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • @oEQjet It would be interesting to see an AI this efficient configured to favor four-line clears. But whenever I play, I always get what resemble canyon walls trying to score a tetris. Maybe frequent doubles and the occasional triple is actually smarter than waiting for that stupid straight-line piece that never comes when you need it?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more