Namira Soccer 2D Simulation Team Description Paper 2018

Ehsan Asali, Farzin Negahbani, Saeed Tafazzol, Mohammad Sadegh Maghareh, Shahryar Bahmeie, Sina Barazandeh, Shokoofeh Mirian, Mahta Moshkelgosha

Department of Electrical and Computer Engineering & IT Shiraz University, Shiraz, Fars, Iran; Qazvin Islamic Azad University, Iran

http://www.rctools.sourceforge.jp · https://link.springer.com/chapter/10.1007/978-3-662-44468-9_46 · https://github.com/Farzin-Negahbani/Namira_TPAS


Abstract We are going to introduce and explain the algorithms, methods and ideas that have been implemented in Namira Soccer 2D Simulation team in this paper. We will discuss the most powerful aspects of the scientific effort that have being done in Namira Soccer Simulation 2D team during its activity. Our formation detection system, goalie and shoot methods and ideas, and an implemented match-holding and match-analyzing software (TPAS) have been discussed here. The base code that Namira has used is agent2d-3.1.1 [7][8][9] and the library is libresc-4.1.0 with some little changes.

Keywords: Namira, soccer 2D simulation, intelligent formation detection, TPAS, gradient decent.

Introduction

Namira Robotics team has been formed by students of Shiraz University and Qazvin Islamic Azad University (QIAU). This team is a combination of some members of Shiraz [3] and Persian Gulf Soccer 2D Simulation Teams [2] in World Cup 2016 and 2017 and some recently added students who study Software & Hardware Engineering and Information Technology at Shiraz University and QIAU. Some members of the team could achieve $1^{st}$ place in IranOpen 2016 technical challenge, $2^{nd}$ place in ShirazOpen 2018, $5^{th}$ place in IranOpen 2016 and 2017 leagues and $6^{th}$ place in RoboCup WorldCup Competitions 2016. Some members of Namira have participated in various competitions [4][5][6] since spring 2012. They could achieve $1^{st}$ place in IranOpen 2014, $5^{th}$ place in WorldCup Brazil 2014, $8^{th}$ place in WorldCup Netherlands 2013, $9^{th}$ place in WorldCup China 2015 and $1^{st}$ place in Kordestan 2013. Introducing novel approaches in soccer simulation, reducing data noise, declining search space for agents' decision making and using more artificial intelligent algorithms to make agents more dynamic are the most prominent aims of Namira team members.

In the following, at first, our formation detection system will be discussed; then, TPAS Software characteristics and capabilities will be shown. Finally, we will express how our goalie takes position in each cycle and some future works.

Formation Detection System

Detecting and considering the opponent's tactics and strategies can help us to neutralize its plans and to plan to defeat it in the best way. One of the most utilized methods to detect soccer strategy is to find opponent players' formation. Formation is mostly defined by a sequence of numbers which specifies the number of players in soccer main roles. For instance, a frequently used formation in soccer 2d is 433 which means that there are four defenders, three midfielders and three offenders in the team. Since players do not have a global view on the field and formation directly depends on players and ball positions, we need to get help from the coach agent which has no view limits during the game.

To detect opponent formation we need first to make our agents know what is formation and whats the difference between formations. In order to do so we have created 20 different formation with three and four layers. A three layer formation is like 352 and a four layer would be like 4123. Then, we have used three different teams, Helios base, Helios and Shiraz and we replaced our twenty formations on those teams and made twenty different teams from each of those three teams. We played games between each of those twenty teams in a homeaway league. Each of the games made us about 1000 high-quality data samples. After finishing the games, we gathered the position of all players, the average position of all players, the position of the ball, the distance between the last defender and the farthest offender and an artificial layer counter which counts the number of layers that have more than five meters horizontal distance from the other one. By gathering these information we could learn from data by using Decision Trees and we made a model to use it during a game. The maximum accuracy for Decision Tree algorithm was %95.29 but the model becomes really bulky(about 2GB). A lower accurate model (%64.34 accuracy) have been used in our team to avoid storage consumption(117MB).The algorithm converges after about 1000 cycles after match kick off.

