Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Using Collect Observations in Self-Play leads to issues

Discussion in 'ML-Agents' started by Print_Hello_World, Mar 16, 2020.

  1. Print_Hello_World

    Print_Hello_World

    Joined:
    Jan 14, 2020
    Posts:
    12
    Hi everyone,

    I am trying to make a shooter game using the Self-Play feature. I followed closely with the Soccer example except that I added a vector observation which is an integer and is the ammocount. The rest of the configurations are the same, ie the raycasting, 2 vs 2 scenario etc.

    However, when I hit train, I observe that all the agents were doing the same actions. Sort of like when I heuristically control the agents while not training to test the environment before training.

    I removed the vector observation and tried training this time and it works now, the agents are doing different actions.

    Can somebody please explain why adding the vector observations resulted in such a weird behavior?

    Thank you
     
  2. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    Are there any errors in the console?

    You can also check out our tennis environment for an example of self-play with ray casts, though this should not cause any strange behavior.
     
  3. Print_Hello_World

    Print_Hello_World

    Joined:
    Jan 14, 2020
    Posts:
    12
    Hi, I managed to fix the issue by removing the vector observations, therefore the agents only use raycasting to observe the environment. thanks!