Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Can I train multiple agents at the same time?

Discussion in 'ML-Agents' started by fraa1197, Nov 17, 2022.

  1. fraa1197

    fraa1197

    Joined:
    Mar 24, 2021
    Posts:
    3
    I have 2 agents playing hide and seek and currently only one agent can be trained. Is there a way to have them both train against each other
     
  2. MidnightGameDeveloper

    MidnightGameDeveloper

    Joined:
    Apr 26, 2014
    Posts:
    89
    Yes, with self-play.
     
  3. JustnTrying

    JustnTrying

    Joined:
    Sep 24, 2021
    Posts:
    5
    Hey!
    I'm currently trying the same thing (trying multiple agents at a time). As far as I understood, you need to take two steps for this:
    1) Assign the Agent Behaviour to the agents you need. Make sure it points to the same behavior name, but has different team-ids (so each agent need to be in a separate team)
    2) Adjust your training config.yaml, (e.g. like in this documentation https://github.com/Unity-Technologi...Training-ML-Agents.md#behavior-configurations )

    Your agents will then be trained one after another, always playing again a worse/old version of itself. Once one agent was trained for a bit, it will switch to another team (agent) and train this one.
    I hope this helps to get you started!
     
  4. wechat_os_Qy02aywSGgFS-_PHswlPS4_2g

    wechat_os_Qy02aywSGgFS-_PHswlPS4_2g

    Joined:
    Nov 26, 2022
    Posts:
    2
    Hello, I am writing a master's thesis recently. I want to know whether agents with different behaviors can be trained at the same time. For example, Agent1 observes the road congestion information and gives the vehicle driving path plan. Agent2 controls the vehicle driving