One of the long-lasting problems of our team was a slow and inefficient goalkeeper behavior, due to primitive logic constituting its AI. For this reason, we had to design and implement an advanced algorithm, converting our goalie into a full-value member of the team.
The underlying ideas of the algorithm are very clear. First, while the ball is played by other robots, the goalkeeper simply aims to the most beneficial point (depending on the current location of the ball) in front of the goal line, in order to react against a virtual goal attack as fast as possible – in fact, such point is the midpoint between two positions, blocking the corners of the goal. Second, if the ball is shot towards the goal, the goalkeeper quickly moves to the closest point, blocking the line of shoot.
The question is, how the goalkeeper “understands” that the ball is shot to the goal. In terms of AI, this understanding comes from the evaluation of the time of approach (which we can compute, knowing the current coordinates and velocity of the ball): if this time is less than some critical value (say, 2 seconds), our goalie will react accordingly.
The video demonstrates the agile behavior of our “renovated” goalkeeper. Though we still do not have a perfect guard for the goal, much more than a half of fast attacks are now intercepted (before we had something close to zero). What we have to do now is the “fine tuning” of the algorithm – we should select (find) the values of some contained parameters, providing the most reliable and balanced performance of the goalie.