Open drallensmith opened 7 years ago
I agree, it should be a diameter and not a radius. What is the other issue and the proposed fix?
The current code allows Players to go out of bounds (even outside of the 10% allowance area) without the episode ending.
The issue is that it should be sqrtf(pitchHalfLengthpitchHalfLength + pitchWidthpitchWidth), which is larger. This is particularly an issue with fixed landmark features, which do not have visibility limits, and when running in fullstate.
If the players are able to go outside (I thought so from observation), then it actually should really be even larger (adding the 10% on each end of each dimension), since a player could be outside the bounds at the time of checking the state.
P.S. The OOB (46-50) proximity code also needs some tweaking if it's really to be how close you are to the bounds... including from outside them! :) This is relatively simple to fix, however.
This error is also present in highlevel_feature_extractor.cpp, as maxR; it is used in the goal center distance and closest opponent distances (self and teammates).
Good find. These both should be fixed: pitchHalfWidth --> pitchWidth.
See #42 for a partial fix (I used, as you suggested, pitchWidth, but not pitchWidth1.1 or pitchHalfLength1.2). (The current transformation for x and y in highlevel_feature_extractor.cpp indicates that it would be pitchWidth1.1, not 1.2.)
First, it's actually a diameter in terms of what circle will fit inside. :) (Sorry, I'm compulsive...) Second, more problematically, it is currently in
feature_extractor.cpp
as:maxHFORadius = sqrtf(pitchHalfLength*pitchHalfLength +
pitchHalfWidth*pitchHalfWidth)
However, the HFO non-OOB area's width (top/bottom) is not half the usual; it is the full width.
Again, the major problem with fixing this is with already-existing agents, since it will change the relationship between proximity and distance.
Another question on this: Out-Of-Bounds definitely applies to the ball (as in, the episode ending when the ball goes out of bounds). How about the players? Or are they actually able to go into the 10% allowance area?