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
| position |[RpcVector2D](#protos-RpcVector2D)||The position of the player.|
1645
+
| seen_position |[RpcVector2D](#protos-RpcVector2D)||The position of the player that the agent has seen.|
1646
+
| heard_position |[RpcVector2D](#protos-RpcVector2D)||The position of the player that the agent has heard.|
1647
+
| velocity |[RpcVector2D](#protos-RpcVector2D)||The velocity of the player.|
1648
+
| seen_velocity |[RpcVector2D](#protos-RpcVector2D)||The velocity of the player that the agent has seen.|
1649
+
| pos_count |[int32](#int32)||How many cycles ago the agent has seen or heard the player.|
1650
+
| seen_pos_count |[int32](#int32)||How many cycles ago the agent has seen the player.|
1651
+
| heard_pos_count |[int32](#int32)||How many cycles ago the agent has heard the player.|
1652
+
| vel_count |[int32](#int32)||How many cycles ago the agent has seen or heard the velocity of the player.|
1653
+
| seen_vel_count |[int32](#int32)||How many cycles ago the agent has seen the velocity of the player.|
1654
+
| ghost_count |[int32](#int32)||How many cycles ago the agent has lost the player.|
1655
+
| dist_from_self |[float](#float)||The distance of the player from the agent who is sending the message.|
1656
+
| angle_from_self |[float](#float)||The angle of the player from the agent who is sending the message.|
1657
+
| id |[int32](#int32)||The unique identifier of the player.|
1658
+
| side |[Side](#protos-Side)||The side of the player. It can be LEFT or RIGHT or UNKNOWN if the side is not known.|
1659
+
| uniform_number |[int32](#int32)||The uniform number of the player.|
1660
+
| uniform_number_count |[int32](#int32)||How many cycles ago the agent has seen the uniform number of the player.|
1661
+
| is_goalie |[bool](#bool)||Whether the player is a goalie or not.|
1662
+
| body_direction |[float](#float)||The body direction of the player.|
1663
+
| body_direction_count |[int32](#int32)||How many cycles ago the agent has seen the body direction of the player.|
1664
+
| face_direction |[float](#float)||The face direction of the player. In soccer simulation 2D, face direction is the direction that the player is looking at.|
1665
+
| face_direction_count |[int32](#int32)||How many cycles ago the agent has seen the face direction of the player.|
1666
+
| point_to_direction |[float](#float)||The direction that the player is pointing to.|
1667
+
| point_to_direction_count |[int32](#int32)||How many cycles ago the agent has seen the point to direction of the player.|
1668
+
| is_kicking |[bool](#bool)||Whether the player is kicking or not.|
1669
+
| dist_from_ball |[float](#float)||The distance of the player from the ball.|
1670
+
| angle_from_ball |[float](#float)||The angle of the player from the ball.|
1671
+
| ball_reach_steps |[int32](#int32)||How many cycles the player needs to reach the ball.|
1672
+
| is_tackling |[bool](#bool)||Whether the player is tackling or not.|
1673
+
| type_id |[int32](#int32)||The type identifier of the player.|
1673
1674
1674
1675
1675
1676
@@ -1910,15 +1911,17 @@ todo min/max_angle
1910
1911
<aname="protos-RegisterRequest"></a>
1911
1912
1912
1913
### RegisterRequest
1913
-
1914
+
RegisterRequest is the message that the client sends to the server to register itself.
1915
+
The client should send this message to the server to register itself.
1916
+
The server will respond with a RegisterResponse message.
1914
1917
1915
1918
1916
1919
| Field | Type | Label | Description |
1917
1920
| ----- | ---- | ----- | ----------- |
1918
-
| agent_type |[AgentType](#protos-AgentType)|||
1919
-
| team_name |[string](#string)|||
1920
-
| uniform_number |[int32](#int32)|||
1921
-
| rpc_version |[int32](#int32)|||
1921
+
| agent_type |[AgentType](#protos-AgentType)||The type of the agent. It can be PlayerT, CoachT, or TrainerT.|
1922
+
| team_name |[string](#string)||The name of the team that the agent belongs to.|
1923
+
| uniform_number |[int32](#int32)||The uniform number of the agent.|
1924
+
| rpc_version |[int32](#int32)||The version of the RPC protocol that the client supports.|
1922
1925
1923
1926
1924
1927
@@ -1928,16 +1931,18 @@ todo min/max_angle
1928
1931
<aname="protos-RegisterResponse"></a>
1929
1932
1930
1933
### RegisterResponse
1931
-
1934
+
RegisterResponse is the message that the server sends to the client in response to a RegisterRequest message.
1935
+
The server will respond with this message after receiving a RegisterRequest message.
1936
+
The client should use the information in this message to identify itself to the server.
| client_id |[int32](#int32)||The unique identifier assigned to the client by the server.|
1942
+
| agent_type |[AgentType](#protos-AgentType)||The type of the agent. It can be PlayerT, CoachT, or TrainerT.|
1943
+
| team_name |[string](#string)||The name of the team that the agent belongs to.|
1944
+
| uniform_number |[int32](#int32)||The uniform number of the agent.|
1945
+
| rpc_server_language_type |[RpcServerLanguageType](#protos-RpcServerLanguageType)||The language that the server is implemented in.|
1941
1946
1942
1947
1943
1948
@@ -2014,15 +2019,17 @@ todo min/max_angle
2014
2019
<aname="protos-RpcVector2D"></a>
2015
2020
2016
2021
### RpcVector2D
2017
-
2022
+
RpcVector2D represents a 2D vector with additional properties.
2023
+
If you want to have access to geometric operations, you can use Vector2D class in [pyrusgeom package](https://github.com/Cyrus2D/PyrusGeom)
2024
+
To use this class, you need to install pyrusgeom package, import Vector2D class and create a Vector2D object with x and y values.
2018
2025
2019
2026
2020
2027
| Field | Type | Label | Description |
2021
2028
| ----- | ---- | ----- | ----------- |
2022
-
| x |[float](#float)|||
2023
-
| y |[float](#float)|||
2024
-
| dist |[float](#float)|||
2025
-
| angle |[float](#float)|||
2029
+
| x |[float](#float)||The x-coordinate of the vector.|
2030
+
| y |[float](#float)||The y-coordinate of the vector.|
2031
+
| dist |[float](#float)||The distance magnitude of the vector.|
2032
+
| angle |[float](#float)||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.|
2026
2033
2027
2034
2028
2035
@@ -2936,29 +2943,39 @@ For more information, see the documentation at [link](https://link.com).
2936
2943
### Game
2937
2944
The Game service provides various RPC methods for interacting with a soccer simulation.
2938
2945
2939
-
Methods:
2940
-
- GetPlayerActions(State): Retrieves actions available to a player based on the current state.
2941
-
- GetCoachActions(State): Retrieves actions available to a coach based on the current state.
2942
-
- GetTrainerActions(State): Retrieves actions available to a trainer based on the current state.
2943
-
- SendInitMessage(InitMessage): Sends an initialization message to the server.
2944
-
- SendServerParams(ServerParam): Sends server parameters to the server.
2945
-
- SendPlayerParams(PlayerParam): Sends player parameters to the server.
2946
-
- SendPlayerType(PlayerType): Sends player type information to the server. (Note: Should be PlayerTypes)
2947
-
- Register(RegisterRequest): Registers a new entity and returns a registration response.
2948
-
- SendByeCommand(RegisterResponse): Sends a bye command to the server.
2949
-
- GetBestPlannerAction(BestPlannerActionRequest): Retrieves the best planner action based on the request.
2950
2946
```mermaid
2951
2947
sequenceDiagram
2952
-
participant Alice
2953
-
participant Bob
2954
-
Alice->>John: Hello John, how are you?
2955
-
loop HealthCheck
2956
-
John->>John: Fight against hypochondria
2957
-
end
2958
-
Note right of John: Rational thoughts <br/>prevail!
2959
-
John-->>Alice: Great!
2960
-
John->>Bob: How about you?
2961
-
Bob-->>John: Jolly good!
2948
+
participant SS as SoccerSimulationServer
2949
+
participant SP as SoccerSimulationProxy
2950
+
participant PM as PlayMakerServer
2951
+
Note over SS,PM: Run
2952
+
SP->>SS: Connect
2953
+
SS->>SP: OK, Unum
2954
+
SS->>SP: ServerParam
2955
+
SS->>SP: PlayerParam
2956
+
SS->>SP: PlayerType (0)
2957
+
SS->>SP: PlayerType (1)
2958
+
SS->>SP: PlayerType (17)
2959
+
SP->>PM: Register(RegisterRequest)
2960
+
PM->>SP: RegisterResponse
2961
+
SP->>PM: SendInitMessage(InitMessage)
2962
+
PM->>SP: Empty
2963
+
SP->>PM: SendServerParams(ServerParam)
2964
+
PM->>SP: Empty
2965
+
SP->>PM: SendPlayerParams(PlayerParam)
2966
+
PM->>SP: Empty
2967
+
SP->>PM: SendPlayerType(PlayerType(0))
2968
+
PM->>SP: Empty
2969
+
SP->>PM: SendPlayerType(PlayerType(1))
2970
+
PM->>SP: Empty
2971
+
SP->>PM: SendPlayerType(PlayerType(17))
2972
+
PM->>SP: Empty
2973
+
SS->>SP: Observation
2974
+
Note over SP: Convert observation to State
2975
+
SP->>PM: GetPlayerActions(State)
2976
+
PM->>SP: PlayerActions
2977
+
Note over SP: Convert Actions to Low-Level Commands
2978
+
SP->>SS: Commands
2962
2979
```
2963
2980
2964
2981
| Method Name | Request Type | Response Type | Description |
0 commit comments