A machine learning game training platform with multiple classic games and AI agents.
- Multiple Games: Snake, Pong, Flappy Bird, Tetris, Galaga, Dino Run, Packman
- AI Training: Deep Q-Learning with neural networks
- Real-time Visualization: Live training plots and game windows
- Speed Control: Adjustable game speed during training
- Model Persistence: Automatic model saving and loading
- Classic snake gameplay with food collection
- Neural network learns optimal pathfinding
- Two-player pong with AI paddle
- Improved reward structure and state representation
- Bird navigation through pipes
- Continuous flight mechanics
- Block stacking and line clearing
- State includes current piece and board layout
- Space shooter with enemy waves
- Multiple enemy types and movement patterns
- Endless runner with obstacles
- Random obstacle generation
- Classic maze navigation with 3 ghosts
- Different ghost behaviors (Red: aggressive, Pink: conditional, Blue: random)
- 1/3 random bean placement
pip install pygame torch numpy matplotlib tkinterpython main.py- Select a game from the UI
- Watch the AI train in real-time
- Adjust speed and controls as needed
- Models are automatically saved to
model/directory
- main.py: Application entry point and game selection
- ui_windows.py: Tkinter UI for game selection and controls
- game_runner.py: Game loop and AI training coordination
- agent_core.py: Neural network agent implementation
- game_interface.py: Base class for all games
- utils.py: Utility functions for resource paths
Trained models are saved as:
model/model_[GameName]_[linear/cnn].pth
- Python 3.7+
- Pygame
- PyTorch
- NumPy
- Matplotlib
- Tkinter