sc2ai 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/sc2ai/protocol/common.proto +6 -6
- data/data/sc2ai/protocol/data.proto +23 -20
- data/data/sc2ai/protocol/debug.proto +25 -21
- data/data/sc2ai/protocol/error.proto +217 -215
- data/data/sc2ai/protocol/query.proto +1 -1
- data/data/sc2ai/protocol/raw.proto +16 -14
- data/data/sc2ai/protocol/sc2api.proto +108 -94
- data/data/sc2ai/protocol/score.proto +4 -3
- data/data/sc2ai/protocol/spatial.proto +6 -5
- data/data/sc2ai/protocol/ui.proto +17 -14
- data/exe/sc2ai +0 -3
- data/lib/docker_build/Dockerfile.ruby +4 -2
- data/lib/sc2ai/api/ability_id.rb +6 -1
- data/lib/sc2ai/api/data.rb +18 -3
- data/lib/sc2ai/api/tech_tree.rb +1 -1
- data/lib/sc2ai/api/tech_tree_data.rb +54 -3
- data/lib/sc2ai/connection/connection_listener.rb +3 -3
- data/lib/sc2ai/connection/requests.rb +31 -35
- data/lib/sc2ai/connection/status_listener.rb +1 -1
- data/lib/sc2ai/connection.rb +1 -2
- data/lib/sc2ai/local_play/client.rb +2 -2
- data/lib/sc2ai/local_play/match.rb +7 -2
- data/lib/sc2ai/overrides/async/process/child.rb +1 -1
- data/lib/sc2ai/paths.rb +12 -2
- data/lib/sc2ai/player/actions.rb +54 -35
- data/lib/sc2ai/player/debug.rb +54 -20
- data/lib/sc2ai/player/game_state.rb +11 -18
- data/lib/sc2ai/player/geo.rb +56 -66
- data/lib/sc2ai/player/units.rb +41 -17
- data/lib/sc2ai/player.rb +104 -47
- data/lib/sc2ai/ports.rb +1 -2
- data/lib/sc2ai/protocol/_meta_documentation.rb +270 -25
- data/lib/sc2ai/protocol/common_pb.rb +3862 -33
- data/lib/sc2ai/protocol/data_pb.rb +9106 -36
- data/lib/sc2ai/protocol/debug_pb.rb +10434 -45
- data/lib/sc2ai/protocol/error_pb.rb +1084 -29
- data/lib/sc2ai/protocol/extensions/ability_remapable.rb +9 -9
- data/lib/sc2ai/protocol/extensions/action.rb +60 -0
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +9 -0
- data/lib/sc2ai/protocol/extensions/position.rb +11 -36
- data/lib/sc2ai/protocol/extensions/power_source.rb +3 -0
- data/lib/sc2ai/protocol/extensions/unit.rb +61 -36
- data/lib/sc2ai/protocol/extensions/unit_type_data.rb +8 -0
- data/lib/sc2ai/protocol/query_pb.rb +5022 -36
- data/lib/sc2ai/protocol/raw_pb.rb +18347 -46
- data/lib/sc2ai/protocol/sc2api_pb.rb +48424 -126
- data/lib/sc2ai/protocol/score_pb.rb +5965 -30
- data/lib/sc2ai/protocol/spatial_pb.rb +11941 -37
- data/lib/sc2ai/protocol/ui_pb.rb +12924 -46
- data/lib/sc2ai/unit_group/action_ext.rb +0 -2
- data/lib/sc2ai/unit_group/filter_ext.rb +24 -8
- data/lib/sc2ai/unit_group/geo_ext.rb +0 -2
- data/lib/sc2ai/unit_group.rb +1 -1
- data/lib/sc2ai/version.rb +2 -3
- data/lib/sc2ai.rb +10 -11
- data/lib/templates/ladderzip/bin/ladder.tt +0 -3
- data/lib/templates/new/.ladderignore +15 -5
- data/lib/templates/new/api/common.proto +6 -6
- data/lib/templates/new/api/data.proto +23 -20
- data/lib/templates/new/api/debug.proto +25 -21
- data/lib/templates/new/api/error.proto +217 -215
- data/lib/templates/new/api/query.proto +1 -1
- data/lib/templates/new/api/raw.proto +16 -14
- data/lib/templates/new/api/sc2api.proto +108 -94
- data/lib/templates/new/api/score.proto +4 -3
- data/lib/templates/new/api/spatial.proto +6 -5
- data/lib/templates/new/api/ui.proto +17 -14
- data/lib/templates/new/boot.rb.tt +1 -1
- data/lib/templates/new/my_bot.rb.tt +2 -2
- data/lib/templates/new/run_example_match.rb.tt +2 -2
- data/sig/sc2ai.rbs +11072 -1651
- metadata +31 -26
- data/lib/sc2ai/overrides/kernel.rb +0 -33
- data/lib/sc2ai/protocol/extensions/unit_type.rb +0 -9
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
syntax = "
|
2
|
+
syntax = "proto3";
|
3
3
|
|
4
4
|
package Api;
|
5
5
|
|
@@ -155,13 +155,14 @@ message Response {
|
|
155
155
|
}
|
156
156
|
|
157
157
|
enum Status {
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
158
|
+
ENUM_STATUS_UNSET = 0; // PROTO3 COMPAT
|
159
|
+
LAUNCHED = 1; // GAME HAS BEEN LAUNCH AND IS NOT YET DOING ANYTHING.
|
160
|
+
INIT_GAME = 2; // CREATE GAME HAS BEEN CALLED, AND THE HOST IS AWAITING PLAYERS.
|
161
|
+
IN_GAME = 3; // IN A SINGLE OR MULTIPLAYER GAME.
|
162
|
+
IN_REPLAY = 4; // IN A REPLAY.
|
163
|
+
ENDED = 5; // GAME HAS ENDED, CAN STILL REQUEST GAME INFO, BUT READY FOR A NEW GAME.
|
164
|
+
QUIT = 6; // APPLICATION IS SHUTTING DOWN.
|
165
|
+
UNKNOWN = 99; // SHOULD NOT HAPPEN, BUT INDICATES AN ERROR IF IT OCCURS.
|
165
166
|
}
|
166
167
|
|
167
168
|
//-----------------------------------------------------------------------------
|
@@ -191,14 +192,15 @@ message LocalMap {
|
|
191
192
|
|
192
193
|
message ResponseCreateGame {
|
193
194
|
enum Error {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
195
|
+
ENUM_RESPONSE_CREATE_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
|
196
|
+
MISSING_MAP = 1;
|
197
|
+
INVALID_MAP_PATH = 2;
|
198
|
+
INVALID_MAP_DATA = 3;
|
199
|
+
INVALID_MAP_NAME = 4;
|
200
|
+
INVALID_MAP_HANDLE = 5;
|
201
|
+
MISSING_PLAYER_SETUP = 6;
|
202
|
+
INVALID_PLAYER_SETUP = 7;
|
203
|
+
MULTIPLAYER_UNSUPPORTED = 8; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD.
|
202
204
|
}
|
203
205
|
optional Error error = 1;
|
204
206
|
optional string error_details = 2;
|
@@ -231,21 +233,22 @@ message ResponseJoinGame {
|
|
231
233
|
optional uint32 player_id = 1;
|
232
234
|
|
233
235
|
enum Error {
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
236
|
+
ENUM_RESPONSE_JOIN_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
|
237
|
+
MISSING_PARTICIPATION = 1;
|
238
|
+
INVALID_OBSERVED_PLAYER_ID = 2;
|
239
|
+
MISSING_OPTIONS = 3;
|
240
|
+
MISSING_PORTS = 4;
|
241
|
+
GAME_FULL = 5;
|
242
|
+
LAUNCH_ERROR = 6;
|
243
|
+
|
244
|
+
// MULTIPLAYER SPECIFIC.
|
245
|
+
FEATURE_UNSUPPORTED = 7; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD FOR THE REQUESTED FEATURES.
|
246
|
+
NO_SPACE_FOR_USER = 8;
|
247
|
+
MAP_DOES_NOT_EXIST = 9;
|
248
|
+
CANNOT_OPEN_MAP = 10;
|
249
|
+
CHECKSUM_ERROR = 11;
|
250
|
+
NETWORK_ERROR = 12;
|
251
|
+
OTHER_ERROR = 13;
|
249
252
|
}
|
250
253
|
optional Error error = 2;
|
251
254
|
optional string error_details = 3;
|
@@ -258,7 +261,8 @@ message RequestRestartGame {
|
|
258
261
|
// The defaultRestartGameLoops is specified to be (1<<18) by default
|
259
262
|
message ResponseRestartGame {
|
260
263
|
enum Error {
|
261
|
-
|
264
|
+
ENUM_RESPONSE_RESTART_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
|
265
|
+
LAUNCH_ERROR = 1;
|
262
266
|
}
|
263
267
|
optional Error error = 1;
|
264
268
|
optional string error_details = 2;
|
@@ -282,13 +286,14 @@ message RequestStartReplay {
|
|
282
286
|
|
283
287
|
message ResponseStartReplay {
|
284
288
|
enum Error {
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
289
|
+
ENUM_RESPONSE_START_REPLAY_ERROR_UNSET = 0; // PROTO3 COMPAT
|
290
|
+
MISSING_REPLAY = 1;
|
291
|
+
INVALID_REPLAY_PATH = 2;
|
292
|
+
INVALID_REPLAY_DATA = 3;
|
293
|
+
INVALID_MAP_DATA = 4;
|
294
|
+
INVALID_OBSERVED_PLAYER_ID = 5;
|
295
|
+
MISSING_OPTIONS = 6;
|
296
|
+
LAUNCH_ERROR = 7;
|
292
297
|
}
|
293
298
|
optional Error error = 1;
|
294
299
|
optional string error_details = 2;
|
@@ -301,7 +306,8 @@ message RequestMapCommand {
|
|
301
306
|
|
302
307
|
message ResponseMapCommand {
|
303
308
|
enum Error {
|
304
|
-
|
309
|
+
ENUM_RESPONSE_MAP_COMMAND_ERROR_UNSET = 0; // PROTO3 COMPAT
|
310
|
+
NO_TRIGGER_ERROR = 1;
|
305
311
|
}
|
306
312
|
optional Error error = 1;
|
307
313
|
optional string error_details = 2;
|
@@ -343,11 +349,11 @@ message RequestGameInfo {
|
|
343
349
|
|
344
350
|
message ResponseGameInfo {
|
345
351
|
optional string map_name = 1;
|
346
|
-
repeated string mod_names = 6;
|
347
352
|
optional string local_map_path = 2;
|
348
353
|
repeated PlayerInfo player_info = 3;
|
349
354
|
optional StartRaw start_raw = 4; // Populated if Raw interface is enabled.
|
350
355
|
optional InterfaceOptions options = 5;
|
356
|
+
repeated string mod_names = 6;
|
351
357
|
}
|
352
358
|
|
353
359
|
//-----------------------------------------------------------------------------
|
@@ -453,11 +459,12 @@ message ResponseReplayInfo {
|
|
453
459
|
optional uint32 base_build = 8;
|
454
460
|
|
455
461
|
enum Error {
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
462
|
+
ENUM_RESPONSE_REPLAY_INFO_ERROR_UNSET = 0; // PROTO3 COMPAT
|
463
|
+
MISSING_REPLAY = 1;
|
464
|
+
INVALID_REPLAY_PATH = 2;
|
465
|
+
INVALID_REPLAY_DATA = 3;
|
466
|
+
PARSING_ERROR = 4;
|
467
|
+
DOWNLOAD_ERROR = 5;
|
461
468
|
}
|
462
469
|
optional Error error = 9;
|
463
470
|
optional string error_details = 10;
|
@@ -484,7 +491,8 @@ message RequestSaveMap {
|
|
484
491
|
|
485
492
|
message ResponseSaveMap {
|
486
493
|
enum Error {
|
487
|
-
|
494
|
+
ENUM_RESPONSE_SAVE_MAP_ERROR_UNSET = 0; // PROTO3 COMPAT
|
495
|
+
INVALID_MAP_DATA = 1;
|
488
496
|
}
|
489
497
|
optional Error error = 1;
|
490
498
|
}
|
@@ -514,31 +522,34 @@ message ResponseDebug {
|
|
514
522
|
//
|
515
523
|
|
516
524
|
enum Difficulty {
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
525
|
+
ENUM_DIFFICULTY_UNSET = 0; // PROTO3 COMPAT
|
526
|
+
VERY_EASY = 1;
|
527
|
+
EASY = 2;
|
528
|
+
MEDIUM = 3;
|
529
|
+
MEDIUM_HARD = 4;
|
530
|
+
HARD = 5;
|
531
|
+
HARDER = 6;
|
532
|
+
VERY_HARD = 7;
|
533
|
+
CHEAT_VISION = 8;
|
534
|
+
CHEAT_MONEY = 9;
|
535
|
+
CHEAT_INSANE = 10;
|
527
536
|
}
|
528
537
|
|
529
538
|
enum PlayerType {
|
530
|
-
|
531
|
-
|
532
|
-
|
539
|
+
ENUM_PLAYER_TYPE_UNSET = 0; // PROTO3 COMPAT
|
540
|
+
PARTICIPANT = 1;
|
541
|
+
COMPUTER = 2;
|
542
|
+
OBSERVER = 3;
|
533
543
|
}
|
534
544
|
|
535
545
|
enum AIBuild {
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
546
|
+
ENUM_AI_BUILD_UNSET = 0; // PROTO3 COMPAT
|
547
|
+
RANDOM_BUILD = 1;
|
548
|
+
RUSH = 2;
|
549
|
+
TIMING = 3;
|
550
|
+
POWER = 4;
|
551
|
+
MACRO = 5;
|
552
|
+
AIR = 6;
|
542
553
|
}
|
543
554
|
|
544
555
|
message PlayerSetup {
|
@@ -638,8 +649,9 @@ message Action {
|
|
638
649
|
|
639
650
|
message ActionChat {
|
640
651
|
enum Channel {
|
641
|
-
|
642
|
-
|
652
|
+
ENUM_CHANNEL_UNSET = 0; // PROTO3 COMPAT
|
653
|
+
BROADCAST = 1;
|
654
|
+
TEAM = 2;
|
643
655
|
}
|
644
656
|
optional Channel channel = 1;
|
645
657
|
optional string message = 2;
|
@@ -681,35 +693,37 @@ message ActionObserverCameraFollowUnits {
|
|
681
693
|
}
|
682
694
|
|
683
695
|
enum Alert {
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
696
|
+
ENUM_ALERT_UNSET = 0; // PROTO3 COMPAT
|
697
|
+
ALERT_ERROR = 3;
|
698
|
+
ADD_ON_COMPLETE = 4;
|
699
|
+
BUILDING_COMPLETE = 5;
|
700
|
+
BUILDING_UNDER_ATTACK = 6;
|
701
|
+
LARVA_HATCHED = 7;
|
702
|
+
MERGE_COMPLETE = 8;
|
703
|
+
MINERALS_EXHAUSTED = 9;
|
704
|
+
MORPH_COMPLETE = 10;
|
705
|
+
MOTHERSHIP_COMPLETE = 11;
|
706
|
+
MULE_EXPIRED = 12;
|
707
|
+
NUCLEAR_LAUNCH_DETECTED = 1;
|
708
|
+
NUKE_COMPLETE = 13;
|
709
|
+
NYDUS_WORM_DETECTED = 2;
|
710
|
+
RESEARCH_COMPLETE = 14;
|
711
|
+
TRAIN_ERROR = 15;
|
712
|
+
TRAIN_UNIT_COMPLETE = 16;
|
713
|
+
TRAIN_WORKER_COMPLETE = 17;
|
714
|
+
TRANSFORMATION_COMPLETE = 18;
|
715
|
+
UNIT_UNDER_ATTACK = 19;
|
716
|
+
UPGRADE_COMPLETE = 20;
|
717
|
+
VESPENE_EXHAUSTED = 21;
|
718
|
+
WARP_IN_COMPLETE = 22;
|
706
719
|
}
|
707
720
|
|
708
721
|
enum Result {
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
722
|
+
ENUM_RESULT_UNSET = 0; // PROTO3 COMPAT
|
723
|
+
VICTORY = 1;
|
724
|
+
DEFEAT = 2;
|
725
|
+
TIE = 3;
|
726
|
+
UNDECIDED = 4;
|
713
727
|
}
|
714
728
|
|
715
729
|
message PlayerResult {
|
@@ -1,12 +1,13 @@
|
|
1
1
|
|
2
|
-
syntax = "
|
2
|
+
syntax = "proto3";
|
3
3
|
|
4
4
|
package Api;
|
5
5
|
|
6
6
|
message Score {
|
7
7
|
enum ScoreType {
|
8
|
-
|
9
|
-
|
8
|
+
ENUM_SCORE_TYPE_UNSET = 0; // PROTO3 COMPAT
|
9
|
+
CURRICULUM = 1; // MAP GENERATED SCORE (FROM CURRICULUM MAPS WITH SPECIAL SCORING)
|
10
|
+
MELEE = 2; // SUMMATION OF IN_PROGRESS AND CURRENT UNITS/BUILDINGS VALUE + MINERALS + VESPENE
|
10
11
|
}
|
11
12
|
|
12
13
|
optional ScoreType score_type = 6;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
syntax = "
|
2
|
+
syntax = "proto3";
|
3
3
|
|
4
4
|
package Api;
|
5
5
|
|
@@ -101,10 +101,11 @@ message ActionSpatialCameraMove {
|
|
101
101
|
message ActionSpatialUnitSelectionPoint {
|
102
102
|
optional PointI selection_screen_coord = 1;
|
103
103
|
enum Type {
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
104
|
+
ENUM_ACTION_SPATIAL_UNIT_SELECTION_POINT_TYPE_UNSET = 0; // PROTO3 COMPAT
|
105
|
+
SELECT = 1; // EQUIVALENT TO NORMAL CLICK. CHANGES SELECTION TO UNIT.
|
106
|
+
TOGGLE = 2; // EQUIVALENT TO SHIFT+CLICK. TOGGLE SELECTION OF UNIT.
|
107
|
+
ALL_TYPE = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
|
108
|
+
ADD_ALL_TYPE = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
|
108
109
|
}
|
109
110
|
optional Type type = 2;
|
110
111
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
syntax = "
|
2
|
+
syntax = "proto3";
|
3
3
|
|
4
4
|
package Api;
|
5
5
|
|
@@ -90,11 +90,12 @@ message ActionUI {
|
|
90
90
|
|
91
91
|
message ActionControlGroup {
|
92
92
|
enum ControlGroupAction {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
ENUM_CONTROL_GROUP_ACTION_UNSET = 0; // PROTO3 COMPAT
|
94
|
+
RECALL = 1; // EQUIVALENT TO NUMBER HOTKEY. REPLACES CURRENT SELECTION WITH CONTROL GROUP.
|
95
|
+
SET = 2; // EQUIVALENT TO CONTROL + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION.
|
96
|
+
APPEND = 3; // EQUIVALENT TO SHIFT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP.
|
97
|
+
SET_AND_STEAL = 4; // EQUIVALENT TO CONTROL + ALT + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
|
98
|
+
APPEND_AND_STEAL = 5; // EQUIVALENT TO SHIFT + ALT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
|
98
99
|
}
|
99
100
|
optional ControlGroupAction action = 1;
|
100
101
|
optional uint32 control_group_index = 2;
|
@@ -113,20 +114,22 @@ message ActionSelectLarva {
|
|
113
114
|
|
114
115
|
message ActionSelectIdleWorker {
|
115
116
|
enum Type {
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
ENUM_ACTION_SELECT_IDLE_WORKER_TYPE_UNSET = 0; // PROTO3 COMPAT
|
118
|
+
SET = 1; // EQUIVALENT TO CLICK WITH NO MODIFIERS. REPLACES SELECTION WITH SINGLE IDLE WORKER.
|
119
|
+
ADD = 2; // EQUIVALENT TO SHIFT+CLICK. ADDS SINGLE IDLE WORKER TO CURRENT SELECTION.
|
120
|
+
ALL = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL IDLE WORKERS.
|
121
|
+
ADD_ALL = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. ADDS ALL IDLE WORKERS TO CURRENT SELECTION.
|
120
122
|
}
|
121
123
|
optional Type type = 1;
|
122
124
|
}
|
123
125
|
|
124
126
|
message ActionMultiPanel {
|
125
127
|
enum Type {
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
128
|
+
ENUM_ACTION_MULTI_PANEL_TYPE_UNSET = 0; // PROTO3 COMPAT
|
129
|
+
SINGLE_SELECT = 1; // CLICK ON ICON
|
130
|
+
DESELECT_UNIT = 2; // SHIFT CLICK ON ICON
|
131
|
+
SELECT_ALL_OF_TYPE = 3; // CONTROL CLICK ON ICON.
|
132
|
+
DESELECT_ALL_OF_TYPE = 4; // CONTROL+SHIFT CLICK ON ICON.
|
130
133
|
}
|
131
134
|
optional Type type = 1;
|
132
135
|
optional int32 unit_index = 2;
|
@@ -3,4 +3,4 @@
|
|
3
3
|
# as $bot is created correctly. if not, your ladder bot will break.
|
4
4
|
|
5
5
|
require_relative "<%= @bot_file %>"
|
6
|
-
$bot = <%= @classname %>.new(name: "<%= @botname %>", race: Api::Race::<%= @race %>)
|
6
|
+
$bot = <%= @classname %>.new(name: "<%= @botname %>", race: Api::Race::<%= @race.upcase %>)
|
@@ -5,7 +5,7 @@ class <%= @classname %> < Sc2::Player::Bot
|
|
5
5
|
def configure
|
6
6
|
@realtime = false # Step-mode vs Bot, Realtime vs Humans
|
7
7
|
@step_count = 2 # 2s/22.4 = ~89.29ms step cycle time allowance
|
8
|
-
@enable_feature_layer = false
|
8
|
+
@enable_feature_layer = false # Enables ui_ and spatial_ actions. Advanced, and has performance cost.
|
9
9
|
end
|
10
10
|
|
11
11
|
def on_step
|
@@ -15,7 +15,7 @@ class <%= @classname %> < Sc2::Player::Bot
|
|
15
15
|
|
16
16
|
# If your attack fails, "good game" and exit
|
17
17
|
if units.workers.size.zero?
|
18
|
-
action_chat("gg", channel: Api::ActionChat::Channel::
|
18
|
+
action_chat("gg", channel: Api::ActionChat::Channel::BROADCAST)
|
19
19
|
leave_game
|
20
20
|
end
|
21
21
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
require "./boot.rb"
|
3
3
|
|
4
4
|
# Or simply, create by hand
|
5
|
-
#my_bot = MyBot.new(name: "Botname", race: Api::Race::
|
5
|
+
#my_bot = MyBot.new(name: "Botname", race: Api::Race::RANDOM)
|
6
6
|
|
7
7
|
# Start a match
|
8
8
|
Sc2::Match.new(
|
9
9
|
players: [
|
10
10
|
$bot,
|
11
|
-
Sc2::Player::Computer.new(race: Api::Race::
|
11
|
+
Sc2::Player::Computer.new(race: Api::Race::RANDOM, difficulty: Api::Difficulty::VERY_EASY)
|
12
12
|
],
|
13
13
|
map: "GoldenAura513AIE" # Or any of the downloaded map names
|
14
14
|
).run
|