Author | Jozef Porubcin |
The goal of this project, Break the Mold, is to use reinforcement learning to train an AI model for close-quarters battle situations such as hostage rescue scenarios. I designed an environment in Unity to simulate such a scenario and I used the Unity ML-Agents Toolkit to train an AI model for this task. The environment supports two opposing teams of up to 12 agents each.
- Move: WASD
- Aim: Cursor position
- Shoot: Primary mouse button
- Reload: R
The Unity project can be opened in Unity 6 as-is. The following instructions are for setting up an environment for training an AI model with the Unity ML-Agents Toolkit (release 22).
-
Install Python 3.10.12. You can use pyenv to manage multiple Python versions:
pyenv install 3.10.12
-
Set the local Python version:
pyenv local 3.10.12
-
Create a virtual environment with Python 3.10.12:
pyenv exec python -m venv .venv
-
Activate the virtual environment:
Unix/macOS:
source .venv/bin/activate
Windows:
.venv\Scripts\activate
-
Install mlagents 1.1.0:
pip install mlagents==1.1.0
Now you can use the training configuration file to train an AI model with the Unity ML-Agents Toolkit. Replace the default model file to test a different model.