You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* RpcVector2D represents a 2D vector with additional properties.
19
+
* If you want to have access to geometric operations, you can use Vector2D class in [pyrusgeom package](https://github.com/Cyrus2D/PyrusGeom)
20
+
* To use this class, you need to install pyrusgeom package, import Vector2D class and create a Vector2D object with x and y values.
21
+
*/
17
22
messageRpcVector2D {
18
-
floatx=1;
19
-
floaty=2;
20
-
floatdist=3;
21
-
floatangle=4;
23
+
floatx=1;// The x-coordinate of the vector.
24
+
floaty=2;// The y-coordinate of the vector.
25
+
floatdist=3;// The distance magnitude of the vector.
26
+
floatangle=4;// The angle of the vector in degrees. In soccer simulation 2D environment, the 0 degree is opponent's goal, and the angle increases in the counter-clock direction. So, if your team is in left side, -90 degree is up, 0 degree is right (opponent gole), 90 degree is down.
22
27
}
23
28
29
+
/**
30
+
* RegisterRequest is the message that the client sends to the server to register itself.
31
+
* The client should send this message to the server to register itself.
32
+
* The server will respond with a RegisterResponse message.
33
+
*/
24
34
messageRegisterRequest {
25
-
AgentTypeagent_type=1;
26
-
stringteam_name=2;
27
-
int32uniform_number=3;
28
-
int32rpc_version=4;
35
+
AgentTypeagent_type=1;// The type of the agent. It can be PlayerT, CoachT, or TrainerT.
36
+
stringteam_name=2;// The name of the team that the agent belongs to.
37
+
int32uniform_number=3;// The uniform number of the agent.
38
+
int32rpc_version=4;// The version of the RPC protocol that the client supports.
29
39
}
30
40
31
41
enumRpcServerLanguageType {
@@ -39,32 +49,40 @@ enum RpcServerLanguageType {
39
49
GO=7;
40
50
}
41
51
52
+
/**
53
+
* RegisterResponse is the message that the server sends to the client in response to a RegisterRequest message.
54
+
* The server will respond with this message after receiving a RegisterRequest message.
55
+
* The client should use the information in this message to identify itself to the server.
56
+
*/
42
57
messageRegisterResponse {
43
-
int32client_id=1;
44
-
AgentTypeagent_type=2;
45
-
stringteam_name=3;
46
-
int32uniform_number=4;
47
-
RpcServerLanguageTyperpc_server_language_type=5;
58
+
int32client_id=1;// The unique identifier assigned to the client by the server.
59
+
AgentTypeagent_type=2;// The type of the agent. It can be PlayerT, CoachT, or TrainerT.
60
+
stringteam_name=3;// The name of the team that the agent belongs to.
61
+
int32uniform_number=4;// The uniform number of the agent.
62
+
RpcServerLanguageTyperpc_server_language_type=5;// The language that the server is implemented in.
48
63
}
49
64
65
+
/**
66
+
* Ball is the message that represents the ball in the soccer simulation.
67
+
*/
50
68
messageBall {
51
-
RpcVector2Dposition=1;
52
-
RpcVector2Drelative_position=2;
53
-
RpcVector2Dseen_position=3;
54
-
RpcVector2Dheard_position=4;
55
-
RpcVector2Dvelocity=5;
56
-
RpcVector2Dseen_velocity=6;
57
-
RpcVector2Dheard_velocity=7;
58
-
int32pos_count=8;
59
-
int32seen_pos_count=9;
60
-
int32heard_pos_count=10;
61
-
int32vel_count=11;
62
-
int32seen_vel_count=12;
63
-
int32heard_vel_count=13;
64
-
int32lost_count=14;
69
+
RpcVector2Dposition=1;// The position of the ball.
70
+
RpcVector2Drelative_position=2;// The relative position of the ball to the agent who is sending the message.
71
+
RpcVector2Dseen_position=3;// The position of the ball that the agent has seen.
72
+
RpcVector2Dheard_position=4;// The position of the ball that the agent has heard.
73
+
RpcVector2Dvelocity=5;// The velocity of the ball.
74
+
RpcVector2Dseen_velocity=6;// The velocity of the ball that the agent has seen.
75
+
RpcVector2Dheard_velocity=7;// The velocity of the ball that the agent has heard.
76
+
int32pos_count=8;// How many cycles ago the agent has seen or heard the ball.
77
+
int32seen_pos_count=9;// How many cycles ago the agent has seen the ball.
78
+
int32heard_pos_count=10;// How many cycles ago the agent has heard the ball.
79
+
int32vel_count=11;// How many cycles ago the agent has seen or heard the velocity of the ball.
80
+
int32seen_vel_count=12;// How many cycles ago the agent has seen the velocity of the ball.
81
+
int32heard_vel_count=13;// How many cycles ago the agent has heard the velocity of the ball.
82
+
int32lost_count=14;// How many cycles ago the agent has lost the ball.
65
83
int32ghost_count=15;
66
-
floatdist_from_self=16;
67
-
floatangle_from_self=17;
84
+
floatdist_from_self=16;// The distance of the ball from the agent who is sending the message.
85
+
floatangle_from_self=17;// The angle of the ball from the agent who is sending the message.
68
86
}
69
87
70
88
enumSide {
@@ -116,37 +134,41 @@ message PenaltyKickState {
116
134
boolis_kick_taker=7;
117
135
}
118
136
137
+
/**
138
+
* Player is the message that represents a player in the soccer simulation.
139
+
* To get type information of the player, you can use the type_id field and player type information.
140
+
*/
119
141
messagePlayer {
120
-
RpcVector2Dposition=1;
121
-
RpcVector2Dseen_position=2;
122
-
RpcVector2Dheard_position=3;
123
-
RpcVector2Dvelocity=4;
124
-
RpcVector2Dseen_velocity=5;
125
-
int32pos_count=6;
126
-
int32seen_pos_count=7;
127
-
int32heard_pos_count=8;
128
-
int32vel_count=9;
129
-
int32seen_vel_count=10;
130
-
int32ghost_count=11;
131
-
floatdist_from_self=12;
132
-
floatangle_from_self=13;
133
-
int32id=14;
134
-
Sideside=15;
135
-
int32uniform_number=16;
136
-
int32uniform_number_count=17;
137
-
boolis_goalie=18;
138
-
floatbody_direction=19;
139
-
int32body_direction_count=20;
140
-
floatface_direction=21;
141
-
int32face_direction_count=22;
142
-
floatpoint_to_direction=23;
143
-
int32point_to_direction_count=24;
144
-
boolis_kicking=25;
145
-
floatdist_from_ball=26;
146
-
floatangle_from_ball=27;
147
-
int32ball_reach_steps=28;
148
-
boolis_tackling=29;
149
-
int32type_id=30;
142
+
RpcVector2Dposition=1;// The position of the player.
143
+
RpcVector2Dseen_position=2;// The position of the player that the agent has seen.
144
+
RpcVector2Dheard_position=3;// The position of the player that the agent has heard.
145
+
RpcVector2Dvelocity=4;// The velocity of the player.
146
+
RpcVector2Dseen_velocity=5;// The velocity of the player that the agent has seen.
147
+
int32pos_count=6;// How many cycles ago the agent has seen or heard the player.
148
+
int32seen_pos_count=7;// How many cycles ago the agent has seen the player.
149
+
int32heard_pos_count=8;// How many cycles ago the agent has heard the player.
150
+
int32vel_count=9;// How many cycles ago the agent has seen or heard the velocity of the player.
151
+
int32seen_vel_count=10;// How many cycles ago the agent has seen the velocity of the player.
152
+
int32ghost_count=11;// How many cycles ago the agent has lost the player.
153
+
floatdist_from_self=12;// The distance of the player from the agent who is sending the message.
154
+
floatangle_from_self=13;// The angle of the player from the agent who is sending the message.
155
+
int32id=14;// The unique identifier of the player.
156
+
Sideside=15;// The side of the player. It can be LEFT or RIGHT or UNKNOWN if the side is not known.
157
+
int32uniform_number=16;// The uniform number of the player.
158
+
int32uniform_number_count=17;// How many cycles ago the agent has seen the uniform number of the player.
159
+
boolis_goalie=18;// Whether the player is a goalie or not.
160
+
floatbody_direction=19;// The body direction of the player.
161
+
int32body_direction_count=20;// How many cycles ago the agent has seen the body direction of the player.
162
+
floatface_direction=21;// The face direction of the player. In soccer simulation 2D, face direction is the direction that the player is looking at.
163
+
int32face_direction_count=22;// How many cycles ago the agent has seen the face direction of the player.
164
+
floatpoint_to_direction=23;// The direction that the player is pointing to.
165
+
int32point_to_direction_count=24;// How many cycles ago the agent has seen the point to direction of the player.
166
+
boolis_kicking=25;// Whether the player is kicking or not.
167
+
floatdist_from_ball=26;// The distance of the player from the ball.
168
+
floatangle_from_ball=27;// The angle of the player from the ball.
169
+
int32ball_reach_steps=28;// How many cycles the player needs to reach the ball.
170
+
boolis_tackling=29;// Whether the player is tackling or not.
171
+
int32type_id=30;// The type identifier of the player.
150
172
}
151
173
152
174
messageSelf {
@@ -1320,29 +1342,39 @@ service Game {
1320
1342
/*
1321
1343
* The Game service provides various RPC methods for interacting with a soccer simulation.
1322
1344
*
1323
-
* Methods:
1324
-
* - GetPlayerActions(State): Retrieves actions available to a player based on the current state.
1325
-
* - GetCoachActions(State): Retrieves actions available to a coach based on the current state.
1326
-
* - GetTrainerActions(State): Retrieves actions available to a trainer based on the current state.
1327
-
* - SendInitMessage(InitMessage): Sends an initialization message to the server.
1328
-
* - SendServerParams(ServerParam): Sends server parameters to the server.
1329
-
* - SendPlayerParams(PlayerParam): Sends player parameters to the server.
1330
-
* - SendPlayerType(PlayerType): Sends player type information to the server. (Note: Should be PlayerTypes)
1331
-
* - Register(RegisterRequest): Registers a new entity and returns a registration response.
1332
-
* - SendByeCommand(RegisterResponse): Sends a bye command to the server.
1333
-
* - GetBestPlannerAction(BestPlannerActionRequest): Retrieves the best planner action based on the request.
1334
-
```mermaid
1335
-
sequenceDiagram
1336
-
participant Alice
1337
-
participant Bob
1338
-
Alice->>John: Hello John, how are you?
1339
-
loop HealthCheck
1340
-
John->>John: Fight against hypochondria
1341
-
end
1342
-
Note right of John: Rational thoughts <br/>prevail!
1343
-
John-->>Alice: Great!
1344
-
John->>Bob: How about you?
1345
-
Bob-->>John: Jolly good!
1345
+
```mermaid
1346
+
sequenceDiagram
1347
+
participant SS as SoccerSimulationServer
1348
+
participant SP as SoccerSimulationProxy
1349
+
participant PM as PlayMakerServer
1350
+
Note over SS,PM: Run
1351
+
SP->>SS: Connect
1352
+
SS->>SP: OK, Unum
1353
+
SS->>SP: ServerParam
1354
+
SS->>SP: PlayerParam
1355
+
SS->>SP: PlayerType (0)
1356
+
SS->>SP: PlayerType (1)
1357
+
SS->>SP: PlayerType (17)
1358
+
SP->>PM: Register(RegisterRequest)
1359
+
PM->>SP: RegisterResponse
1360
+
SP->>PM: SendInitMessage(InitMessage)
1361
+
PM->>SP: Empty
1362
+
SP->>PM: SendServerParams(ServerParam)
1363
+
PM->>SP: Empty
1364
+
SP->>PM: SendPlayerParams(PlayerParam)
1365
+
PM->>SP: Empty
1366
+
SP->>PM: SendPlayerType(PlayerType(0))
1367
+
PM->>SP: Empty
1368
+
SP->>PM: SendPlayerType(PlayerType(1))
1369
+
PM->>SP: Empty
1370
+
SP->>PM: SendPlayerType(PlayerType(17))
1371
+
PM->>SP: Empty
1372
+
SS->>SP: Observation
1373
+
Note over SP: Convert observation to State
1374
+
SP->>PM: GetPlayerActions(State)
1375
+
PM->>SP: PlayerActions
1376
+
Note over SP: Convert Actions to Low-Level Commands
0 commit comments