Titans of Robotics Soccer Simulation 2D
Alexandre F. Costa, Giovany F. Teixeira, Maykel Rodrigues
Federal Institute of Espírito Santo, Colatina, Brazil
http://pt.sourceforge.jp/projects/rctools/downloads/51943/agent2d-3.1.0.tar.gz/ · https://bitbucket.org/team_asimov/asimov/wiki/Home · http://pt.sourceforge.jp/projects/rctools/downloads/51941/librcsc-4.1.0.tar.gz/ · http://pt.sourceforge.jp/projects/rctools/downloads/51942/soccerwindow2-5.1.0.tar.gz/ · http://pt.sourceforge.jp/projects/rctools/downloads/48791/fedit2-0.0.0.tar.gz/
Abstract This document describes the core of the Soccer 2D team code of the Titans of Robotics team. Titans of Robotics is a a robotics team from the Federal Institute of Espírito Santo (Brazil). In this year, we have sought the evolution of the team through the implementation of heuristic techniques for the selection of players and to define team behavior. The main goal of this document is to describe the team development while presenting the methods and technologies which were applied, as well as the results from past competitions.
1 Introductions
The Robotics Team of the Federal Institute of Espírito Santo – Campus Colatina was created in 2015 under the name Asimov, competing in the SEK category. In 2016 it started to compete in the Soccer 2D, Practical OBR and Theoretical OBR. In 2018 the team was renamed to Titans of Robotics (Titãs da Robótica, in portuguese).
In 2016 the team started competing in the 2D Soccer category at the initiative of the students of the Information Systems course. The main goal of the students was to apply the knowledge acquired during the classes in the development of the robots. Programming techniques, game observation, code study and application of conventional soccer techniques were applied in order to improve accuracy in kicking, passing, tight marking, choice of the best moves and other characteristics of the team.
In October 2016, the team competed for the first time in the Latin American Robotics Championship - LARC, and won the first place, beating in the final match the team that has won the three previous editions of the competition. The Titans of Robotics team maintained the results in 2017 and 2018, becoming the new three-time champion of the competition.
The team code is based on Agent2D [1], and all the development effort was focused on improving mechanisms already present in the structure of Agent2D. Additionally, many ideas were inspired by the work of other teams, especially MarliK [2] and HELIOS [3]. Besides developing the code to participate in the competitions, aiming to support the development of the community the team has created a wiki [4] in Portuguese to help new teams.
This paper describes the main characteristics of the developed code.
2 Methodology
We have used the Agent2D framework version 3.1.1 [1] - available for free - as a basis for the development of this project. It was chosen for having achieved excellent results both in the last editions of the RoboCup Soccer Simulation 2D world championship and in tests carried out in related works.
Agent2D is a standard team, implementing basic moves and actions, without the implementation of any advanced control logic. The basic structure provided by it allows starting the development of new methods and characteristics, as needed, considering the opponents in each competition.
From the base team, the players' behaviors are modified in order to improve the team performance and strategy. The base team is capable of organizing in the field, kicking the ball, making passes, marking the opponent, dribbling, among other actions. However, most of these functions require changes to make it more competitive. Therefore, the base team was used as a start point for the development.
3 Development
3.1 Players Selection
An important task reserved for the coach is to define the line-up of the heterogeneous types of team players. The concept of heterogeneous players was introduced in the simulation league in 2001, aiming to stimulate research in several areas but focusing on the dynamic resources allocation.
Each player has physical abilities distinct from standard players such as speed, acceleration and recovery. These characteristics are used as a basis for defining the commitments that will ensure that, although heterogeneous types have better physical characteristics than the standard type, others will be worse. Four commitments are defined [6]:
- acceleration X recovery rate of stamina;
- ball reach size X accuracy of kick;
- velocity X ability to rotate body;
- extra stamina rate X extra stamina rate.
As previously explained, it is up to the coach to decide which heterogeneous type fits best for each player. Since for each game a new group of heterogeneous players is generated, one great challenge of this approach is to create a routine that can adapt the team to any random set of players.
Having this in mind, the work was divided into two stages: analysis and definition of the characteristics that should be prioritized in each player, and finally, the heuristics for players selection were implemented.
For the accomplishment of the first part of the work the Regression Analysis method was used. The Regression Analysis [7] makes it possible to find a reasonable relation between the input and output variables, through empirical relations. To express this relation it is very important to establish a mathematical model. The use of this approach requires to collect data and to apply statistical methods of Linear Regression Analysis over the collected data. The data collection allows to know the nature of the relationship between the variables and to carry out studies in order to accommodate unexpected situations.
In order to identify which variables influence the performance of the players and consequently of the team, we have analyzed nine attributes (playerDecay, inertiaMoment, dashPowerRate, staminaIncMax, kickableMargin, kickRand, extraStamina, effortMax, effortMin) for each player, as well as the final score of the match.
These data were saved in a file and later analyzed using the statistical methods of Linear Regression Analysis. At the end of the process, coefficients were generated for each attribute of each player.
Once the coefficients values are defined, it is necessary to make the selection of the players based on them. As previously said, for each match a new group of heterogeneous players is generated, so a method that obtains the result that is closest to the optimal location is needed. The objective function for player selection is given by:
$$\sum_{i=1}^{11} x_i \ y_i$$
Where xi is the weight of player i, and yi is the constant of the player's weight of position i, statistically obtained. Initially, a permutation method was applied over the 11 players trying to find the combination with the best value for the objective function. But, applying this strategy, the processing time exceeded the beginning of the match, and the players were randomly chosen. To overcome this problem a heuristic was implemented using Genetic Algorithm.
The Genetic Algorithm (GA) is a search technique used in computer science to find approximate solutions to optimization and search problems. GAs are implemented as a computer simulation in which a population of abstract solution representations is selected aiming to find better solutions. The evolution usually starts from a set of solutions randomly created and is carried out through generations. Within each generation, the adaptation of each solution in the population is evaluated, some individuals are selected for the next generation, and recombined or mutated to form a new population. The new population is then used as input to the next iteration of the algorithm.
At the end of the player selection process, it is expected to get a selection of 11 heterogeneous players that best fits each specific position of the team. Tests performed after the implementation of the player selection method showed a significant increase in the number of wins, 14%. This is a good indication that the selection method is efficient. Tables 1 and 2 present the results obtained before and after the use of the players selection method.
Table 1. Performance before players selection method
| - | Vitórias | Derrotas | Empates |
|---|---|---|---|
| Agent2D | 642 | 138 | 220 |
| Cyrus | 251 | 257 | 492 |
| Robotbulls | 377 | 349 | 274 |
| ITAndroids | 305 | 312 | 383 |
| Allejos | 411 | 279 | 310 |
Table 2. Performance after players selection method
| - | Vitórias | Derrotas | Empates |
|---|---|---|---|
| Agent2D | 707 | 108 | 185 |
| Cyrus | 302 | 231 | 467 |
| Robotbulls | 445 | 321 | 234 |
| ITAndroids | 330 | 302 | 368 |
| Allejos | 461 | 256 | 283 |
3.2 Server Document
The server is a system that allows multiple teams to compete in a soccer game. Since the startup is performed in a client-server style, there are no restrictions on how teams are built. The only requirement is that the tools used to develop the team must support client-server communication via UDP / IP. This is due to the fact that all communication between the server and each client is done through UDP / IP sockets. Each client is a separate process and connects to the server through a specified port. After a player connects to the server, all messages are transferred through this port. A team can have up to 12 clients, i.e. 11 players (10 fielders + 1 goalie) and a coach. Players send requests to the server for actions they want to perform (for example, kicking, spinning, running, etc.). The server receives these messages, handles the requests, and updates the environment accordingly.
3.2.1 Sensor Models
A RoboCup agent has three sensors. The hearing sensor detects messages sent by the referee, coaches, and other players. The visual sensor detects visual information about the field, such as the distance and direction of objects in the player's current field of view. The visual sensor also functions as a proximity sensor to "see" objects that are close but behind the player. The body sensor detects the current physical status of the player, such as its resistance, velocity and angle of the neck. All together, the sensors give the agent a good image of the environment.
4 Conclusions and Final Considerations
The Titans of Robotics team started working on Soccer 2D in 2016 and has achivied great results in competitions. Besides the conquers in competitions, the work has allowed the team members to apply in practice the knowledge learned in classes. This fact has motivated many students and teachers to join the team.
This will be the first time the team attends the 2D Soccer competition at ROBOCUP. We hope to achieve good results in this competition, however these results should be only consequences of the dedication and effort of students and teachers. We hope our participation in the competition motivate, stimulate and involve the students making all the training itself much more complete and effective.
5 Acknowledgment
We thank the RoboCup community for sharing their codes and ideas. Especially, our recognition to Hidehisa Akiyama for providing the software agent2d [1], librcsc [9], soccerwindow2 [10] and fedit2 [11].
Our grateful also to the Informatics Department of IFES - Campus Colatina for the support, specially the coordinators and teachers for the support and motivation to this project.
References
- Agent2d-3.1.1, 2012, online, disponível em: http://pt.sourceforge.jp/projects/rctools/downloads/51943/agent2d-3.1.0.tar.gz/, acesso em Fevereiro de 2016.
- Tavafi, Armir; Vatani, Reza; Yousefi, Mani Rad; Rahmatinia, Sepideh; Pirdeyr, Pooyan. MarliK 2011 Soccer 2D Simulation Team Description Paper.
- Akiyama, H., Shimora, H.: HELIOS2010 Team Description 2010.
- Wiki Asimov, 2016, online, disponível em: https://bitbucket.org/team_asimov/asimov/wiki/Home, acesso em Fevereiro de 2017.
- Michalewicz, Z.: Genetic Algorithms + Data Structures = Evolution Programs. 3rd edn. Springer-Verlag, Berlin Heidelberg New York (1996)
- Reis, L. P. (2003). Coordenação em sistemas multi-agente: Aplicações na gestão universitária e futebol robótico. Master's thesis, Faculdade de Engenharia da Universidade do Porto.
- Douglas C. Montgomery and Elizabeth A. Peck (1992) Introduction to Linear Regression Analysis, 2nd ed., John Wiley and Sons, Inc., New York.
- Linden, Ricardo; "Algoritmos Genéticos" 2 ed. Rio de Janeiro Brasport, 2008.
- librcsc-4.1.0, 2011, online, disponível em: http://pt.sourceforge.jp/projects/rctools/downloads/51941/librcsc- 4.1.0.tar.gz/, acesso em Fevereiro de 2016.
- soccerwindow2-5.1.0, 2011, online, disponível em: http://pt.sourceforge.jp/projects/rctools/downloads/51942/soccerwindow2-5.1.0.tar.gz/, acesso em Fevereiro de 2016.
- fedit2-0.0.0, 2010, online, disponível em: http://pt.sourceforge.jp/projects/rctools/downloads/48791/fedit2-0.0.0.tar.gz/, acesso em Fevereiro de 2016.
- Zare, Nader. Cyrus 2D Simulation Team Description Paper 2018.
- Reis, Lucas. Robotbulls 2D Simulation Team Description Paper 2017.
- Ferreira, Rafael Martins dos Santos; Martins, François de Souza. Team Description Paper / Equipe PMEC Allejos LARC/CBR 2017.