This method could be used to detect opponent formation, but we are working on how to use this information in a real game and we are looking for a way to utilize it in a way that the best reaction could be chosen in the game dynamically even if the opponent changes its formation periodically during the match.

Tournament Planning and Analyzing Software(TPAS)

In order to assure that our algorithms meet our requirements, indeed, numerous matches are needed to be done; but, setting up this huge amount of matches with different teams would not be feasible manually as it would be time consuming in most cases. Furthermore, after finishing the matches, an automated analyzer would be needed to make match information useful. In order to do so, Namira team members have developed TPAS (Tournament Planning and Analyzing Software) which is not only capable of running various custom tournaments, but also automatically analyzes log files and reports match facts. By using such tool we are able to determine weaknesses and strengths of rivals, too. Finally, TPAS lets us configure any tournament by just doing some clicks and in a well-designed graphical interface and keeps us away from server configuration complexities.

Namira team aims to extend TPAS and complete this work with a recommender system. Soon we will be able to not only setup many matches and analyze results, but also recommend solutions and methods to improve every team based on the analyzed results. Figure 1 shows TPAS steps to run a tournament from its beginning to get match results. TPAS released version can be found at [11] and will be updated regularly.

Fig. 1. Steps to make a tournament in TPAS
Fig. 1. Steps to make a tournament in TPAS

Goalkeeper

The goalkeeper plays a vital role in most successful teams since he should protect our goal line by blocking or catching balls shot from opponents. According to its effective role in the game, we have implemented a goalie positioning method which could lessen the problems of previous goalkeepers in soccer 2d. In this method, the goalkeeper maps goal line to a smaller line by using ball position and goal posts locations. As it can be seen in figure 2, we want the goalie to cover just the line which ball can possibly pass it and reaches the goal, instead of covering the whole goal line all the while.

As it is shown in the figure, goalie should first assume a triangle with three apexes: ball position, the position of the nearest goal post to ball, a point on the line of ball to nearest the other post so that the triangle becomes an Isosceles triangle. Afterwards, our goalkeeper should find the middle point of the triangle's base and turn its face, if needed, to the nearest goal post to ball.

This method can simply optimize the catch movement of our goalie and not only reduces the opponent's chance to score by lessening his shoot space, but also assists the goalie to consume less energy.

Fig. 2. Namira's goalie positioning
Fig. 2. Namira's goalie positioning

Shoot

Scoring is the most important part of soccer which can not be done with a weak shoot action. This year we are implementing a new method for finding the most proper point on the goal to shoot at. The easiest procedure to do so is to check some discrete points and find the best point among them. Although this method is fast and handy but it can miss some good points. To solve this problem we have created a continuous function inspired by potential field algorithm (which is being usually used in navigation). This way, the algorithm takes the height of shoot target point, called T, which shows how bad the target is; The worse the target is, the higher the output will be. Obviously, we want to minimize our function and in order to do that we use gradient descent[1]. Figure 3 represents more details.

As was described, we want to minimize our function. In this case, ball should be able to pass the opponent; in other words, it should reach the intersection point faster. Intersection point is the closest point on the line (which is made by shoot target and the ball) to the opponent. So, distance from ball to intersection point should be divided by an approximate speed (in this case 3) that will give us the required time to reach the point. Same procedure can be done for the opponent and now we have two reaching time to intersection point. Obviously, if we subtract player time from ball time we will get the function that we wanted to minimize.

$$f(T) = \frac{\sqrt{(b_1 - \frac{(G - b_1)((G - b_1)O_1 - (b_2 - T)O_2) - (b_2 - T)(Tb_1 - b_2 G)}{(b_2 - T)^2 + (G - b_1)^2}})^2 + (b_2 - \frac{(b_2 - T)(-(G - b_1)O_1 - (b_2 - T)O_2) - (G - b_1)(Tb_1 - b_2 G)}{(b_2 - T)^2 + (G - b_1)^2})^2}{3}$$

