Here is an updated version of your project document with a results table added:
This project implements AI agents for playing the classic game of Tetris. Our goal is to develop a system that can arrange falling blocks in the best possible way to maximize the score by clearing as many rows as possible. We implemented two models to solve this problem: a Genetic Algorithm and a Deep Q-Learning (DQL) Agent.
- Numpy
- Tensorflow
- Pygame
To run the project, follow these steps:
-
Clone the repository:
git clone https://github.com/uzano101/tetris-ai-project.git
-
Install requirements:
pip install -r requirements.txt
-
Run the project:
python Main.py
-
Genetic Algorithm:
- Uses evolution principles like selection, crossover, and mutation to improve decision-making over generations.
- Heuristics include: Aggregate Height, Holes, Complete Lines, Bumpiness, Highest Point, and Neighbors.
-
Deep Q-Learning (DQL) Agent:
- Uses a neural network to predict the best next state, balancing exploration and exploitation.
- The agent learns from experience by storing game states and updating the Q-values using the Bellman Equation.
- Genetic Algorithm: Optimizes weights for heuristics over multiple generations.
- DQL Agent: Learns from game experience and predicts the optimal move for each state.
| Result | Genetic Algorithm | Deep Q-Learning (DQL) |
|---|---|---|
| High Score | 56,224,940 | 2,187,300 |
| Lines Cleared | 4,964 | 877 |
| Level | 497 | 88 |
This table summarizes the performance of both models in terms of high score, lines cleared, and levels achieved.

