sc2ai 0.0.0.pre → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/data.json +1 -0
- data/data/data_readable.json +22842 -0
- data/data/sc2ai/protocol/common.proto +59 -0
- data/data/sc2ai/protocol/data.proto +120 -0
- data/data/sc2ai/protocol/debug.proto +127 -0
- data/data/sc2ai/protocol/error.proto +221 -0
- data/data/sc2ai/protocol/query.proto +55 -0
- data/data/sc2ai/protocol/raw.proto +202 -0
- data/data/sc2ai/protocol/sc2api.proto +718 -0
- data/data/sc2ai/protocol/score.proto +108 -0
- data/data/sc2ai/protocol/spatial.proto +115 -0
- data/data/sc2ai/protocol/ui.proto +145 -0
- data/data/setup/setup.SC2Map +0 -0
- data/data/setup/setup.SC2Replay +0 -0
- data/data/stableid.json +35730 -0
- data/data/versions.json +554 -0
- data/exe/sc2ai +35 -0
- data/lib/docker_build/Dockerfile.ruby +74 -0
- data/lib/docker_build/docker-compose-base-image.yml +10 -0
- data/lib/docker_build/docker-compose-ladderzip.yml +9 -0
- data/lib/sc2ai/api/ability_id.rb +1644 -0
- data/lib/sc2ai/api/buff_id.rb +306 -0
- data/lib/sc2ai/api/data.rb +101 -0
- data/lib/sc2ai/api/effect_id.rb +20 -0
- data/lib/sc2ai/api/tech_tree.rb +83 -0
- data/lib/sc2ai/api/tech_tree_data.rb +2338 -0
- data/lib/sc2ai/api/unit_type_id.rb +2022 -0
- data/lib/sc2ai/api/upgrade_id.rb +310 -0
- data/lib/sc2ai/cli/cli.rb +175 -0
- data/lib/sc2ai/cli/ladderzip.rb +154 -0
- data/lib/sc2ai/cli/new.rb +88 -0
- data/lib/sc2ai/configuration.rb +145 -0
- data/lib/sc2ai/connection/connection_listener.rb +30 -0
- data/lib/sc2ai/connection/requests.rb +417 -0
- data/lib/sc2ai/connection/status_listener.rb +15 -0
- data/lib/sc2ai/connection.rb +146 -0
- data/lib/sc2ai/local_play/client/configurable_options.rb +115 -0
- data/lib/sc2ai/local_play/client.rb +159 -0
- data/lib/sc2ai/local_play/client_manager.rb +70 -0
- data/lib/sc2ai/local_play/map_file.rb +48 -0
- data/lib/sc2ai/local_play/match.rb +184 -0
- data/lib/sc2ai/overrides/array.rb +14 -0
- data/lib/sc2ai/overrides/async/process/child.rb +31 -0
- data/lib/sc2ai/overrides/kernel.rb +33 -0
- data/lib/sc2ai/paths.rb +294 -0
- data/lib/sc2ai/player/actions.rb +386 -0
- data/lib/sc2ai/player/debug.rb +224 -0
- data/lib/sc2ai/player/game_state.rb +131 -0
- data/lib/sc2ai/player/geometry.rb +766 -0
- data/lib/sc2ai/player/previous_state.rb +49 -0
- data/lib/sc2ai/player/units.rb +337 -0
- data/lib/sc2ai/player.rb +661 -0
- data/lib/sc2ai/ports.rb +152 -0
- data/lib/sc2ai/protocol/_meta_documentation.rb +39 -0
- data/lib/sc2ai/protocol/common_pb.rb +43 -0
- data/lib/sc2ai/protocol/data_pb.rb +47 -0
- data/lib/sc2ai/protocol/debug_pb.rb +56 -0
- data/lib/sc2ai/protocol/error_pb.rb +36 -0
- data/lib/sc2ai/protocol/extensions/color.rb +20 -0
- data/lib/sc2ai/protocol/extensions/point.rb +23 -0
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +26 -0
- data/lib/sc2ai/protocol/extensions/position.rb +202 -0
- data/lib/sc2ai/protocol/extensions/power_source.rb +19 -0
- data/lib/sc2ai/protocol/extensions/unit.rb +489 -0
- data/lib/sc2ai/protocol/query_pb.rb +47 -0
- data/lib/sc2ai/protocol/raw_pb.rb +57 -0
- data/lib/sc2ai/protocol/sc2api_pb.rb +130 -0
- data/lib/sc2ai/protocol/score_pb.rb +40 -0
- data/lib/sc2ai/protocol/spatial_pb.rb +48 -0
- data/lib/sc2ai/protocol/ui_pb.rb +56 -0
- data/lib/sc2ai/unit_group/action_ext.rb +74 -0
- data/lib/sc2ai/unit_group/filter_ext.rb +379 -0
- data/lib/sc2ai/unit_group.rb +277 -0
- data/lib/sc2ai/version.rb +2 -1
- data/lib/sc2ai.rb +93 -2
- data/lib/templates/ladderzip/bin/ladder.tt +23 -0
- data/lib/templates/new/.ladderignore +20 -0
- data/lib/templates/new/Gemfile.tt +7 -0
- data/lib/templates/new/api/common.proto +59 -0
- data/lib/templates/new/api/data.proto +120 -0
- data/lib/templates/new/api/debug.proto +127 -0
- data/lib/templates/new/api/error.proto +221 -0
- data/lib/templates/new/api/query.proto +55 -0
- data/lib/templates/new/api/raw.proto +202 -0
- data/lib/templates/new/api/sc2api.proto +718 -0
- data/lib/templates/new/api/score.proto +108 -0
- data/lib/templates/new/api/spatial.proto +115 -0
- data/lib/templates/new/api/ui.proto +145 -0
- data/lib/templates/new/boot.rb.tt +6 -0
- data/lib/templates/new/my_bot.rb.tt +23 -0
- data/lib/templates/new/run_example_match.rb.tt +14 -0
- data/sc2ai.gemspec +80 -0
- metadata +344 -13
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
syntax = "proto2";
|
3
|
+
|
4
|
+
package Api;
|
5
|
+
|
6
|
+
import "sc2ai/protocol/common.proto";
|
7
|
+
|
8
|
+
//
|
9
|
+
// Start
|
10
|
+
//
|
11
|
+
|
12
|
+
message StartRaw {
|
13
|
+
optional Size2DI map_size = 1; // Width and height of the map.
|
14
|
+
optional ImageData pathing_grid = 2; // 1 bit bitmap of the pathing grid.
|
15
|
+
optional ImageData terrain_height = 3; // 1 byte bitmap of the terrain height.
|
16
|
+
optional ImageData placement_grid = 4; // 1 bit bitmap of the building placement grid.
|
17
|
+
optional RectangleI playable_area = 5; // The playable cells.
|
18
|
+
repeated Point2D start_locations = 6; // Possible start locations for players.
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
//
|
23
|
+
// Observation
|
24
|
+
//
|
25
|
+
|
26
|
+
message ObservationRaw {
|
27
|
+
optional PlayerRaw player = 1;
|
28
|
+
repeated Unit units = 2;
|
29
|
+
optional MapState map_state = 3; // Fog of war, creep and so on. Board stuff that changes per frame.
|
30
|
+
optional Event event = 4;
|
31
|
+
repeated Effect effects = 5;
|
32
|
+
repeated RadarRing radar = 6;
|
33
|
+
}
|
34
|
+
|
35
|
+
message RadarRing {
|
36
|
+
optional Point pos = 1;
|
37
|
+
optional float radius = 2;
|
38
|
+
}
|
39
|
+
|
40
|
+
message PowerSource {
|
41
|
+
optional Point pos = 1;
|
42
|
+
optional float radius = 2;
|
43
|
+
optional uint64 tag = 3;
|
44
|
+
}
|
45
|
+
|
46
|
+
message PlayerRaw {
|
47
|
+
repeated PowerSource power_sources = 1;
|
48
|
+
optional Point camera = 2;
|
49
|
+
repeated uint32 upgrade_ids = 3; // TODO: Add to UI observation?
|
50
|
+
}
|
51
|
+
|
52
|
+
message UnitOrder {
|
53
|
+
optional uint32 ability_id = 1;
|
54
|
+
oneof target {
|
55
|
+
Point target_world_space_pos = 2;
|
56
|
+
uint64 target_unit_tag = 3;
|
57
|
+
}
|
58
|
+
optional float progress = 4; // Progress of train abilities. Range: [0.0, 1.0]
|
59
|
+
}
|
60
|
+
|
61
|
+
enum DisplayType {
|
62
|
+
Visible = 1; // Fully visible
|
63
|
+
Snapshot = 2; // Dimmed version of unit left behind after entering fog of war
|
64
|
+
Hidden = 3; // Fully hidden
|
65
|
+
Placeholder = 4; // Building that hasn't started construction.
|
66
|
+
}
|
67
|
+
|
68
|
+
enum Alliance {
|
69
|
+
Self = 1;
|
70
|
+
Ally = 2;
|
71
|
+
Neutral = 3;
|
72
|
+
Enemy = 4;
|
73
|
+
}
|
74
|
+
|
75
|
+
enum CloakState {
|
76
|
+
CloakedUnknown = 0; // Under the fog, so unknown whether it's cloaked or not.
|
77
|
+
Cloaked = 1;
|
78
|
+
CloakedDetected = 2;
|
79
|
+
NotCloaked = 3;
|
80
|
+
CloakedAllied = 4;
|
81
|
+
}
|
82
|
+
|
83
|
+
message PassengerUnit {
|
84
|
+
optional uint64 tag = 1;
|
85
|
+
optional float health = 2;
|
86
|
+
optional float health_max = 3;
|
87
|
+
optional float shield = 4;
|
88
|
+
optional float shield_max = 7;
|
89
|
+
optional float energy = 5;
|
90
|
+
optional float energy_max = 8;
|
91
|
+
optional uint32 unit_type = 6;
|
92
|
+
}
|
93
|
+
|
94
|
+
message RallyTarget {
|
95
|
+
optional Point point = 1; // Will always be filled.
|
96
|
+
optional uint64 tag = 2; // Only if it's targeting a unit.
|
97
|
+
}
|
98
|
+
|
99
|
+
message Unit {
|
100
|
+
// Fields are populated based on type/alliance
|
101
|
+
optional DisplayType display_type = 1;
|
102
|
+
optional Alliance alliance = 2;
|
103
|
+
|
104
|
+
optional uint64 tag = 3; // Unique identifier for a unit
|
105
|
+
optional uint32 unit_type = 4;
|
106
|
+
optional int32 owner = 5;
|
107
|
+
|
108
|
+
optional Point pos = 6;
|
109
|
+
optional float facing = 7;
|
110
|
+
optional float radius = 8;
|
111
|
+
optional float build_progress = 9; // Range: [0.0, 1.0]
|
112
|
+
optional CloakState cloak = 10;
|
113
|
+
repeated uint32 buff_ids = 27;
|
114
|
+
|
115
|
+
optional float detect_range = 31;
|
116
|
+
optional float radar_range = 32;
|
117
|
+
|
118
|
+
optional bool is_selected = 11;
|
119
|
+
optional bool is_on_screen = 12; // Visible and within the camera frustrum.
|
120
|
+
optional bool is_blip = 13; // Detected by sensor tower
|
121
|
+
optional bool is_powered = 35;
|
122
|
+
optional bool is_active = 39; // Building is training/researching (ie animated).
|
123
|
+
optional int32 attack_upgrade_level = 40;
|
124
|
+
optional int32 armor_upgrade_level = 41;
|
125
|
+
optional int32 shield_upgrade_level = 42;
|
126
|
+
|
127
|
+
// Not populated for snapshots
|
128
|
+
optional float health = 14;
|
129
|
+
optional float health_max = 15;
|
130
|
+
optional float shield = 16;
|
131
|
+
optional float shield_max = 36;
|
132
|
+
optional float energy = 17;
|
133
|
+
optional float energy_max = 37;
|
134
|
+
optional int32 mineral_contents = 18;
|
135
|
+
optional int32 vespene_contents = 19;
|
136
|
+
optional bool is_flying = 20;
|
137
|
+
optional bool is_burrowed = 21;
|
138
|
+
optional bool is_hallucination = 38; // Unit is your own or detected as a hallucination.
|
139
|
+
|
140
|
+
// Not populated for enemies
|
141
|
+
repeated UnitOrder orders = 22;
|
142
|
+
optional uint64 add_on_tag = 23;
|
143
|
+
repeated PassengerUnit passengers = 24;
|
144
|
+
optional int32 cargo_space_taken = 25;
|
145
|
+
optional int32 cargo_space_max = 26;
|
146
|
+
optional int32 assigned_harvesters = 28;
|
147
|
+
optional int32 ideal_harvesters = 29;
|
148
|
+
optional float weapon_cooldown = 30;
|
149
|
+
optional uint64 engaged_target_tag = 34;
|
150
|
+
optional int32 buff_duration_remain = 43; // How long a buff or unit is still around (eg mule, broodling, chronoboost).
|
151
|
+
optional int32 buff_duration_max = 44; // How long the buff or unit is still around (eg mule, broodling, chronoboost).
|
152
|
+
repeated RallyTarget rally_targets = 45;
|
153
|
+
}
|
154
|
+
|
155
|
+
message MapState {
|
156
|
+
optional ImageData visibility = 1; // 1 byte visibility layer.
|
157
|
+
optional ImageData creep = 2; // 1 bit creep layer.
|
158
|
+
}
|
159
|
+
|
160
|
+
message Event {
|
161
|
+
repeated uint64 dead_units = 1;
|
162
|
+
}
|
163
|
+
|
164
|
+
message Effect {
|
165
|
+
optional uint32 effect_id = 1;
|
166
|
+
repeated Point2D pos = 2; // Effect may impact multiple locations. (eg. Lurker attack)
|
167
|
+
optional Alliance alliance = 3;
|
168
|
+
optional int32 owner = 4;
|
169
|
+
optional float radius = 5;
|
170
|
+
}
|
171
|
+
|
172
|
+
|
173
|
+
//
|
174
|
+
// Action
|
175
|
+
//
|
176
|
+
|
177
|
+
message ActionRaw {
|
178
|
+
oneof action {
|
179
|
+
ActionRawUnitCommand unit_command = 1;
|
180
|
+
ActionRawCameraMove camera_move = 2;
|
181
|
+
ActionRawToggleAutocast toggle_autocast = 3;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
message ActionRawUnitCommand {
|
186
|
+
optional int32 ability_id = 1;
|
187
|
+
oneof target {
|
188
|
+
Point2D target_world_space_pos = 2;
|
189
|
+
uint64 target_unit_tag = 3;
|
190
|
+
}
|
191
|
+
repeated uint64 unit_tags = 4;
|
192
|
+
optional bool queue_command = 5;
|
193
|
+
}
|
194
|
+
|
195
|
+
message ActionRawCameraMove {
|
196
|
+
optional Point center_world_space = 1;
|
197
|
+
}
|
198
|
+
|
199
|
+
message ActionRawToggleAutocast {
|
200
|
+
optional int32 ability_id = 1;
|
201
|
+
repeated uint64 unit_tags = 2;
|
202
|
+
}
|