FormulAI is a reinforcement learning project that enables a Formula 1 race car to drive autonomously in a 2D simulation environment. The game simulates a top-down view with a fixed camera, providing an ideal setting for testing and refining reinforcement learning techniques. Additionally, the game is playable by human players and is built using Pygame.
FormulAI uses reinforcement learning to train an agent capable of driving a Formula 1 car in a simulated environment. The goal is to teach the agent to navigate the track efficiently, optimize racing lines, and avoid collisions while maximizing speed. The simulation takes place in a 2D game with a top-down view, where the car is represented as a sprite and follows simplified physical laws.
The original game is also playable by human players, providing an interactive way to compare the agent's performance with that of a human driver. The game environment is built using Pygame, a popular library for creating 2D games in Python.
The reinforcement learning algorithm uses the PyTorch library for training neural networks and optimizing learning policies.
- Programming Language: Python
- Main Libraries: PyTorch, Pygame
- Simulation Environment: Custom 2D game (top-down view, fixed camera)
- Learning Method: Reinforcement learning (specific algorithm to be specified, such as DQN, PPO, SAC, etc.)
-
Clone the repository:
git clone https://github.com/Zoz018/FormulAI.git cd FormulAI -
Install dependencies:
- Make sure you have Python 3.x installed.
- Install the required libraries:
pip install -r requirements.txt
Note: The
requirements.txtfile contains the necessary Python libraries, including PyTorch and Pygame.
You can play the game manually by running the following command:
python play.pyTo train the reinforcement learning agent, use the following command:
python train.pyYou can play an old version of the game with more features manually by running the following command:
python main.pyFormule1.py: Script for playing the game manually.train.py: Main script for training the agent.
