Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ml-agents question

Discussion in 'AI & Navigation Previews' started by Seto, Jan 13, 2019.

  1. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    I want to train an AI to dodge bullets.
    It's simple enough.
    An agent, an bullet spawner.
    I make it observe the position of the agent, the nearest bullet relative position and velocity.
    But I can't make it working.
    Can anyone help?
    https://github.com/SetoKaiba/ml-agents-test/commits/master
     
  2. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    I think that the documentation is not clear in the first place since there was a lot of ml-agent and Unity changes.
    Basic Guide training section, Unity Youtube Video n8 Training Tutorial, and the Training ml-agent main section need to be updated, correct and more detail to be usfull.
     
    Last edited: Jan 15, 2019
  3. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    No. I mean maybe anyone can tell me why does my observation not working. I change it with ray perception like the examples. And now it will work most time.
     
  4. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    I tried to make a test of an agent to dodge bullet automatically.
    I tried two approaches.

    1. vPos, [{vRePos, vVel, bEx}, ...]
      vPos is the position of agent. Vector3
      The elements in the list is below. The list is sorted by distance from near to far for a specified amount of nearest bullets. To ease the problem only one nearest bullet in the case.
      vRePos is the relative position of the bullet. Vector3
      vVel is the velocity of the bullet. Vector3
      bEx is whether the bullet exist.

    2. Use the ray perception from the examples.
    The 1st approach is nearly not working. The 2nd approach is working most time.
    But for the 2nd approach I make it with only 8 direction. So it may not see the bullet.
    So I'd like to use 1st approach to get rid of the not-seeing bullet situation. But it does not work.
    For the 1st approach, I tried to use polar coordinate with distance and angle. It doesn't work as well.
    Can anyone tell me the reason? Thank you.

    And also, is there a place to discus or ask question about ML agents? I found no subforum of official forum. I'm sorry to ask question here.
     
  5. Deleted User

    Deleted User

    Guest

    Do you happen to have working examples? I can only get the balance ball to work with the new ML Agents but can't get the one from here to train: https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Learning-Environment-Create-New.md Thanks for any help.