Closed pmacalpine closed 7 years ago
Is there a reason why you went with this approach rather than the one I suggested in #90?
It seems like this would probably fix the issue when kicks happen in the middle of the field / during kickoffs, but not from one of the field corners?
Increasing the scale of the camera near the edges of the screen was the quickest way I could easily get something to work without much tuning. I just committed an implementation for this fix that uses the velocity of the ball relative to the screen (not the world) to change the scale of the camera. I think either way of doing things can fix the problem. It's probably best to try out both to see what looks/works the best.
…when the ball is near the edges of the screen. This serves to try and keep the camera in view of the ball even if the ball is traveling fast after having been kicked. This change is tuneable with the area in which the scale is increased set by SCREEN_THRESH_PERC, and the amount the scale is increased controlled by SCALE_FACTOR.
This change has been tested with the 2016 utaustinvilla released agent kicking the ball from the center circle during PlayOn toward the opponent's goal. More often than not the agent's kick is strong enough to score a goal, and also fast enough to move outside the camera's view which this change now prevents.
Closes #90.