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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/data/data.json +1 -0
  3. data/data/data_readable.json +22842 -0
  4. data/data/sc2ai/protocol/common.proto +59 -0
  5. data/data/sc2ai/protocol/data.proto +120 -0
  6. data/data/sc2ai/protocol/debug.proto +127 -0
  7. data/data/sc2ai/protocol/error.proto +221 -0
  8. data/data/sc2ai/protocol/query.proto +55 -0
  9. data/data/sc2ai/protocol/raw.proto +202 -0
  10. data/data/sc2ai/protocol/sc2api.proto +718 -0
  11. data/data/sc2ai/protocol/score.proto +108 -0
  12. data/data/sc2ai/protocol/spatial.proto +115 -0
  13. data/data/sc2ai/protocol/ui.proto +145 -0
  14. data/data/setup/setup.SC2Map +0 -0
  15. data/data/setup/setup.SC2Replay +0 -0
  16. data/data/stableid.json +35730 -0
  17. data/data/versions.json +554 -0
  18. data/exe/sc2ai +35 -0
  19. data/lib/docker_build/Dockerfile.ruby +74 -0
  20. data/lib/docker_build/docker-compose-base-image.yml +10 -0
  21. data/lib/docker_build/docker-compose-ladderzip.yml +9 -0
  22. data/lib/sc2ai/api/ability_id.rb +1644 -0
  23. data/lib/sc2ai/api/buff_id.rb +306 -0
  24. data/lib/sc2ai/api/data.rb +101 -0
  25. data/lib/sc2ai/api/effect_id.rb +20 -0
  26. data/lib/sc2ai/api/tech_tree.rb +83 -0
  27. data/lib/sc2ai/api/tech_tree_data.rb +2338 -0
  28. data/lib/sc2ai/api/unit_type_id.rb +2022 -0
  29. data/lib/sc2ai/api/upgrade_id.rb +310 -0
  30. data/lib/sc2ai/cli/cli.rb +175 -0
  31. data/lib/sc2ai/cli/ladderzip.rb +154 -0
  32. data/lib/sc2ai/cli/new.rb +88 -0
  33. data/lib/sc2ai/configuration.rb +145 -0
  34. data/lib/sc2ai/connection/connection_listener.rb +30 -0
  35. data/lib/sc2ai/connection/requests.rb +417 -0
  36. data/lib/sc2ai/connection/status_listener.rb +15 -0
  37. data/lib/sc2ai/connection.rb +146 -0
  38. data/lib/sc2ai/local_play/client/configurable_options.rb +115 -0
  39. data/lib/sc2ai/local_play/client.rb +159 -0
  40. data/lib/sc2ai/local_play/client_manager.rb +70 -0
  41. data/lib/sc2ai/local_play/map_file.rb +48 -0
  42. data/lib/sc2ai/local_play/match.rb +184 -0
  43. data/lib/sc2ai/overrides/array.rb +14 -0
  44. data/lib/sc2ai/overrides/async/process/child.rb +31 -0
  45. data/lib/sc2ai/overrides/kernel.rb +33 -0
  46. data/lib/sc2ai/paths.rb +294 -0
  47. data/lib/sc2ai/player/actions.rb +386 -0
  48. data/lib/sc2ai/player/debug.rb +224 -0
  49. data/lib/sc2ai/player/game_state.rb +131 -0
  50. data/lib/sc2ai/player/geometry.rb +766 -0
  51. data/lib/sc2ai/player/previous_state.rb +49 -0
  52. data/lib/sc2ai/player/units.rb +337 -0
  53. data/lib/sc2ai/player.rb +661 -0
  54. data/lib/sc2ai/ports.rb +152 -0
  55. data/lib/sc2ai/protocol/_meta_documentation.rb +39 -0
  56. data/lib/sc2ai/protocol/common_pb.rb +43 -0
  57. data/lib/sc2ai/protocol/data_pb.rb +47 -0
  58. data/lib/sc2ai/protocol/debug_pb.rb +56 -0
  59. data/lib/sc2ai/protocol/error_pb.rb +36 -0
  60. data/lib/sc2ai/protocol/extensions/color.rb +20 -0
  61. data/lib/sc2ai/protocol/extensions/point.rb +23 -0
  62. data/lib/sc2ai/protocol/extensions/point_2_d.rb +26 -0
  63. data/lib/sc2ai/protocol/extensions/position.rb +202 -0
  64. data/lib/sc2ai/protocol/extensions/power_source.rb +19 -0
  65. data/lib/sc2ai/protocol/extensions/unit.rb +489 -0
  66. data/lib/sc2ai/protocol/query_pb.rb +47 -0
  67. data/lib/sc2ai/protocol/raw_pb.rb +57 -0
  68. data/lib/sc2ai/protocol/sc2api_pb.rb +130 -0
  69. data/lib/sc2ai/protocol/score_pb.rb +40 -0
  70. data/lib/sc2ai/protocol/spatial_pb.rb +48 -0
  71. data/lib/sc2ai/protocol/ui_pb.rb +56 -0
  72. data/lib/sc2ai/unit_group/action_ext.rb +74 -0
  73. data/lib/sc2ai/unit_group/filter_ext.rb +379 -0
  74. data/lib/sc2ai/unit_group.rb +277 -0
  75. data/lib/sc2ai/version.rb +2 -1
  76. data/lib/sc2ai.rb +93 -2
  77. data/lib/templates/ladderzip/bin/ladder.tt +23 -0
  78. data/lib/templates/new/.ladderignore +20 -0
  79. data/lib/templates/new/Gemfile.tt +7 -0
  80. data/lib/templates/new/api/common.proto +59 -0
  81. data/lib/templates/new/api/data.proto +120 -0
  82. data/lib/templates/new/api/debug.proto +127 -0
  83. data/lib/templates/new/api/error.proto +221 -0
  84. data/lib/templates/new/api/query.proto +55 -0
  85. data/lib/templates/new/api/raw.proto +202 -0
  86. data/lib/templates/new/api/sc2api.proto +718 -0
  87. data/lib/templates/new/api/score.proto +108 -0
  88. data/lib/templates/new/api/spatial.proto +115 -0
  89. data/lib/templates/new/api/ui.proto +145 -0
  90. data/lib/templates/new/boot.rb.tt +6 -0
  91. data/lib/templates/new/my_bot.rb.tt +23 -0
  92. data/lib/templates/new/run_example_match.rb.tt +14 -0
  93. data/sc2ai.gemspec +80 -0
  94. metadata +344 -13
