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

Question Two agents with different behaviors playing against each other

Discussion in 'ML-Agents' started by KronosAmon, May 19, 2020.

  1. KronosAmon


    Jan 19, 2018
    I created different agents for the player and enemy and when they are by themself I can train them with no problem.

    But what I want is, these two to play against each other and train together.
    When I use for example "AddReward" how can I choose if I want to reward the player agent or the enemy agent?
    Both player and enemy have "Behavior parameters", "Ray Perception Sensor 3D", "Decision Requester".

    I probably should mention that the player and the enemy have completely different gameplay so the agent I train for one is useless for the other.
  2. awjuliani


    Unity Technologies

    Mar 1, 2017
    Hi Liakan,

    The `AddReward` is called on a specific instance of the agent. As such, whichever agent you call it on will have the reward applied.