This project implements a Unity ML-Agents adversarial multi-agent environment with a spider (Crawler) predator chasing a worm (Prey). Deployment supports running pre-trained models for inference or headless training using standalone builds.
- Unity Hub and Editor 2023.2.6f2.
- Python 3.10.12 via Conda (for training).
- Download Unity Hub: https://unity.com/es/download.
- Install Unity Editor 2023.2.6f2 via Hub.
- Clone repo: https://github.com/Potzon/Proyecto-RL.
- Import folder
Proyecto-RL-mainin Unity Hub > Projects. - Load
Assets/Scenes/ProyectoV1.unity, press Play.
Use Builds/Build-V1/RLV1 project.exe for no-graphics runs.
conda create -n mlagents python=3.10.12
conda activate mlagents
pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121
git clone --branch release_23 https://github.com/Unity-Technologies/ml-agents.git
cd ml-agents
pip install ./mlagents-envs
pip install ./ml-agents
- Visual training: cd mlagents-learn Config/duoCW-V1.yaml --run-id=test --torch-device=cuda
(Open ProyectoV1 scene first.)
- Headless: mlagents-learn Config/duoCW-V1.yaml --run-id=test --no-graphics --env=Builds/Build-V1/RLV1 project.exe --torch-device=cuda
| Directory | Purpose |
|---|---|
| Assets | Prefabs, Scripts, Models (.onnx), Scenes (ProyectoV1.unity) |
| Builds/Build-V1 | Standalone exe for headless |
| Config | YAML configs (SoloCrawler, SoloWorm, duoCW-V1.yaml) |
| Results | Checkpoints, logs |
