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 How to handle a cooperative multi-agent environment observation ?

Discussion in 'ML-Agents' started by seifmostafa7347, Mar 19, 2023.

  1. seifmostafa7347

    seifmostafa7347

    Joined:
    Nov 2, 2021
    Posts:
    22
    I tried following the GitHub documentation on multiagent using POCA but couldn't understand what to do exactly.
    I have a controller class that has references to all agents which I add to simple SimpleMultiAgentGroup
    and when all of the agents reach the goal I add a +10 reward to the group
    but The documentation doesn't discuss what should I do for the agent script.
    should I still collect observations and take actions in the same way as a single agent?
    how does agents' observation communicate with each other ?...
    there are many questions not answered in the documentation, so if anyone could guide me here I'd really appreciate it
     
  2. kokimitsunami

    kokimitsunami

    Joined:
    Sep 2, 2021
    Posts:
    25
    In the github documentation below, there are some descriptions on multi-agent:
    https://github.com/Unity-Technologi...gn-Agents.md#groups-for-cooperative-scenarios

    • Group rewards are meant to reinforce agents to act in the group's best interest instead of individual ones, and are treated differently than individual agent rewards during training. So calling AddGroupReward() is not equivalent to calling agent.AddReward() on each agent in the group.
    • You can still add incremental rewards to agents using Agent.AddReward() if they are in a Group. These rewards will only be given to those agents and are received when the Agent is active.
    In the multi-agent game I tried, I gave both team and individual rewards. You have to define the collection of observations and the execution of actions in the same way as for single agents. I hope this helps.