WARINING: the back to menu buttons don't always work and sometimes crash. The bug is known,sorry for the disagreement.
- Custom game environment built with Pygame
- AI agent implementation using PPO algorithm
- Level editor for creating custom levels
- Multiple game modes: Player, AI Training, and Level Editor
- Save and load AI models
- Visualize AI training progress
-
Clone the repository:
git clone https://github.com/AshladBP/g-t-AI.git cd g-t-ai cd python
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
Run the main script to start the application:
python main.py
- Player Mode: Play the game manually using arrow keys.
- AI Mode: Train an AI agent using PPO algorithm.
- Level Editor: Create and edit custom levels.
- Use arrow keys to move the player in Player Mode.
- In AI Mode:
- Space: Pause/Resume training
- R: Toggle rendering
- Click on buttons to save/load models or return to the main menu
main.py
: Main entry point of the applicationgame.py
: Implements the core game logic and renderingplayer_mode.py
: Handles the player-controlled game modeai_mode.py
: Manages the AI training modelevel_editor.py
: Provides a GUI for creating and editing levelsplayer_env.py
: Defines the environment for the AI agentagents/ppo.py
: Implements the PPO algorithm for AI training
- Select "Level Editor" from the main menu.
- Use the tools provided to create walls, set spawn points, and place goals.
- Save your level with a unique name.
- Select "AI Mode" from the main menu.
- Choose a level for training.
- Monitor the training progress and use the provided controls to manage the process.
- Save your trained model for later use.