A custom environment made using the Godot Engine and written in C# used to train reinforcement learning models to drive a car on a top-down virtual track with semi-realistic physics. Utilizes the Godot RL Agents framework to train agents using the Stable-Baselines3 implementation of the Proximal Policy Optimization algorithm.
racer_3_4x_speed.mp4
rl-racer-4-cut.mp4
rl-racer-5-cut.mp4
Inside of a Python virtual environment, install the Godot RL Agents package:
pip install godot-rl
Download the latest release and run the following command to begin training after activating the virtual environment:
python "sb3.py" --env_path=rl-racer.exe --save_model_path=models\model --n_parallel=4 --speedup=16 --save_checkpoint_frequency=50_000
Or start running inference on the pre-trained model:
python "sb3.py" --env_path=rl-racer.exe --resume_model_path=models\model-3 --viz --inference
- Added training of multiple agents
- Added multi-target camera tracking
- Added an angle limit to reach fail state
- Added a small penalty for driving off-track
- Increased off-track friction
- Slightly increased slip speed threshold
- Time-tracking and checkpoints
- Human controlled vs. Agent(s) controlled
- Improved collision avoidance
- Linux and maybe macOS binaries