How to write your own vector observation?

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!

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!

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.

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.