Skip to content

uzano101/IntroToAI-FinalProject

Repository files navigation

Here is an updated version of your project document with a results table added:

IntroToAI - FinalProject - Tetris AI

Overview

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.

Demo

Untitledvideo-MadewithClipchamp17-ezgif com-resize

Requirements

  • Numpy
  • Tensorflow
  • Pygame

Installation

To run the project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/uzano101/tetris-ai-project.git
  2. Install requirements:

    pip install -r requirements.txt
  3. Run the project:

    python Main.py

Models

  1. 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.
  2. 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.

Implementation

  • Genetic Algorithm: Optimizes weights for heuristics over multiple generations.
  • DQL Agent: Learns from game experience and predicts the optimal move for each state.

Results

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.

Performances

here are the scores of the two models over the game numbers. You can observe the upward trend lines of both models.

Result Graphs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages