2. Introduction
Tetris is a classic tile-matching puzzle game.
Originally developed by Alexey Pajitnov, an artificial
intelligence researcher.
Culturally significant.
3. Tetris is NP-Complete
- Tetris is NP-complete to:
- Maximize the number of cleared rows
- Maximize the number of tetrises
- Minimize the maximum height of an occupied
square
- Maximize the number of pieces placed before the
game ends.
Therefore, we use heuristics to evaluate each step of the
game!
4. Apply Greedy Best First Search
Heuristic function defined by (H(f)):
f is possible state of the game board
h(f) = c0*h0 + c1*h1 + c2*h2 +c3*h3 + c4*h4 + c5*h5
where ci , i<= 0 <=5
h0 = the number of holes in the playfield
h1 = the altitude of the higher full cell in the playfield
h2 = the number of full cells in the playfield
h3 = the value of the higher slope in the playfield
h4 = the roughness
h5 = the number of full cells in the playfield weighted by altitude
The ideal state is the one with the lowest heuristic score!
5. Generating possibilities
Depth 1
Generate possibilities for all
positions and orientations of the
piece.
Depth 2
For each depth 1 board, generate
possibilities with the next piece.
7. Experimentation
1. Compare game play with different weights for the
heuristic function against baseline.
2. Compare depth 1 with depth 2 heuristic search
Baseline
1. pick orientation and position that leaves least number
of buried holes
2. random dropping
Game Scoring: 10 point/per piece dropped + # rows
cleared*100
8. Scores
In general, Depth 2 performs much better than Depth 1
Best Scores of AI:
- Depth 1 Searching: 1750 with 11 rows cleared and slope = 0.02
- Depth 2 Searching: 1850 with 12 rows cleared and slope = 20 and
roughness 0
9. Some Interesting Results
Our AI performs much better than the random baseline as
well as baseline where we optimize for number of holes
Pile Height: With regards to the full cell altitude, the higher
the weight the lower is the score and the lower the weight
the greater is the score (inversely proportional).
10. Analysis contd..
Roughness: Increasing the weight for number of holes
increases the score (directly proportional).
Full Cell count: For full cells, the more the weight the
better is the score (directly proportional).
11. Increasing Search Depth
Search Depth: Increasing the search depth by two overall,
increases the score however for some special cases.
Too much information can be sometimes bad.
Providing roughness as a heuristic is detrimental for depth
2 search.