Skip to content

Commit c3c9a22

Browse files
authored
Merge pull request #14 from CLSFramework/develop
Develop
2 parents 5411e12 + 1b34152 commit c3c9a22

33 files changed

+21251
-12573
lines changed

ChangeLog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# ChangeLog
22

3+
## [1.0.0] - 2024-09-15
4+
5+
### Added
6+
- added rpc_version to the RegisterRequest message.
7+
- added rpc_server_language_type to the RegisterResponse message.
8+
- added server side planner decision maker.
9+
10+
### Fixed
11+
- fixed bugs in the getActions functions in thrift and grpc.
12+
13+
### Changed
14+
- changed chain_action messages name to planner
15+
16+
### Engineers
17+
- [NaderZare](https://github.com/naderzare)
18+
- [SadraKhanjari](https://github.com/SK2iP)
19+
20+
321
## [0.1.4] - 2024-09-03
422

523
### Added

idl/grpc/service.proto

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// version 1
2+
13
syntax = "proto3";
24

35
package protos;
@@ -19,13 +21,26 @@ message RegisterRequest {
1921
AgentType agent_type = 1;
2022
string team_name = 2;
2123
int32 uniform_number = 3;
24+
int32 rpc_version = 4;
25+
}
26+
27+
enum RpcServerLanguageType {
28+
UNKNOWN_LANGUAGE = 0;
29+
PYThON = 1;
30+
JAVA = 2;
31+
CPP = 3;
32+
CSHARP = 4;
33+
RUBY = 5;
34+
JAVE_SCRIPT = 6;
35+
GO = 7;
2236
}
2337

2438
message RegisterResponse {
2539
int32 client_id = 1;
2640
AgentType agent_type = 2;
2741
string team_name = 3;
2842
int32 uniform_number = 4;
43+
RpcServerLanguageType rpc_server_language_type = 5;
2944
}
3045

3146
message Ball {
@@ -81,6 +96,12 @@ enum LoggerLevel{
8196
// LEVEL_ANY = 0xffffffff;
8297
}
8398

99+
enum CardType {
100+
NO_CARD = 0;
101+
YELLOW = 1;
102+
RED = 2;
103+
}
104+
84105
message Player {
85106
RpcVector2D position = 1;
86107
RpcVector2D seen_position = 2;
@@ -151,6 +172,9 @@ message Self {
151172
ViewWidth view_width = 34;
152173
int32 type_id = 35;
153174
float kick_rate = 36;
175+
float recovery = 37;
176+
float stamina_capacity = 38;
177+
CardType card = 39;
154178
}
155179

156180
enum InterceptActionType {
@@ -254,6 +278,10 @@ message WorldModel {
254278
int32 their_team_score = 29;
255279
bool is_penalty_kick_mode = 30;
256280
map<int32, RpcVector2D> helios_home_positions = 31;
281+
double our_defense_line_x = 32;
282+
double their_defense_line_x = 33;
283+
double our_defense_player_line_x = 34;
284+
double their_defense_player_line_x = 35;
257285
}
258286

259287
message State {
@@ -748,7 +776,7 @@ message HeliosGoalieKick {}
748776

749777
message HeliosShoot {}
750778

751-
message HeliosChainAction {
779+
message HeliosOffensivePlanner {
752780
bool direct_pass = 1;
753781
bool lead_pass = 2;
754782
bool through_pass = 3;
@@ -758,6 +786,7 @@ message HeliosChainAction {
758786
bool simple_pass = 7;
759787
bool simple_dribble = 8;
760788
bool simple_shoot = 9;
789+
bool server_side_decision = 10;
761790
}
762791

763792
message HeliosBasicOffensive {}
@@ -830,12 +859,13 @@ message PlayerAction {
830859
HeliosGoalieMove helios_goalie_move = 56;
831860
HeliosGoalieKick helios_goalie_kick = 57;
832861
HeliosShoot helios_shoot = 58;
833-
HeliosChainAction helios_chain_action = 59;
862+
HeliosOffensivePlanner helios_offensive_planner = 59;
834863
HeliosBasicOffensive helios_basic_offensive = 60;
835864
HeliosBasicMove helios_basic_move = 61;
836865
HeliosSetPlay helios_set_play = 62;
837866
HeliosPenalty helios_penalty = 63;
838867
HeliosCommunicaion helios_communication = 64;
868+
839869
}
840870
}
841871

@@ -1202,6 +1232,59 @@ message PlayerType {
12021232
float player_speed_max = 34;
12031233
}
12041234

1235+
enum RpcActionCategory {
1236+
AC_Hold = 0;
1237+
AC_Dribble = 1;
1238+
AC_Pass = 2;
1239+
AC_Shoot = 3;
1240+
AC_Clear = 4;
1241+
AC_Move = 5;
1242+
AC_NoAction = 6;
1243+
}
1244+
message RpcCooperativeAction {
1245+
RpcActionCategory category = 1;
1246+
int32 index = 2;
1247+
int32 sender_unum = 3;
1248+
int32 target_unum = 4;
1249+
RpcVector2D target_point = 5;
1250+
double first_ball_speed = 6;
1251+
double first_turn_moment = 7;
1252+
double first_dash_power = 8;
1253+
double first_dash_angle_relative = 9;
1254+
int32 duration_step = 10;
1255+
int32 kick_count = 11;
1256+
int32 turn_count = 12;
1257+
int32 dash_count = 13;
1258+
bool final_action = 14;
1259+
string description = 15;
1260+
int32 parent_index = 16;
1261+
}
1262+
1263+
message RpcPredictState {
1264+
int32 spend_time = 1;
1265+
int32 ball_holder_unum = 2;
1266+
RpcVector2D ball_position = 3;
1267+
RpcVector2D ball_velocity = 4;
1268+
double our_defense_line_x = 5;
1269+
double our_offense_line_x = 6;
1270+
}
1271+
1272+
message RpcActionState {
1273+
RpcCooperativeAction action = 1;
1274+
RpcPredictState predict_state = 2;
1275+
double evaluation = 3;
1276+
}
1277+
1278+
message BestPlannerActionRequest {
1279+
RegisterResponse register_response = 1;
1280+
map<int32, RpcActionState> pairs = 2;
1281+
State state = 3;
1282+
}
1283+
1284+
message BestPlannerActionResponse {
1285+
int32 index = 1;
1286+
}
1287+
12051288
message Empty {
12061289
}
12071290

@@ -1215,4 +1298,5 @@ service Game {
12151298
rpc SendPlayerType(PlayerType) returns (Empty) {} //should be PlayerTypes
12161299
rpc Register(RegisterRequest) returns (RegisterResponse) {}
12171300
rpc SendByeCommand(RegisterResponse) returns (Empty) {}
1301+
rpc GetBestPlannerAction(BestPlannerActionRequest) returns (BestPlannerActionResponse) {}
12181302
}

idl/thrift/soccer_service.thrift

Lines changed: 91 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// version 1
2+
13
namespace cpp soccer
24
namespace py soccer
35

@@ -23,14 +25,27 @@ struct RpcVector2D {
2325
struct RegisterRequest {
2426
1: AgentType agent_type,
2527
2: string team_name,
26-
3: i32 uniform_number
28+
3: i32 uniform_number,
29+
4: i32 rpc_version
30+
}
31+
32+
enum RpcServerLanguageType {
33+
UNKNOWN_LANGUAGE = 0;
34+
PYThON = 1;
35+
JAVA = 2;
36+
CPP = 3;
37+
CSHARP = 4;
38+
RUBY = 5;
39+
JAVE_SCRIPT = 6;
40+
GO = 7;
2741
}
2842

2943
struct RegisterResponse {
3044
1: i32 client_id
3145
2: AgentType agent_type,
3246
3: string team_name,
33-
4: i32 uniform_number
47+
4: i32 uniform_number,
48+
5: RpcServerLanguageType rpc_server_language_type
3449
}
3550

3651
struct Ball {
@@ -84,6 +99,12 @@ enum LoggerLevel {
8499
PLAN = 1048576
85100
}
86101

102+
enum CardType {
103+
NO_CARD = 0,
104+
YELLOW = 1,
105+
RED = 2
106+
}
107+
87108
struct Player {
88109
1: RpcVector2D position,
89110
2: RpcVector2D seen_position,
@@ -153,7 +174,10 @@ struct Self {
153174
33: double foul_probability,
154175
34: ViewWidth view_width,
155176
35: i32 type_id,
156-
36: double kick_rate
177+
36: double kick_rate,
178+
37: double recovery,
179+
38: double stamina_capacity,
180+
39: CardType card
157181
}
158182

159183
enum InterceptActionType {
@@ -256,7 +280,11 @@ struct WorldModel {
256280
28: i32 our_team_score,
257281
29: i32 their_team_score,
258282
30: bool is_penalty_kick_mode,
259-
31: map<i32, RpcVector2D> helios_home_positions
283+
31: map<i32, RpcVector2D> helios_home_positions,
284+
32: double our_defense_line_x,
285+
33: double their_defense_line_x,
286+
34: double our_defense_player_line_x,
287+
35: double their_defense_player_line_x
260288
}
261289

262290
struct State {
@@ -714,7 +742,7 @@ struct HeliosGoalieKick {}
714742

715743
struct HeliosShoot {}
716744

717-
struct HeliosChainAction {
745+
struct HeliosOffensivePlanner {
718746
1: bool direct_pass,
719747
2: bool lead_pass,
720748
3: bool through_pass,
@@ -724,6 +752,7 @@ struct HeliosChainAction {
724752
7: bool simple_pass,
725753
8: bool simple_dribble,
726754
9: bool simple_shoot
755+
10: bool server_side_decision
727756
}
728757

729758
struct HeliosBasicOffensive {}
@@ -795,7 +824,7 @@ struct PlayerAction {
795824
56: optional HeliosGoalieMove helios_goalie_move,
796825
57: optional HeliosGoalieKick helios_goalie_kick,
797826
58: optional HeliosShoot helios_shoot,
798-
59: optional HeliosChainAction helios_chain_action,
827+
59: optional HeliosOffensivePlanner helios_offensive_planner,
799828
60: optional HeliosBasicOffensive helios_basic_offensive,
800829
61: optional HeliosBasicMove helios_basic_move,
801830
62: optional HeliosSetPlay helios_set_play,
@@ -1162,6 +1191,60 @@ struct PlayerType {
11621191
34: double player_speed_max,
11631192
}
11641193

1194+
enum RpcActionCategory {
1195+
AC_Hold = 0;
1196+
AC_Dribble = 1;
1197+
AC_Pass = 2;
1198+
AC_Shoot = 3;
1199+
AC_Clear = 4;
1200+
AC_Move = 5;
1201+
AC_NoAction = 6;
1202+
}
1203+
1204+
struct RpcCooperativeAction {
1205+
1: RpcActionCategory category;
1206+
2: i32 index;
1207+
3: i32 sender_unum;
1208+
4: i32 target_unum;
1209+
5: RpcVector2D target_point;
1210+
6: double first_ball_speed;
1211+
7: double first_turn_moment;
1212+
8: double first_dash_power;
1213+
9: double first_dash_angle_relative;
1214+
10: i32 duration_step;
1215+
11: i32 kick_count;
1216+
12: i32 turn_count;
1217+
13: i32 dash_count;
1218+
14: bool final_action;
1219+
15: string description;
1220+
16: i32 parent_index;
1221+
}
1222+
1223+
struct RpcPredictState {
1224+
1: i32 spend_time;
1225+
2: i32 ball_holder_unum;
1226+
3: RpcVector2D ball_position;
1227+
4: RpcVector2D ball_velocity;
1228+
5: double our_defense_line_x;
1229+
6: double our_offense_line_x;
1230+
}
1231+
1232+
struct RpcActionState {
1233+
1: RpcCooperativeAction action;
1234+
2: RpcPredictState predict_state;
1235+
3: double evaluation;
1236+
}
1237+
1238+
struct BestPlannerActionRequest {
1239+
1: RegisterResponse register_response,
1240+
2: map<i32, RpcActionState> pairs;
1241+
3: State state;
1242+
}
1243+
1244+
struct BestPlannerActionResponse {
1245+
1: i32 index;
1246+
}
1247+
11651248
struct Empty {}
11661249

11671250
service Game {
@@ -1173,6 +1256,7 @@ service Game {
11731256
Empty SendPlayerParams(1: PlayerParam player_param),
11741257
Empty SendPlayerType(1: PlayerType player_type),
11751258
RegisterResponse Register(1: RegisterRequest request),
1176-
Empty SendByeCommand(1: RegisterResponse register_response)
1259+
Empty SendByeCommand(1: RegisterResponse register_response),
1260+
BestPlannerActionResponse GetBestPlannerAction(1: BestPlannerActionRequest best_planner_action_request)
11771261
}
11781262

0 commit comments

Comments
 (0)