A Deep Q-Network (DQN) agent trained to play Tetris using Stable-Baselines3 and tetris-gymnasium.
The agent uses a custom reward function (V3) with GA-optimized feature weights to encourage line clearing. It observes board state as a feature vector (column heights, holes, bumpiness) and learns via DQN over 1.5 million timesteps.
Reward shaping includes:
- Line-clear bonuses (scaled by number of lines cleared, with a Tetris bonus for 4 at once)
- Penalties for aggregate height, holes, and bumpiness (weights from genetic algorithm optimization)
- Small per-step survival reward
- Game-over penalty