Robocup 2012- Soccer Simulation League 2D Soccer Simulation Riton
Masoud Alavi, Mohammad Falaki Tarazkouhi, Arezoo Azaran, Aliasghar Nouri, Samaneh Zolfaghari, Hamid Reza Shayegh Boroujeni
SRU Robotic Association Lab Electrical and Computer Engineering Faculty Shahid Rajaee University
Abstract This paper is a quick overview of algorithms which have been applied by Riton soccer simulation team in skill and decision making layers. We also intend to improve Riton by means of restoring to previous experiences which has been gained by Riton 2D simulation team in Robocup simulation league. In this competitions we have tried to devise defensive systems which use pressing and marking in opponent's site. We have also tried to create better defensive systems by using a better formation for players and improving through pass skills.
1 Introduction
Riton has started again its professional activities since 2009 on the basis of what it has done during student's 2d simulation league. This team was ranked among the best 7 teams on AUTCup 2010 and was ranked 4th PNUCup 2010 and PNUCup 2011. It was among the 5 finalist teams in Iran open 2011.We started our project by applying logic scoring. Our primary focus is on new ideas to improve processing and to gain success by means of using new algorithms in the field of artificial intelligence. For this goal we are conducting a research on probability functions to create acknowledgment base from the opponent with no need to heavy deductions on their base, so we can have a faster, more precise and more successful decision making process. We will explain in this paper our Decision Mechanism, Skills Architecture, Danger Rate Function, Future Research Programs and other needed data .
2 Decision Mechanism
Decision making is the most crucial mechanism applied in Riton which controls all actions of strikers. In this part, all received and saved data in World Model are scanned and as a result, the best action is performed.
We consider four general conditions in the game:
- Defense
- Defense to Attack
- Attack
- Attacking to Opponent's Defending system
All actions are introduced in following description briefly.
2.1 Defense Strategy
This strategy reduces the opponents speed and doesn't let them move forward and cuts down all connections between opponents. Also we try to apply pressure on opponents in order to reduce the decision making time.
Implementation: First, we try to approach ball, as near as we can. In this situation, opponents have less room to move. We use our blocking skill to limit opponent's movement and the central teammate will try to take the ball from opponents. In order to cut down the connections between opponents, we use our marking skill too. For better results, we made some changes in formation. In this case, the performance of the agents is the best possible situation for teammates in order to defend the ball from getting into goal. In order to recognize the nearest central player or the nearest defender, a class named World Model is coded.
2.2 Attacking Strategy
Attacking here means to catch the ball and move forward to opponent's side. Attacking strategy is defined in this way: the continuous circulation of the ball between the teammates until we reach the activation of the shooting function.
Implementation: The first step to be done is checking the teammate to see whether he can shoot or not. If not and if he was a central player, priority is through passing to wing attackers for getting near to sides of the field. If not again, dribbling and direct passing will be activated. For wing attackers, priority is dribbling and moving forward with passing. Central attackers also will be checked for through passing and direct pass. Other teammates will approach attackers as possible. Wing attackers then move to offside line of opponents.
2.3 Defense to Attacking Strategy
In this strategy, we get the ball from opponents on our side. We try to kick the ball as far as we can with passing and giving in the ball to attacking line.
Implementation: First, it must be checked whether a quarantined pass out of penalty area can be done or not. If not, circulating with ball will be checked with a trustable condition, and then ball will be kicked to one of the two central sides of the field.
2.4 Attacking to Opponent's Defending System Strategy
This is the position in which we have surrendered the ball to the opponent's side. Hence, we must press the opponent which got the ball in order to set our teammate free.
Implementation: Pressing is done in one third of opponent's side by the nearest attacker and also in central one third of the field. All other teammates will mark opponents except defenders.
3 Skills Architecture
This architecture is consisted of actions with enable players to act. In general, these actions are performed by using the saved data in World Model and processing them and finally making a comprehensive instruction. The action selection is done by prior architecture.
3.1 Direct Pass
In this type of passing the probability of success is high. In this action, both sender and receiver should have a correct perception over the field. In passing method, we check several cases and list some of teammates with the least acceptable situation. We choose the best player with exercising our scoring system. Some of the conditions that we consider for scoring are:
- Least and most distance
- The non-existence of opponent's player within the 1 distance from the line
- Last received data from teammate in less than 3 cycles
- The non-existence of teammate in offside
Scoring System: We draw a line between the agent and chosen teammate and we draw spots on it. Then it will be discovered that in which spot and cycle, opponents and nearest teammate can reach the ball.
We distract these two times from each other and name this difference, difftime. This is how we calculate the score:
Total = difftime * dissTimeRate + distGoal * distGoalRate + badDist
*badDistRate distGoal = PsGoal.dis(PosBall)-PsGoal.dist(placeUS)
badDist = fabs (placeUS.dist(wm.ball().pos())-20)
diffTimeRate = 6
distGoalRate = 1
if ( distGoal < 0)
distGoalRate = 2.5
Also for providing appropriate perception for the receiver, the agent performs the "say" action for the receiver.
3.2 Through pass
In this pass, the ball is not directly passed to the receiver but the probability of ball arrival is the same as the direct pass. It is sent in an area that none of opponents can reach it. First we try to draw a line from receiver to the passing point. Than we recognize which spot on the line is the best to catch the ball by using our getRichDistance functions. In this function, we find out how many cycles are needed to reach the spot.
Cycle = (team -> playerTypePtr() ->cyclesToReachDistance
(team -> post.dist(end) ))
According to the calculated cycle, we calculate pass power:
Power = (ball_dist_to_end/cycle+1) + (0.05*cycle)
Using this written function, we check oppCantReach that whether and opponents can intercept the route with the mentioned power or not. Here you can see how this function works.
Based on the kicking power, it recognizes all the opponents with less than 5 poscount and keeps it in formation. Then it will calculate the next point of ball in coming cycles:
Ball_pos += ball_vel;
Ball_vel *= ServerParam::ballDecay();
And it checks whether all opponents in every point are able to intercept the ball or not. Therefore, we use below mentioned formula:
Opp_dist_buf = opp_max_speed * std::min(4, opp->posCount())+ opp
->kickableArea() if ( player_next_pos.dist (ball_pos) < player_max_speed
*step + player_dist_buf)
Return false;
If none of the opponents were able to intercept the ball, false is returned. If false is returned, the point and power will be returned. Else, the new point will be made at distance 3 from the last point and oppCanReach levels will be performed for it until we reach a trustable point. If no points were found, false will be returned, And if a point were found, it will be added to the list and scoring system will be activated for it and the best point for passing will be chosen. Also say will be performed.
3.3 With Ball Skill
Dribbling is the skill which depends on agent's decision. In this skill, ball should be moved to a point with a specified direction [4]. If the player is out of opponent's penalty area, the destination will be opponent's penalty area line and if the player is in opponent's penalty area, destination will be the central spot of the gate [3].Then thirteen routes will be chosen and rating method will be activated. We consider following points for our rating method:
- Body angle
- Nearest angle to the main route
- Best route
And at last, best route will be selected for dribbling.
Temp(i*15=90);
Path=pos(agnet) – vecPath;
pathDr = getDangerRate(pos(Agent)path)
angleDiff = abs(i*15 – 90)
totalScore -= PathDr*7 + angleDiff/3.0;
angleDiffrence = Vector2D::normalizeAngle ( temp
->wm.self().body().degree())
getDangerRate function will be explained in detail in the following od description.
3.4 Shoot
Shooting is the last action which leads us to the team's success. If the below mentioned cases are checked successfully, shoot will be acted.
In this method, we draw 10 points on opponent's gate and a line from ball to each point to calculate danger rate by getDangerRate function. The point with less danger is chosen. If danger percentage is less than 80, shoot will be performed. The above mentioned way, is performed only when the teammate's distance from goalie is less than 10.
In this method, we draw spots on the gate from right to left; the ball will be shooting to the first spot that opponents can't intercept. In order to check whether an opponent can intercept it or not, we use CanReachOppShoot function. It somehow works like CanReachOpp with some differences.
3.5 Block
This skill is trying to abandon opponent's forward movement. At the beginning, we specify a point according to the opponent's route. We draw a line from the opponent to the last point. Then we draw points with the distance of 1 on the mentioned line. Then we check whether the agent can reach to the point faster, or the opponent:
Current = End_poss_near_opp;
Up = nearest_opp_pos.dist(End);
For (int icycle=0; icycle<=up; icycle++){
Current = pos_near_opp+setVecPolar ( cycle, current.th);
If (current.dist (posAgent)<(cycle-1)* 1.1) {
posBlock = current;
break;}}
Teammate will move to the point, if any points was found. We have an idea in order to prevent body movement. If the current point's distance with the last point is less than 1, teammate will move backward to his last position more over if the teammate's distance with the line is less than 1, he will move to opponent.
3.6 Man Marking
Marking is done in order to keep the opponents away from the ball and not to let them reach the ball. We choose what opponents to mark based on following levels:
First, we have to recognize the Near_Opp from the agent. If the agent was the nearest teammate to Near_Opp object too, the man is the best choose to mark. If agent wasn't the nearest teammate, and if an opponent was nearer to the nearest teammate to Near_Opp and the agent was the second closest teammate to Near_Opp, we choose Near_Opp for marking. If none of the cases above were confirmed, we consider Second_Near_Opp from agent to mark. (Marking is activated if just one of the conditions above is true) after that, we draw a line from the opponent to the ball and teammate will move there and sticks to opponent and moves in a very short distance of 1 with him. However simple, but is useful and practical!
4 Danger Rate Function
With this function we can calculate danger percentage of player's route. It will receive the Vector2D of all players according to its algorithm. We will explain how this algorithm works. It will draw a line between a teammate with the ball and the last point of route. Then it will be divided in eight and circles are drawn around eight mentioned points. The presence of opponents in these circles is calculated. The circle with most danger percentage is called Danger Rate. Below you can see how it is calculated:
(1)Current = Vector2D (border.x() * (i+1) * 0.125, border.y() * (i+1)
*0.125)
(2)Radius = 1/n * border.getmagnitude
(3) DangerRate = 1/dist_opp_to_current * Radius
5 Conclusion and future works
In this paper we introduced Riton team's major ideas. Our main goal is to focus on decision mechanism. As a result, we have planned to study about Q-learning algorithm. Besides, we are trying to improve scoring with Fuzzy Logic, blocking and a better through passing for central attack. On the other hand, we are researching and testing the probability functions for our decision making. We are trying this algorithm why we always have this problem that the opponent cutting ball function do well or not, we are trying to collect data than with using random distribution is probability for estimating the opponent decision and take the best decision [6].
In decision making, for example, pass algorithm with using scoring algorithm we use an algorithm and send some passes for test and save them as data than with processing this data with use the least probability multiply it's score choose next algorithm. After some cycles (near 700-800) we can choose the best algorithm with the least risk of interception by opponent.
6 References
References
- Riedmiller, M.Merke, A.Meier, D.Hoffmann, A.Sinner, A.Thate, O.Kill, C.Ehrmann, R.Karlsruhe : brainstormers – a reinforcement learning way to robotic soccer. In Jennings, A.Stone, P.eds : RoboCup-200: Robot Soccer World Cup IV,LNCS. Springer (200)
- Stolzenburg, F.Obst, O.Murray : Qualitative Velocity and Ball Interception. In: KI 2002: Advances in Artificial Intelligence, Twenty fifth Annual German Conference on AI, Aachen, Germany (2002)
- Fuzzy sets and fuzzy logic , Dr.koursh Kiani , Amir Kabir University of Technology
- Fuzzy Logic , Prof.Lotfi Zade
- Engineering statics and probability , Nader Ne'amatollahi
- Probability, random variables and stochastic process , A.Papoulis and S.U.Pilay, 3rd edition