Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to write your own vector observation?

Discussion in 'ML-Agents' started by zapper5312, Sep 30, 2021.

  1. zapper5312

    zapper5312

    Joined:
    Aug 5, 2021
    Posts:
    5
    Hi guys, so i am implementing and working on a project called 'Pursuit Evasion'. So what it does is both the pursuer and evaders do not know each other's location at the start. They can only sense each other location, when they are in the range of their Line of Sight. The problem is i dont know what observation to give them, when they did not see each other.

    Any kind souls can help thank you!
     
  2. gft-ai

    gft-ai

    Joined:
    Jan 12, 2021
    Posts:
    44
    I think what you need is a raycasting sensor. If you search for raycasting sensor you will get a good idea where to start. There are also many tutorials out there.

    Good luck!
     
  3. zapper5312

    zapper5312

    Joined:
    Aug 5, 2021
    Posts:
    5
    Hi thanks for the reply:) is it possible to do it without using Ray Sensors? Cause I am creating the environment using pygame not with Unity. Therefore, i need to craft my own observation, I am only using UnityML's PPO to train the environment. But i dont know what kind of observation to feed when i didnt see the evader.
     
  4. gft-ai

    gft-ai

    Joined:
    Jan 12, 2021
    Posts:
    44
    So if I understand this correctly, you want to make the agents to ‘sense’ where each other is.

    There are raycasting libraries you can use in python to create the ‘sensor’ data to feed it to the model. Or you could take a slightly different but very similar approach where you give the relative location of the agents if they are in a ‘close’ proximity to each other. Or any other ways you think best.

    I hope this helps a little.