$$-\sqrt{(O_1-\frac{(G-b_1)((G-b_1)O_1-(b_2-T)O_2)-(b_2-T)(Tb_1-b_2G)}{(b_2-T)^2+(G-b_1)^2}})^2+(O_2-\frac{(b_2-T)(-(G-b_1)O_1-(b_2-T)O_2)-(G-b_1)(Tb_1-b_2G)}{(b_2-T)^2+(G-b_1)^2})^2+(O_3-\frac{(b_2-T)(-(G-b_1)O_1-(b_2-T)O_2)-(G-b_1)(Tb_1-b_2G)}{(b_2-T)^2+(G-b_1)^2})^2}$$

Fig. 3. Shoot kicker calculations using gradient decent algorithm
Fig. 3. Shoot kicker calculations using gradient decent algorithm

Conclusion and Future Work

In this paper we have pointed out Namira soccer 2D simulation formation detection, goalie and shoot methods and our novel software, TPAS that could be used by all soccer 2d teams after it publish. All of aforementioned methods would pave the way for us to increase our team performance much easier and faster. Detecting opponent's general tactics both in online and offline modes can definitely make an advantage for our team to defeat our rivals.

We are working on a perfect recommender system that will be added to TPAS to aid soccer 2d programmers find their team's weaknesses and strengths in a blink of an eye.Lastly, our pass accuracy and defensive actions need to be revised and some corrections are needed in agents' movements.

References

  1. Yuan, Y.-x. (2008). Step-sizes for the gradient method. In Third International Congress of Chinese Mathematicians. Part 1, 2. AMS/IP Stud. Adv. Math., 42, Pt. 1 2 785796. Amer. Math. Soc., Providence, RI.
  2. E.Asali, A.Moravej, S.Akbarpoor, O.Asali, M.R.Katebzadeh, S.Tafazol, F.Negahbani, M.Valipour, S.Mirian, H.Mehran, A.Bitaraf Haghighi, Y.Khoshghadam Borazjani, Persian Gulf Soccer 2D Simulation Team Description Paper 2017, The 21th annual RoboCup International Symposium, Japan, Nagoya, 2017.
  3. E.Asali, M.Valipour, A.Afshar, O.Asali, M.R.Katebzadeh, S.Tafazol, A.Moravej, S.Salehi, H.Karami, M.Mohammadi, Shiraz Soccer 2D Simulation Team Description Paper 2016, The 20th annual RoboCup International Symposium, Germany, Leipzig, 2016.
  4. N.Zare, M.karimi, A.Keshavarzi, E.Asali, H.Alipoor, A.Aminian, E.Beheshtian, H.Mola, H.Jafari, M.J.Khademian, CYRUS Soccer 2D Simulation Team Description Paper 2015, The 19th annual RoboCup International Symposium, China, Hefei, 2015.
  5. R.Khayami, N.Zare, M.karimi, P.Mahor, F.Tekrar, E.Asali, A.Keshavarzi, A.Afshar, M.Asadi, M.Najafi, CYRUS 2D Simulation Team Description Paper 2014, The 18th annual RoboCup International Symposium, Brazil, Joao Pessoa, 2014.
  6. R.Khayami, N.Zare, H.Zolanvar, M.karimi, P.Mahor, F.Tekrar, E.Asali, M.Fatehi, Cyrus Soccer 2D Simulation Team Description Paper 2013, The 17th annual RoboCup International Symposium, The Netherlands, Eindhoven, July 1, 2013.
  7. Akiyama, H.: Agent2D Base Code. http://www.rctools.sourceforge.jp (2010).
  8. HELIOS2010 Team Description. In: RoboCup 2010: Robot Soccer World Cup XIV. Volume 6556 of Lecture Notes in Computer Science., Springer (2011).
  9. https://link.springer.com/chapter/10.1007/978-3-662-44468-9_46
  10. Namira TPAS, Tournament Planning and Analyzing Software for Soccer Simulation 2D, Namira Team, Shiraz University, Iran. https://github.com/Farzin-Negahbani/Namira_TPAS
  11. E.Asali, M.Valipour, N.Zare, A.Afshar, M.R.Katebzadeh, GH. Dastghaibyfard, Using Machine Learning approaches to detect opponent formation, Artificial Intelligence and Robotics (IRANOPEN), 2016.