Table of Contents
Abstract
In the FerSML (Footballer and Football Simulation Markup Language) project, at first our interest was only to develop a simulation based decision making support expert system for professional football (soccer). But of course such a development is not possible without supporting the real football teams and using suitable analytical tools to observe players of these cooperative teams. The organisation of this work is already under way in the framework of an industrial research and development project.
Our motivation comes from our former experience in mobile soccer gaming [FERSML] then we have concentrated only on the football played in reality. At that time, using the robocup simulation environment hadn't even occurred to us, because the robot soccer is purely artificial intelligence. And because in our case, in contrast a player or in the FerSML's terminology an avatar was considered to be a given and finished entity as a complete and perfect footballer in the simulation, accordingly we didn't want to build the abstraction of the players from scratch and step by step to develop their cognitive skills required for playing football. For example, to illustrate our approach, in the FerSML simulations a player knows its own position with any degree of accuracy. The avatars are (trivially) fully aware of the meaning of the position of themselves and of all other players or the parts of the field of play. By contrast, in RCSS simulations an agent has to build positioning information for itself.
But meanwhile, waiting for the start of the mentioned research and development project, the question arose whether RCSS tools may be applied to sport science purposes of FerSML platform, or more exactly, whether the rcssserver could possibly be used for support the FerSML simulations. However, even in that case, the classical RCSS client agents would not be required because the rcssserver would be modified in order to enable working with clients defined at a higher abstraction level. That is, for example, the FerSML clients would be able to access the all data of the rcssserver directly and they could communicate with each other without any restrictions during simulation. At this moment, the usage of RCSS software tools for purposes of the FerSML project is an open question.
In this case study we investigate the possibility of modifying RCSS protocol to be able to be used for sport scientific purposes [SRCSS].
We introduce a new client command (pos X Y
power) to control the agents. Here (X, Y) is the position
on the field where the player will move. The
parameter power is the same as the parameter of
the original (dash power) command. With this
lucky choice therefore the implementation of the new
pos command may be built on the implementation of
the dash command.
For testing we modify the team called
Debreceni Hivatásos FC++. The newly added
beforeKickOffwithPos function will be called
from the control POSIX thread:
static void * prog1Thread(void *
client) { Client * thisclient = (Client *) client; char buf[1024];
usleep(100*1000); for (;;) { usleep(100*1000); switch
(thisclient->bl.get_play_mode()) { case before_kick_off:
beforeKickOff(thisclient); break; case play_on: case kick_off_l:
case kick_off_r: //playOn(thisclient);
beforeKickOffwithPos(thisclient); break; } } // for (;;) return 0;
}The beforeKickOffwithPos defines a
line-up and the players will move towards the positions defined in
this line-up.
static void
beforeKickOffwithPos(Client * thisclient) { char buf[1024]; //
középkezdési felállás static int formation[][2] = { // Goalie,
kapus {-51, 0}, // Attackers, támadók {-4, 10}, {-1, 1}, {-3,
-11}, // Midfielders, középpályások {-18, -16}, {-17, 2}, {-18,
17}, // Defenders, védők {-35, -19}, {-33, -10}, {-34, 12}, {-35,
24} }; int squad_number = thisclient->bl.get_squad_number() -1;
std::snprintf(buf, 64, "(pos %d %d 40)\0",
formation[squad_number][0], formation[squad_number][1]);
thisclient->sndCmd(buf);In parallel we modified the original
beforeKickOff line-up in order to allow
easier interpretation: now players stand in a line.
static void beforeKickOff(Client *
thisclient) { char buf[1024]; // középkezdési felállás static int
formation[][2] = { // Goalie, kapus {-10, 0}, // Attackers,
támadók {-12, 0}, {-14, 0}, {-16, 0}, // Midfielders,
középpályások {-18, 0}, {-20, 0}, {-22, 0}, // Defenders, védők
{-24, 0}, {-26, 0}, {-28, 0}, {-30, 0} }; // minden játékos a
saját pozíciójába a középkezdéskor int squad_number =
thisclient->bl.get_squad_number() -1; std::snprintf(buf, 64,
"(move %d %d)\0", formation[squad_number][0],
formation[squad_number][1]);
thisclient->sndCmd(buf);In the source code of rcssserver, the newly introduced pos command is developed by using the existing implementation of dash command. First, we simply calculate the angle of target position then the agent will be dashed to the calculated direction. Making this modification on the server side will not affect the existing client agents because the pos command will be received by the server. However, we have weaved the agent position into the server's response. In most cases it does not cause any problems, but to be on the safe side, this behavior can be switched on using the server's command line argument rcssserver server::light_response=true and it is switched off in default:
[norbert@matrica rcssserver-15.1.0.light1]$ src/rcssserver
rcssserver-15.1.0.light1 Copyright (C) 1995, 1996, 1997, 1998,
1999 Electrotechnical Laboratory. 2000 - 2012 RoboCup Soccer
Simulator Maintenance Group. Simulator Random Seed: 1341319832
CSVSaver: Ready STDOutSaver: Ready Using simulator's random seed
as Hetero Player Seed: 1341319832 wind factor: rand: 0.000000,
vector: (0.000000, 0.000000) Hit CTRL-C to exit Light response:
falseThe continuous movement of the players is well observed in the video playback at URL http://youtu.be/ZoANLujlt1A, (
)
http://www.inf.unideb.hu/~nbatfai/rcssserver-15.1.0.light4.tar.bz2.
We have already mentioned that modified server's response
can be switched on or switched off by using the
server::light_response parameter. If it is set
to true then sendLight function will print
the agent's own position to the beginning of the
see command. This function is a newly added one
to src/visualsenderplayer.cpp source in the
rcssserver's package.
// light if
(ServerParam::instance().lightResponse()) sendLight();
sendFlags(); sendBalls(); sendPlayers(); sendLines();
serializer().serializeVisualEnd( transport() ); transport()
<< std::ends << std::flush; } void
VisualSenderPlayerV1::sendLight() {
serializer().serializeVisualObject( transport(), "light",
self().pos().x, self().pos().y); }Now let's see how the see sent to clients looks.
(see 667 (light -35.0361 -19.0086) ((f c) 40 28) ((f c t)
38.1 -23) ((f r t) 89.1 -10) ((f r b) 102.5 31) ((f g r b) 90.9
17) ((g r) 90 12) ((f g r t) 88.2 8) ((f p r b) 81.5 29) ((f p r
c) 73.7 15) ((f p r t) 70.8 -1) ((F) 1.5 -130) ((f t 0) 40.4 -30)
((f t r 10) 49.4 -24) ((f t r 20) 58.6 -20) ((f t r 30) 68 -17)
((f t r 40) 77.5 -15) ((f t r 50) 87.4 -13) ((f t l 10) 32.1 -39 0
0.1) ((f b r 30) 87.4 42) ((f b r 40) 94.6 38) ((f b r 50) 102.5
34) ((f r 0) 94.6 12) ((f r t 10) 92.8 6) ((f r t 20) 92.8 -1) ((f
r t 30) 92.8 -7) ((f r b 10) 96.5 17) ((f r b 20) 100.5 23) ((f r
b 30) 104.6 28) ((b) 40.4 28) ((p "LightFC++") 40.4 43) ((p
"LightFC++") 40.4 30) ((p "LightFC++") 33.1 14) ((p "LightFC++" 5)
18.2 10 0 0 0 0) ((l r) 87.4 90))