Skip to content

Unity bachelor project of 'formula 1 racing' with ml-agents (reinforcement learning) for comparing open-ai's trainers ppo and sac

License

Notifications You must be signed in to change notification settings

JoshuaBluem/F1_Racer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

F1_Racer

-------------Description:--------------

This Unity bachelor project focuses on Formula 1 Racing, utilizing ML-Agents for reinforcement learning to compare OpenAI's trainers: Proximal Policy Optimization (PPO) and Soft Actor-Critic (SAC).

---------Starting the Project:----------

To access the project, clone it to your local machine and add the project path in Unity Hub. To initiate the game, navigate to Assets/Game/Scenes/GameScene.unity and press play in the Unity Editor.

----------Gameplay Modes:-----------

The project supports 3 gameplay modes:

  • Play Game: Engage in gameplay using mouse and keyboard controls.
  • Watch Algorithm: Observe a programmed algorithm in action.
  • Load AI: Select a Neural Network (.onnx file) to allow AI to play the game.

--------------Training AI:--------------

AI training begins automatically when the mlagents-learn command is executed in the activated console environment while the "GameScene" is running. Building the project is recommended for faster training, though training can also be conducted within the Unity Editor. If ML-Agents is correctly installed and configured, an example command in the console would be:
mlagents-learn C:<your_path>\YourConfigFile.yaml --env=C:<your_path>\Builds\F1_Racer.exe --no-graphics
The trained AI will be saved as an .onnx file. For additional guidance on ML-Agents, refer to introductory tutorials available on YouTube

-------------Code Insight:-------------

To gain a better understanding of the code structure related to driving mechanics, please consult the simplified UML diagram located in Assets/Game/Docs/CarDrive_UML.drawio.pdf

About

Unity bachelor project of 'formula 1 racing' with ml-agents (reinforcement learning) for comparing open-ai's trainers ppo and sac

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published