Users Manual/Soccer Server
From sserver
Contents |
Objects
Protocols
Player Command Protocol
Connecting, reconnecting, and disconnecting
| From player to server | From server to player |
|---|---|
| (init TeamName [(version VerNum)] [(goalie)]) TeamName ::= (-|_|a-z|A-Z|0-9)+ | (init Side Unum PlayMode) Side ::= l | r (error connection_failed) |
| (reconnect TeamName Unum) TeamName ::= (-|_|a-z|A-Z|0-9)+ | (reconnect Side PlayMode) Side ::= l | r (error connection_failed) |
| (bye) |
If your client connects or reconnects successfully with a protocol version > 7.0, the server will additionally send following messages: a message containing the server parameters, a message containing the player parameters and a message containing the player types. The format is given below. Finally, the player will receive a message on changed players (see Sec. #sec:heterogeneousplayers).
- Protocol version 7
- (server_param gwidth inertia_moment psize pdecay prand pweight pspeed_max paccel_max stamina_max stamina_inc recover_init recover_dthr recover_min recover_dec effort_init effort_dthr effort_min effort_dec effort_ithr effort_inc kick_rand team_actuator_noise prand_factor_l prand_factor_r kick_rand_factor_l kick_rand_factor_r bsize bdecay brand bweight bspeed_max baccel_max dprate kprate kmargin ctlradius ctlradius_width maxp minp maxm minm maxnm minnm maxn minn visangle visdist windir winforce winang winrand \-kickable_area catch_area_l catch_area_w catch_prob goalie_max_moves ckmargin offside_area win_no win_random say_cnt_max SayCoachMsgSize clang_win_size clang_define_win clang_meta_win clang_advice_win clang_info_win clang_mess_delay clang_mess_per_cycle half_time sim_st send_st recv_st sb_step lcm_st SayMsgSize hear_max hear_inc hear_decay cban_cycle slow_down_factor useoffside kickoffoffside offside_kick_margin audio_dist dist_qstep land_qstep dir_qstep dist_qstep_l dist_qstep_r land_qstep_l land_qstep_r dir_qstep_l dir_qstep_r CoachMode CwRMode old_hear sv_st start_goal_l start_goal_r fullstate_l fullstate_r drop_time)
- (player_param player_types subs_max pt_max player_speed_max_delta_min player_speed_max_delta_max stamina_inc_max_delta_factor player_decay_delta_min player_decay_delta_max inertia_moment_delta_factor dash_power_rate_delta_min dash_power_rate_delta_max player_size_delta_factor kickable_margin_delta_min kickable_margin_delta_max kick_rand_delta_factor extra_stamina_delta_min extra_stamina_delta_max effort_max_delta_factor effort_min_delta_factor)
- for each available player type a message of the form
(player_type id player_speed_max stamina_inc_max player_decay inertia_moment dash_power_rate player_size kickable_margin kick_rand extra_stamina effort_max effort_min)
- Protocol version 8 or later
- (server_param (ParameterName ParameterValue)*)
- (player_param (ParameterName ParameterValue)*)
Player Settings
| From player to server | From server to player |
|---|---|
| (clang (ver MinVersion MaxVersion)) MinVersion ::= positive integer Note: in practice, MinVersion or MaxVersion have to be 7 or 8. | (ok clang (ver MinVersion MaxVersion) (error illegal_command_form) |
| (compresssion Level) Level ::= negative integer | 0 ~ 9 | (ok compression Level) (warning compression_unsupported) |
| (ear ({on|off} [l|r|our|opp|TeamName] [partial|complete])) TeamName ::= string | Note: if successful, no return message. (error no team with name TeamName) |
| (synch_see) Note: synch_see command can be used only once for each player. | (ok synch_see) (error illegal_command_form) |
Player Control
| From player to server | Only once per cycle |
|---|---|
| (attentionto Side Number) (attentionto off) | No |
| (catch Direction) Direction ::= minmoment ~ maxmoment degrees | Yes |
| (change_view Width Quality) Width ::= narrow | normal | wide | No |
| (dash Power Direction) (dash Power) | Yes |
| (kick Power Direction) Power ::= minpower ~ maxpower | Yes |
| (move X Y) X ::= any real number | Yes |
| (pointto Distance Direction) (pointto off) | No |
| (say "Message") (say Message) | No |
| (sense_body) The server returns a sense_body message. | No |
| (score) The server returns | No |
| (tackle Direction[ Foul]) : if client version is 12 or later (tackle Power[ Foul]) : otherwise | Yes |
| (turn Moment) Moment ::= minmoment ~ maxmoment degrees | Yes |
| (turn_neck Angle) Angle ::= minneckmoment ~ maxneckmoment degrees | Yes |
The server may respond to the above commands with the errors:
(error unknown_command)
(error illegal_command_form)
Player Sensor Protocol
Aural Sensor Message
| Client protocol version | From server to player |
|---|---|
| Version 1~6 | (hear Time referee Message) (hear Time Sender Message) Sender ::= online_coach_left | online_coach_right | self | Direction |
| Version 7 (Double quoted) | (hear Time referee Message) (hear Time Sender "Message") Sender ::= online_coach_left | online_coach_right | coach | self | Direction |
| Version 8 or later | (hear Time referee Message) (hear Time Sender "Message") Sender ::= online_coach_left | online_coach_right | coach | self |
|
Time ::= simulation cycle of the soccerserver | |
Body Sensor Message
| Client protocol version | From server to player |
|---|---|
| Version 1-4 | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| version 5 (Added head angle and turn_neck count) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 6 (Added velocity direction) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 7 (Added extra counts) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 8 (Added arm, focus and tackle detailes) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 12 (Added collision information) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 13 (Added stamina capacity) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Version 13 or later (Added foul information) | (sense_body Time (view_mode {high | low} {narrow | normal | high}) |
| Time ::= simulation cycle of the soccerserver Stamina ::= positive real number | |
Visual Sensor Message
| From server to player |
|---|
| (see Time ObjInfo*) Time ::= simulation cycle of the soccerserver |
| Client protocl version | Object information | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Protocol version 1~3: |
| ||||||||||||||||||||||||||||||||||||
| Protocol version 4 (Added body directions of players) |
| ||||||||||||||||||||||||||||||||||||
| Protocol version 5 (Added head directions of players) |
| ||||||||||||||||||||||||||||||||||||
| Protocol version 6 (Shortened names for all objects) |
| ||||||||||||||||||||||||||||||||||||
| Protocol version 7 | This version fixed a bug in the generation of directions in that they were truncated to int, rather than rounded. This meant error in the direction pointed was at most times between -0.5 and +0.5 degrees, but occationally between -1.0 and +1.0 degrees and at other times exact. With the new method of rounding, the error is always between -0.5 and +0.5. | ||||||||||||||||||||||||||||||||||||
| Protocol version 8~12 (Added arm and tackle information) |
| ||||||||||||||||||||||||||||||||||||
| Protocol version 13 or later (Added kick information) |
| ||||||||||||||||||||||||||||||||||||
|
Distance ::= positive real number | |||||||||||||||||||||||||||||||||||||
Fullstate Sensor Message
| Client protocl version | From server to client |
|---|---|
| Protocol version 1~4 | No actual information is sent in these versions as the protocol did not exist until version 5. |
| Protocol version 5~7 | (fullstate Time (pmode PlayMode) Player ::= ({l|r}_UniformNumber |
| Protocol version 8~12 (Added self information, Changed object names, Changed score order) | (fullstate Time (pmode PlayMode) Player ::= ((p {l|r} UniformNumber {g|PlayerType}) |
| Protocol version 13 (Added stamina capacity and players' state) | (fullstate Time (pmode PlayMode) Player ::= ((p {l|r} UniformNumber {g|PlayerType}) |
| Protocol version 14 or later (Added foul information. Heterogeneous player type id is always informed.) | (fullstate Time (pmode PlayMode) Player ::= ((p {l|r} UniformNumber [g] PlayerType}) |
|
PlayMode ::= one of the play modes | goalie_catch_ball_l | goalie_catch_ball_r | |
Sensor Models
Aural Sensor Model
Aural sensor messages are sent when a client or a coach sends a say command. The calls from the referee is also received as aural messages. All referee's messages are received immediately. If the client version is 8 or later, messages from players are received at the beginning of next cycle(just after sense_body message). Otherwise, all messages are received immediately.
The format of the aural sensor message from the soccer server is: (hear Time Sender "Message")}
- Time indicates the current time.
- Sender is the relative direction to the sender if it is another player, otherwise it is one of the following:
- self: when the sender is yourself.
- referee: when the sender is the referee.
- online_coach_left or online_coach_right: when the sender is one of the online coaches.
- Message is the message. The maximum length is say_msg_size bytes. The possible messages from the referee are described in playmodes section.
The server parameters that affects the aural sensor are described in the following table:
| Parameter in server.conf | Value |
|---|---|
| audio_cut_dist | 50.0 |
| hear_max | 1 |
| hear_inc | 1 |
| hear_decay | 1 |
| say_msg_size | 10 |
Capacity of the Aural Sensor
A player can only hear a message if the player's hear capacity is at least hear_decay, since the hear capacity of the player is decreased by that number when a message is heard. Every cycle the hear capacity is increased with hear_inc. The maximum hear capacity is hear_max. To avoid a team from making the other team's communication useless by overloading the channel the players have separate hear capacities for each team. With the current server.conf file this means that a player can hear at most one message from each team every second simulation cycle.
If more messages arrive at the same time than the player can hear the messages actually heard are undefined. (The current implementation choose the messages according to the order of arrival.) This rule does not include messages from the referee, or messages from oneself. In other words, a player can say a message and hear a message from another player in the same timestep.
Range of Communication
A message said by a player is transmitted only to players within audio_cut_dist meters from that player. For example, a defender, who may be near his own goal, can hear a message from his goal-keeper but a striker who is near the opponent goal can not hear the message. Messages from the referee can be heard by all players.
Vision Sensor Model
The visual sensor reports the objects currently seen by the player. If asynchronous visual sensor mode is on (player never use synch_see command), the visual information is automatically sent to the player every send_step, currently 150, milli-seconds.
Visual information arrives from the server in the following basic format:
(see ObjName Distance Direction DistChng DirChng BodyDir HeadDir PointDir [t|k])
where
ObjName ::= (p "Teamname" UniformNumber [goalie])
| (g {l|r})
| (b)
| (f c)
| (f {l | c | r] [t | b})
| (f p {l | r} {t | c | b})
| (f g {l | r} {t | b})
| (f {l | r | t | b} 0)
| (f {t | b} {l | r} {10 | 20 | 30 | 40 | 50})
| (f {l | r} {t | b} {10 | 20 | 30})
| (l {l | r | t | b})}
Distance, Direction, DistChng and DirChng are calculated in the following way:
where (pxt,pyt) is the absolute position of the target object, (pxo,pyo) is the absolute position of the sensing player, (vxt,vyt) is the absolute velocity of the target object, (vxo,vyo) is the absolute velocity of the sensing player, and ao is the absolute direction the sensing player is facing. The absolute facing direction of a player is the sum of the BodyDir and the HeadDir of that player. In addition to it, (prx,pry) and (vrx,vry) are respectively the relative position and the relative velocity of the target, and (erx,ery) is the unit vector that is parallel to the vector of the relative position. BodyDir and HeadDir are only included if the observed object is a player, and is the body and head directions of the observed player relative to the body and head directions of the observing player. Thus, if both players have their bodies turned in the same direction, then BodyDir would be 0. The same goes for HeadDir.
The (goal r) object is interpreted as the center of the right hand side goalline. {(f c) is a virtual flag at the center of the field. (f l b) is the flag at the lower left of the field. (f p l b) is a virtual flag at the lower right corner of the penalty box on the left side of the field. (f g l b) is a virtual flag marking the right goalpost on the left goal. The remaining types of flags are all located 5 meters outside the playing field. For example, (f t l 20) is 5 meters from the top sideline and 20 meters left from the center line. In the same way, (f r b 10) is 5 meters right of the right sideline and 10 meters below the center of the right goal. Also, (f b 0) is 5 meters below the midpoint of the bottom sideline.
In the case of (l ...), Distance is the distance to the point where the center line of the player's view crosses the line, and Direction is the direction of the line.
Currently there are 55 flags (the goals counts as flags) and 4 lines to be seen. All of the flags and lines are shown in the following figure.
Range of View
The visible sector of a player is dependant on several factors. First of all we have the server parameters send_step and visible_angle which determines the basic time step between visual information and how many degrees the player's normal view cone is. The current default values are 150 milli-seconds and 90 degrees.
The player can also influence the frequency and quality of the information by changing ViewWidth and ViewQuality.
To calculate the current ViewFrequency and ViewAngle of the agent use following equations:
ViewVrequency = send_step * ViewQualityFactor * ViewWidthFactor
where ViewQualityFactor is 1 if ViewQuality is high and 0.5 if ViewQuality is low. ViewWidthFactor is 2 if ViewWidth is narrow, 1 if ViewWidth is normal, and 0.5 if ViewWidth is wide.
ViewAngle = visible_angle * ViewWidthFactor
where ViewWidthFactor is 0.5 if ViewWidth is narrow, 1 if ViewWidth is normal, and 2 if ViewWidth is wide.
The player can also see an object if it's within visible_distance meters of the player. If the objects is within this distance but not in the view cone then the player can know only the type of the object (ball, player, goal or flag), but not the exact name of the object. Moreover, in this case, the capitalized name, that is B, P, G and F, is used as the name of the object rather than b, p, g and f.
Body Sensor Model
Movement Model
Movement Noise Model
Collision Model
Action Models
Dash Model (incl. stamina model)
Turn Model
Kick Model
Tackle Model
Catch Model
Move Model
TurnNeck Model
Pointto Model
Say Model
Attentionto Model
Heterogeneous Players
