“If the number of observed entities in an environment can vary, you can pad the calls with zeros for any missing entities in a specific observation, or you can limit an agent’s observations to a fixed subset. For example, instead of observing every enemy in an environment, you could only observe the closest five.”
I read this from ml-agents GitHub but still do not understand clearly. So I have some questions.
- Is “pad the calls with zeros” something like
sensor.AddObservation(enemy.position)//when visible;
To
sensor.AddObservation(Vector3.zero)//when not visible;
- Can you provide an example code of “limit an agent’s observations to a fixed subset”.
I am asking this because I want my agent to know where are enemies when they are near. So the agent will collect enemy transform.position when they are near but not when far