Scoring Mechanics
The simulation computes a score based on the ball’s trajectory and whether it successfully goes through the hoop. Whilst the score that matters most is a successful shot (so it knows whether it missed), as explained earlier it uses a binary search to compute the force (when creating training data). To do that requires it to know if the shot fell short or went too high above the hoop.
Score Calculation
- If the ball bounces off walls or floor, the score is 0. Technically you can throw it at such an angle it bounces off the floor and scores, but that’s not a good way to learn.
Successful Shot:
- If the ball goes through the hoop without bouncing on the floor it gets 1,000,000 points
- If it hits the backboard, we penalise it 100 points (to encourage it to do it cleanly)
Missed Shot:
- If the ball went above the hoop during its trajectory but quite close, 10,000 points are added.
- If the ball goes somewhere above the hoop, 500 points are added.
- If the ball did not get close to the hoop:
- The score increases based on the horizontal distance from the hoop * 25, capped at 100 points.
- Points are added based on the vertical position of the ball / 10, encouraging upwards rather than flat.
- If the ball goes higher than the backboard, 20 points are subtracted. We want to encourage it to go above the rim, but not too far upward.
- If the ball got close to the hoop:
- It uses the diagonal distance from the hoop centre and multiplies by 250 subtracted from 2000. i.e. 0.5m away is 2000-0.5*250 = 1875 points
- If the ball goes higher than the backboard, 100 points are subtracted.