Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Two agents with different strategies are trained to confront each other

Discussion in 'ML-Agents' started by ice_creamer, Aug 22, 2023.

  1. ice_creamer

    ice_creamer

    Joined:
    Jul 28, 2022
    Posts:
    34
    Like hide-and-seek,if i want to train seeker to find the hider as soon as possible and at the same time ,train the hider to aviod being found. How i can do? in Unity, can i put to tow agent components onto different agents?
     
  2. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    154
    look at striker vs goalie demo but yes, you can define multiple behaviours in the same yaml file
     
    ice_creamer likes this.
  3. ice_creamer

    ice_creamer

    Joined:
    Jul 28, 2022
    Posts:
    34
    Thanks, when i learn the demo, I have a question and not found solution. about self-paly,there are two network: striker and goalie. If i want train striker first what should i do?
     
  4. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    154
    you mean train it without the goalkeepers?
    you can use new yaml files to train from so they don't both need to be in the same file unless you want to train them at the same time.
     
  5. ice_creamer

    ice_creamer

    Joined:
    Jul 28, 2022
    Posts:
    34
    I mean joining is the hide-and-seek problem, where there are two brains in the scene, the hideer and seeker strategies. The two were trained alternately with self-play, but at first I wanted to train the seeker first.
    If I use two YAML files and train the two alternately, I have to manually train the two training exchanges, don't I?
    Thanks
     
  6. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    154
    i think i understand, you want the hider to not be able to move at first while the seeker gets the basic idea?
    i would train both and use lessons or some other form of control to make it so that the seeker has more limited behaviour while the seeker is still learning, then once the seeker knows what he is meant to be doing you can allow the hider to be more proactive.