Skip to content

youngtuotuo/Deep-Q-Learning-Tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e936ba6 · Jun 8, 2023

History

69 Commits
Oct 28, 2022
Jun 7, 2023
Jun 7, 2023
Apr 20, 2022
Jun 22, 2022
Jun 8, 2023
Jun 8, 2023
Oct 30, 2022
Jun 7, 2023

Repository files navigation

Deep Q learning play Tetris with interactive plots (WIP)

Requirements

$ mkdir venv
$ python -m venv venv/
$ pip install setuptools wheel
$ pip install matplotlib numpy pygame
$ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

Train

    $ python main.py

Play

    $ python play.py

Remember to change fall_speed in tetris/constants.py to higher number.
n get new tile
r reset whole game
q/esc quit game

Experimented Combinations

States Action Space Tile Fall Current Results
(cleared rows, holes, bumpiness, heights) (up, down, right, left) True Fail
(cleared rows, holes, bumpiness, heights) (up, right, left) False Fail
RGB frames (up, down, right, left) True Fail
RGB frames (up, right, left) True Fail
Binary grids (up, down, right, left) True Fail
Binary grids (up, right, left) True Fail

Experimenting

  • Skip n-frames
  • Weighted heights
  • Simplified action space: (right, left, space)
  • cols x 1 Convolution
  • DDQN
  • Skip Frames
  • More algorithm