@@ -0,0 +1,59 @@
1
+
2
+ syntax = "proto2";
3
+
4
+ package Api;
5
+
6
+ message AvailableAbility {
7
+ optional int32 ability_id = 1;
8
+ optional bool requires_point = 2;
9
+ }
10
+
11
+ message ImageData {
12
+ optional int32 bits_per_pixel = 1; // Number of bits per pixel; 8 bits for a byte etc.
13
+ optional Size2DI size = 2; // Dimension in pixels.
14
+ optional bytes data = 3; // Binary data; the size of this buffer in bytes is width * height * bits_per_pixel / 8.
15
+ }
16
+
17
+ // Point on the screen/minimap (e.g., 0..64).
18
+ // Note: bottom left of the screen is 0, 0.
19
+ message PointI {
20
+ optional int32 x = 1;
21
+ optional int32 y = 2;
22
+ }
23
+
24
+ // Screen space rectangular area.
25
+ message RectangleI {
26
+ optional PointI p0 = 1;
27
+ optional PointI p1 = 2;
28
+ }
29
+
30
+ // Point on the game board, 0..255.
31
+ // Note: bottom left of the screen is 0, 0.
32
+ message Point2D {
33
+ optional float x = 1;
34
+ optional float y = 2;
35
+ }
36
+
37
+ // Point on the game board, 0..255.
38
+ // Note: bottom left of the screen is 0, 0.
39
+ message Point {
40
+ optional float x = 1;
41
+ optional float y = 2;
42
+ optional float z = 3;
43
+ }
44
+
45
+ // Screen dimensions.
46
+ message Size2DI {
47
+ optional int32 x = 1;
48
+ optional int32 y = 2;
49
+ }
50
+
51
+ enum Race {
52
+ NoRace = 0;
53
+ Terran = 1;
54
+ Zerg = 2;
55
+ Protoss = 3;
56
+ Random = 4;
57
+ }
58
+
59
+
@@ -0,0 +1,120 @@
1
+
2
+ syntax = "proto2";
3
+
4
+ package Api;
5
+
6
+ import "sc2ai/protocol/common.proto";
7
+
8
+ // May not relevant: queueable (everything is queueable).
9
+ // May not be important: AbilSetId - marine stim, marauder stim.
10
+ // Stuff omitted: transient.
11
+ // Stuff that may be important: cost, range, Alignment, targetfilters.
12
+ message AbilityData {
13
+ optional uint32 ability_id = 1; // Stable ID.
14
+ optional string link_name = 2; // Catalog name of the ability.
15
+ optional uint32 link_index = 3; // Catalog index of the ability.
16
+ optional string button_name = 4; // Name used for the command card. May not always be set.
17
+ optional string friendly_name = 5; // A human friendly name when the button name or link name isn't descriptive.
18
+ optional string hotkey = 6; // Hotkey. May not always be set.
19
+ optional uint32 remaps_to_ability_id = 7; // This ability id may be represented by the given more generic id.
20
+
21
+ enum Target {
22
+ None = 1; // Does not require a target.
23
+ Point = 2; // Requires a target position.
24
+ Unit = 3; // Requires a unit to target. Given by position using feature layers.
25
+ PointOrUnit = 4; // Requires either a target point or target unit.
26
+ PointOrNone = 5; // Requires either a target point or no target. (eg. building add-ons)
27
+ }
28
+
29
+ optional bool available = 8; // If true, the ability may be used by this set of mods/map.
30
+ optional Target target = 9; // Determines if a point is optional or required.
31
+ optional bool allow_minimap = 10; // Can be cast in the minimap.
32
+ optional bool allow_autocast = 11; // Autocast can be set.
33
+ optional bool is_building = 12; // Requires placement to construct a building.
34
+ optional float footprint_radius = 13; // Estimation of the footprint size. Need a better footprint.
35
+ optional bool is_instant_placement = 14; // Placement next to an existing structure, e.g., an add-on like a Tech Lab.
36
+ optional float cast_range = 15; // Range unit can cast ability without needing to approach target.
37
+ }
38
+
39
+ enum Attribute {
40
+ Light = 1;
41
+ Armored = 2;
42
+ Biological = 3;
43
+ Mechanical = 4;
44
+ Robotic = 5;
45
+ Psionic = 6;
46
+ Massive = 7;
47
+ Structure = 8;
48
+ Hover = 9;
49
+ Heroic = 10;
50
+ Summoned = 11;
51
+ }
52
+
53
+ message DamageBonus {
54
+ optional Attribute attribute = 1;
55
+ optional float bonus = 2;
56
+ }
57
+
58
+ message Weapon {
59
+ enum TargetType {
60
+ Ground = 1;
61
+ Air = 2;
62
+ Any = 3;
63
+ }
64
+ optional TargetType type = 1;
65
+ optional float damage = 2;
66
+ repeated DamageBonus damage_bonus = 3;
67
+ optional uint32 attacks = 4; // Number of hits per attack. (eg. Colossus has 2 beams)
68
+ optional float range = 5;
69
+ optional float speed = 6; // Time between attacks.
70
+ }
71
+
72
+ message UnitTypeData {
73
+ optional uint32 unit_id = 1; // Stable ID.
74
+ optional string name = 2; // Catalog name of the unit.
75
+ optional bool available = 3; // If true, the ability may be used by this set of mods/map.
76
+ optional uint32 cargo_size = 4; // Number of cargo slots it occupies in transports.
77
+ optional uint32 mineral_cost = 12;
78
+ optional uint32 vespene_cost = 13;
79
+ optional float food_required = 14;
80
+ optional float food_provided = 18;
81
+ optional uint32 ability_id = 15; // The ability that builds this unit.
82
+ optional Race race = 16;
83
+ optional float build_time = 17;
84
+ optional bool has_vespene = 19;
85
+ optional bool has_minerals = 20;
86
+ optional float sight_range = 25; // Range unit reveals vision.
87
+
88
+ repeated uint32 tech_alias = 21; // Other units that satisfy the same tech requirement.
89
+ optional uint32 unit_alias = 22; // The morphed variant of this unit.
90
+
91
+ optional uint32 tech_requirement = 23; // Structure required to build this unit. (Or any with the same tech_alias)
92
+ optional bool require_attached = 24; // Whether tech_requirement is an add-on.
93
+
94
+ // Values include changes from upgrades
95
+ repeated Attribute attributes = 8;
96
+ optional float movement_speed = 9;
97
+ optional float armor = 10;
98
+ repeated Weapon weapons = 11;
99
+ }
100
+
101
+ message UpgradeData {
102
+ optional uint32 upgrade_id = 1; // Stable ID.
103
+ optional string name = 2;
104
+ optional uint32 mineral_cost = 3;
105
+ optional uint32 vespene_cost = 4;
106
+ optional float research_time = 5;
107
+ optional uint32 ability_id = 6;
108
+ }
109
+
110
+ message BuffData {
111
+ optional uint32 buff_id = 1; // Stable ID.
112
+ optional string name = 2;
113
+ }
114
+
115
+ message EffectData {
116
+ optional uint32 effect_id = 1; // Stable ID.
117
+ optional string name = 2;
118
+ optional string friendly_name = 3;
119
+ optional float radius = 4;
120
+ }
@@ -0,0 +1,127 @@
1
+
2
+ syntax = "proto2";
3
+
4
+ package Api;
5
+
6
+ import "sc2ai/protocol/common.proto";
7
+
8
+ // Issue various useful commands to the game engine.
9
+ message DebugCommand {
10
+ oneof command {
11
+ DebugDraw draw = 1;
12
+ DebugGameState game_state = 2;
13
+ DebugCreateUnit create_unit = 3;
14
+ DebugKillUnit kill_unit = 4;
15
+ DebugTestProcess test_process = 5;
16
+ DebugSetScore score = 6; // Useful only for single-player "curriculum" maps.
17
+ DebugEndGame end_game = 7;
18
+ DebugSetUnitValue unit_value = 8;
19
+ }
20
+ }
21
+
22
+ message DebugDraw {
23
+ repeated DebugText text = 1;
24
+ repeated DebugLine lines = 2;
25
+ repeated DebugBox boxes = 3;
26
+ repeated DebugSphere spheres = 4;
27
+ }
28
+
29
+ message Line {
30
+ optional Point p0 = 1;
31
+ optional Point p1 = 2;
32
+ }
33
+
34
+ message Color {
35
+ optional uint32 r = 1;
36
+ optional uint32 g = 2;
37
+ optional uint32 b = 3;
38
+ }
39
+
40
+ // Display debug text on screen.
41
+ message DebugText {
42
+ optional Color color = 1;
43
+ optional string text = 2; // Text to display.
44
+ optional Point virtual_pos = 3; // Virtualized position in 2D (the screen is 0..1, 0..1 for any resolution).
45
+ optional Point world_pos = 4; // Position in the world.
46
+ optional uint32 size = 5; // Pixel height of the text. Defaults to 8px.
47
+ }
48
+
49
+ // Display debug lines on screen.
50
+ message DebugLine {
51
+ optional Color color = 1;
52
+ optional Line line = 2; // World space line.
53
+ }
54
+
55
+ // Display debug boxes on screen.
56
+ message DebugBox {
57
+ optional Color color = 1;
58
+ optional Point min = 2;
59
+ optional Point max = 3;
60
+ }
61
+
62
+ // Display debug spheres on screen.
63
+ message DebugSphere {
64
+ optional Color color = 1;
65
+ optional Point p = 2;
66
+ optional float r = 3;
67
+ }
68
+
69
+ enum DebugGameState {
70
+ show_map = 1;
71
+ control_enemy = 2;
72
+ food = 3;
73
+ free = 4;
74
+ all_resources = 5;
75
+ god = 6;
76
+ minerals = 7;
77
+ gas = 8;
78
+ cooldown = 9;
79
+ tech_tree = 10;
80
+ upgrade = 11;
81
+ fast_build = 12;
82
+ }
83
+
84
+ message DebugCreateUnit {
85
+ optional uint32 unit_type = 1;
86
+ optional int32 owner = 2;
87
+ optional Point2D pos = 3;
88
+ optional uint32 quantity = 4;
89
+ }
90
+
91
+ message DebugKillUnit {
92
+ repeated uint64 tag = 1;
93
+ }
94
+
95
+ message DebugTestProcess {
96
+ enum Test {
97
+ hang = 1;
98
+ crash = 2;
99
+ exit = 3;
100
+ }
101
+ optional Test test = 1;
102
+ optional int32 delay_ms = 2;
103
+ }
104
+
105
+ message DebugSetScore {
106
+ optional float score = 1;
107
+ }
108
+
109
+ message DebugEndGame {
110
+ enum EndResult {
111
+ Surrender = 1; // Default if nothing is set. The current player admits defeat.
112
+ DeclareVictory = 2;
113
+ }
114
+ optional EndResult end_result = 1;
115
+ }
116
+
117
+ message DebugSetUnitValue {
118
+ enum UnitValue {
119
+ Energy = 1;
120
+ Life = 2;
121
+ Shields = 3;
122
+ }
123
+ optional UnitValue unit_value = 1;
124
+ optional float value = 2;
125
+ optional uint64 unit_tag = 3;
126
+ }
127
+
@@ -0,0 +1,221 @@
1
+
2
+ syntax = "proto2";
3
+
4
+ package Api;
5
+
6
+ enum ActionResult {
7
+ Success = 1;
8
+ NotSupported = 2;
9
+ Error = 3;
10
+ CantQueueThatOrder = 4;
11
+ Retry = 5;
12
+ Cooldown = 6;
13
+ QueueIsFull = 7;
14
+ RallyQueueIsFull = 8;
15
+ NotEnoughMinerals = 9;
16
+ NotEnoughVespene = 10;
17
+ NotEnoughTerrazine = 11;
18
+ NotEnoughCustom = 12;
19
+ NotEnoughFood = 13;
20
+ FoodUsageImpossible = 14;
21
+ NotEnoughLife = 15;
22
+ NotEnoughShields = 16;
23
+ NotEnoughEnergy = 17;
24
+ LifeSuppressed = 18;
25
+ ShieldsSuppressed = 19;
26
+ EnergySuppressed = 20;
27
+ NotEnoughCharges = 21;
28
+ CantAddMoreCharges = 22;
29
+ TooMuchMinerals = 23;
30
+ TooMuchVespene = 24;
31
+ TooMuchTerrazine = 25;
32
+ TooMuchCustom = 26;
33
+ TooMuchFood = 27;
34
+ TooMuchLife = 28;
35
+ TooMuchShields = 29;
36
+ TooMuchEnergy = 30;
37
+ MustTargetUnitWithLife = 31;
38
+ MustTargetUnitWithShields = 32;
39
+ MustTargetUnitWithEnergy = 33;
40
+ CantTrade = 34;
41
+ CantSpend = 35;
42
+ CantTargetThatUnit = 36;
43
+ CouldntAllocateUnit = 37;
44
+ UnitCantMove = 38;
45
+ TransportIsHoldingPosition = 39;
46
+ BuildTechRequirementsNotMet = 40;
47
+ CantFindPlacementLocation = 41;
48
+ CantBuildOnThat = 42;
49
+ CantBuildTooCloseToDropOff = 43;
50
+ CantBuildLocationInvalid = 44;
51
+ CantSeeBuildLocation = 45;
52
+ CantBuildTooCloseToCreepSource = 46;
53
+ CantBuildTooCloseToResources = 47;
54
+ CantBuildTooFarFromWater = 48;
55
+ CantBuildTooFarFromCreepSource = 49;
56
+ CantBuildTooFarFromBuildPowerSource = 50;
57
+ CantBuildOnDenseTerrain = 51;
58
+ CantTrainTooFarFromTrainPowerSource = 52;
59
+ CantLandLocationInvalid = 53;
60
+ CantSeeLandLocation = 54;
61
+ CantLandTooCloseToCreepSource = 55;
62
+ CantLandTooCloseToResources = 56;
63
+ CantLandTooFarFromWater = 57;
64
+ CantLandTooFarFromCreepSource = 58;
65
+ CantLandTooFarFromBuildPowerSource = 59;
66
+ CantLandTooFarFromTrainPowerSource = 60;
67
+ CantLandOnDenseTerrain = 61;
68
+ AddOnTooFarFromBuilding = 62;
69
+ MustBuildRefineryFirst = 63;
70
+ BuildingIsUnderConstruction = 64;
71
+ CantFindDropOff = 65;
72
+ CantLoadOtherPlayersUnits = 66;
73
+ NotEnoughRoomToLoadUnit = 67;
74
+ CantUnloadUnitsThere = 68;
75
+ CantWarpInUnitsThere = 69;
76
+ CantLoadImmobileUnits = 70;
77
+ CantRechargeImmobileUnits = 71;
78
+ CantRechargeUnderConstructionUnits = 72;
79
+ CantLoadThatUnit = 73;
80
+ NoCargoToUnload = 74;
81
+ LoadAllNoTargetsFound = 75;
82
+ NotWhileOccupied = 76;
83
+ CantAttackWithoutAmmo = 77;
84
+ CantHoldAnyMoreAmmo = 78;
85
+ TechRequirementsNotMet = 79;
86
+ MustLockdownUnitFirst = 80;
87
+ MustTargetUnit = 81;
88
+ MustTargetInventory = 82;
89
+ MustTargetVisibleUnit = 83;
90
+ MustTargetVisibleLocation = 84;
91
+ MustTargetWalkableLocation = 85;
92
+ MustTargetPawnableUnit = 86;
93
+ YouCantControlThatUnit = 87;
94
+ YouCantIssueCommandsToThatUnit = 88;
95
+ MustTargetResources = 89;
96
+ RequiresHealTarget = 90;
97
+ RequiresRepairTarget = 91;
98
+ NoItemsToDrop = 92;
99
+ CantHoldAnyMoreItems = 93;
100
+ CantHoldThat = 94;
101
+ TargetHasNoInventory = 95;
102
+ CantDropThisItem = 96;
103
+ CantMoveThisItem = 97;
104
+ CantPawnThisUnit = 98;
105
+ MustTargetCaster = 99;
106
+ CantTargetCaster = 100;
107
+ MustTargetOuter = 101;
108
+ CantTargetOuter = 102;
109
+ MustTargetYourOwnUnits = 103;
110
+ CantTargetYourOwnUnits = 104;
111
+ MustTargetFriendlyUnits = 105;
112
+ CantTargetFriendlyUnits = 106;
113
+ MustTargetNeutralUnits = 107;
114
+ CantTargetNeutralUnits = 108;
115
+ MustTargetEnemyUnits = 109;
116
+ CantTargetEnemyUnits = 110;
117
+ MustTargetAirUnits = 111;
118
+ CantTargetAirUnits = 112;
119
+ MustTargetGroundUnits = 113;
120
+ CantTargetGroundUnits = 114;
121
+ MustTargetStructures = 115;
122
+ CantTargetStructures = 116;
123
+ MustTargetLightUnits = 117;
124
+ CantTargetLightUnits = 118;
125
+ MustTargetArmoredUnits = 119;
126
+ CantTargetArmoredUnits = 120;
127
+ MustTargetBiologicalUnits = 121;
128
+ CantTargetBiologicalUnits = 122;
129
+ MustTargetHeroicUnits = 123;
130
+ CantTargetHeroicUnits = 124;
131
+ MustTargetRoboticUnits = 125;
132
+ CantTargetRoboticUnits = 126;
133
+ MustTargetMechanicalUnits = 127;
134
+ CantTargetMechanicalUnits = 128;
135
+ MustTargetPsionicUnits = 129;
136
+ CantTargetPsionicUnits = 130;
137
+ MustTargetMassiveUnits = 131;
138
+ CantTargetMassiveUnits = 132;
139
+ MustTargetMissile = 133;
140
+ CantTargetMissile = 134;
141
+ MustTargetWorkerUnits = 135;
142
+ CantTargetWorkerUnits = 136;
143
+ MustTargetEnergyCapableUnits = 137;
144
+ CantTargetEnergyCapableUnits = 138;
145
+ MustTargetShieldCapableUnits = 139;
146
+ CantTargetShieldCapableUnits = 140;
147
+ MustTargetFlyers = 141;
148
+ CantTargetFlyers = 142;
149
+ MustTargetBuriedUnits = 143;
150
+ CantTargetBuriedUnits = 144;
151
+ MustTargetCloakedUnits = 145;
152
+ CantTargetCloakedUnits = 146;
153
+ MustTargetUnitsInAStasisField = 147;
154
+ CantTargetUnitsInAStasisField = 148;
155
+ MustTargetUnderConstructionUnits = 149;
156
+ CantTargetUnderConstructionUnits = 150;
157
+ MustTargetDeadUnits = 151;
158
+ CantTargetDeadUnits = 152;
159
+ MustTargetRevivableUnits = 153;
160
+ CantTargetRevivableUnits = 154;
161
+ MustTargetHiddenUnits = 155;
162
+ CantTargetHiddenUnits = 156;
163
+ CantRechargeOtherPlayersUnits = 157;
164
+ MustTargetHallucinations = 158;
165
+ CantTargetHallucinations = 159;
166
+ MustTargetInvulnerableUnits = 160;
167
+ CantTargetInvulnerableUnits = 161;
168
+ MustTargetDetectedUnits = 162;
169
+ CantTargetDetectedUnits = 163;
170
+ CantTargetUnitWithEnergy = 164;
171
+ CantTargetUnitWithShields = 165;
172
+ MustTargetUncommandableUnits = 166;
173
+ CantTargetUncommandableUnits = 167;
174
+ MustTargetPreventDefeatUnits = 168;
175
+ CantTargetPreventDefeatUnits = 169;
176
+ MustTargetPreventRevealUnits = 170;
177
+ CantTargetPreventRevealUnits = 171;
178
+ MustTargetPassiveUnits = 172;
179
+ CantTargetPassiveUnits = 173;
180
+ MustTargetStunnedUnits = 174;
181
+ CantTargetStunnedUnits = 175;
182
+ MustTargetSummonedUnits = 176;
183
+ CantTargetSummonedUnits = 177;
184
+ MustTargetUser1 = 178;
185
+ CantTargetUser1 = 179;
186
+ MustTargetUnstoppableUnits = 180;
187
+ CantTargetUnstoppableUnits = 181;
188
+ MustTargetResistantUnits = 182;
189
+ CantTargetResistantUnits = 183;
190
+ MustTargetDazedUnits = 184;
191
+ CantTargetDazedUnits = 185;
192
+ CantLockdown = 186;
193
+ CantMindControl = 187;
194
+ MustTargetDestructibles = 188;
195
+ CantTargetDestructibles = 189;
196
+ MustTargetItems = 190;
197
+ CantTargetItems = 191;
198
+ NoCalldownAvailable = 192;
199
+ WaypointListFull = 193;
200
+ MustTargetRace = 194;
201
+ CantTargetRace = 195;
202
+ MustTargetSimilarUnits = 196;
203
+ CantTargetSimilarUnits = 197;
204
+ CantFindEnoughTargets = 198;
205
+ AlreadySpawningLarva = 199;
206
+ CantTargetExhaustedResources = 200;
207
+ CantUseMinimap = 201;
208
+ CantUseInfoPanel = 202;
209
+ OrderQueueIsFull = 203;
210
+ CantHarvestThatResource = 204;
211
+ HarvestersNotRequired = 205;
212
+ AlreadyTargeted = 206;
213
+ CantAttackWeaponsDisabled = 207;
214
+ CouldntReachTarget = 208;
215
+ TargetIsOutOfRange = 209;
216
+ TargetIsTooClose = 210;
217
+ TargetIsOutOfArc = 211;
218
+ CantFindTeleportLocation = 212;
219
+ InvalidItemClass = 213;
220
+ CantFindCancelOrder = 214;
221
+ }
@@ -0,0 +1,55 @@
1
+
2
+ syntax = "proto2";
3
+
4
+ package Api;
5
+
6
+ import "sc2ai/protocol/common.proto";
7
+ import "sc2ai/protocol/error.proto";
8
+
9
+ message RequestQuery {
10
+ repeated RequestQueryPathing pathing = 1;
11
+ repeated RequestQueryAvailableAbilities abilities = 2;
12
+ repeated RequestQueryBuildingPlacement placements = 3;
13
+ optional bool ignore_resource_requirements = 4; // Ignores requirements like food, minerals and so on.
14
+ }
15
+
16
+ message ResponseQuery {
17
+ repeated ResponseQueryPathing pathing = 1;
18
+ repeated ResponseQueryAvailableAbilities abilities = 2;
19
+ repeated ResponseQueryBuildingPlacement placements = 3;
20
+ }
21
+
22
+ //--------------------------------------------------------------------------------------------------
23
+ message RequestQueryPathing {
24
+ oneof start {
25
+ Point2D start_pos = 1;
26
+ uint64 unit_tag = 2;
27
+ }
28
+ optional Point2D end_pos = 3;
29
+ }
30
+
31
+ message ResponseQueryPathing {
32
+ optional float distance = 1; // 0 if no path exists
33
+ }
34
+
35
+ //--------------------------------------------------------------------------------------------------
36
+ message RequestQueryAvailableAbilities {
37
+ optional uint64 unit_tag = 1;
38
+ }
39
+
40
+ message ResponseQueryAvailableAbilities {
41
+ repeated AvailableAbility abilities = 1;
42
+ optional uint64 unit_tag = 2;
43
+ optional uint32 unit_type_id = 3;
44
+ }
45
+
46
+ //--------------------------------------------------------------------------------------------------
47
+ message RequestQueryBuildingPlacement {
48
+ optional int32 ability_id = 1;
49
+ optional Point2D target_pos = 2;
50
+ optional uint64 placing_unit_tag = 3; // Not required
51
+ }
52
+
53
+ message ResponseQueryBuildingPlacement {
54
+ optional ActionResult result = 1;
55
+ }