Using Unity ML-Agents to create an environment, where agents are able to choose when to act.
Here is an article, which describes the motivation for this project, as well as some implementation details.
Engine: Unity 2020.3.25f1
Controls:
- Jump: Spacebar (action is only registered when agent requests decision)
- Timescale: Numpad + and -
- Camera focus: Left and Right Arrows (only works with multiple agents on scene)
- The Environment Duplicator script is responsible for instancing the selected environment (The number of environments is overridable from python).
- Each environment prefab features an enclosed area and an agent.
- To try out different pretrained models, add an environment into Environment Duplicator, add the desired model to the prefab of an agent and don't forget to change decision period to the appropriate value (The decision period is overridable from python).
- To train the agent from scratch you can use my custom tool or the regular ML-Agents library.
- The main scripts are:
- DinoAgent
- DinoDelayedAgent
- CustomDecisionRequester
- EnvironmentDuplicator
- Python environment parameters:
- decision_period
- DinoAgent: 1 - 30
- DelayedDinoAgent: 3 - 100
- environments_per_unity_process
- 1 - 30
- decision_period



