Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opponent position in low_level_features_set #110

Open
arminsadreddin opened this issue Sep 2, 2020 · 3 comments
Open

Opponent position in low_level_features_set #110

arminsadreddin opened this issue Sep 2, 2020 · 3 comments

Comments

@arminsadreddin
Copy link

I am going to train my agent for dribbling the opponent using DQN.
I am using the low_level_features_set in order to have access to velocities and all players orientation.
The problem is that according to the HFO manual, I only have access to 8 feature of the opponent which is :
0- pos_valid
1-vel_valid
2-3-vel_ang
4-vel_mag
5-6-ang
7- Frozen
(if I am not mistaken, because the manual do not explain exactly and I believe that the features should be the first 8 features which are available for self)

These features to not indicate the exact position of the opponent or even it's relative position to self which I need for the feature set and reward.

How can I have these data ?
Did I understand the features correctly cause it seems a bit weird that through these data we can not get any useful information from the opponent.

Thanks

@mhauskn
Copy link
Member

mhauskn commented Sep 2, 2020

Yes - it looks like the manual is not very specific on this point (if you want to add some better information, happy to accept PR). Here are the features for each opponent: https://github.com/LARG/HFO/blob/master/src/feature_extractor.cpp#L75

1-3: Distance and angle to the opponent (e.g. relative position)
4-5: Opponent's own angle (e.g. where are they facing)
6: Opponents velocity magnitude
7-8: Opponent's velocity angle

Hope this helps!

@arminsadreddin
Copy link
Author

Thanks for your answer.
Also there is another point that I can not understand about the opponents.
When the full_state flag is set to false, there are lots of cycles that the agent do not see the opponent, as I checked whenever it can not see the opponent the velocity is set to zero but the position still gets updated.
How is the position calculated during these cycles?

Thanks

@mhauskn
Copy link
Member

mhauskn commented Sep 9, 2020

I'm not sure how/why the position is getting updated as this happens at a lower level of the code than the HFO interface.

For what it's worth, here is some speculation: When full-state is off the agent should only receive updates from the things inside of its view cone. In particular if other agents aren't inside of the view cone, they will likely not be updated. However there may be a couple of reasons why you would see such an update:

  1. If player's agent moves, perhaps all the other objects on the field (opponents included) have their relative positions updated.
  2. If there are teammates who view the opponent, they can potentially communicate their observations about the opponent's updated position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants