Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions s2clientprotocol/common.proto
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@

syntax = "proto2";
syntax = "proto3";

package SC2APIProtocol;

message AvailableAbility {
optional int32 ability_id = 1;
optional bool requires_point = 2;
int32 ability_id = 1;
bool requires_point = 2;
}

message ImageData {
optional int32 bits_per_pixel = 1; // Number of bits per pixel; 8 bits for a byte etc.
optional Size2DI size = 2; // Dimension in pixels.
optional bytes data = 3; // Binary data; the size of this buffer in bytes is width * height * bits_per_pixel / 8.
int32 bits_per_pixel = 1; // Number of bits per pixel; 8 bits for a byte etc.
Size2DI size = 2; // Dimension in pixels.
bytes data = 3; // Binary data; the size of this buffer in bytes is width * height * bits_per_pixel / 8.
}

// Point on the screen/minimap (e.g., 0..64).
// Note: bottom left of the screen is 0, 0.
message PointI {
optional int32 x = 1;
optional int32 y = 2;
int32 x = 1;
int32 y = 2;
}

// Screen space rectangular area.
message RectangleI {
optional PointI p0 = 1;
optional PointI p1 = 2;
PointI p0 = 1;
PointI p1 = 2;
}

// Point on the game board, 0..255.
// Note: bottom left of the screen is 0, 0.
message Point2D {
optional float x = 1;
optional float y = 2;
float x = 1;
float y = 2;
}

// Point on the game board, 0..255.
// Note: bottom left of the screen is 0, 0.
message Point {
optional float x = 1;
optional float y = 2;
optional float z = 3;
float x = 1;
float y = 2;
float z = 3;
}

// Screen dimensions.
message Size2DI {
optional int32 x = 1;
optional int32 y = 2;
int32 x = 1;
int32 y = 2;
}

enum Race {
Expand Down
102 changes: 53 additions & 49 deletions s2clientprotocol/data.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

syntax = "proto2";
syntax = "proto3";

package SC2APIProtocol;

Expand All @@ -10,33 +10,36 @@ import "s2clientprotocol/common.proto";
// Stuff omitted: transient.
// Stuff that may be important: cost, range, Alignment, targetfilters.
message AbilityData {
optional uint32 ability_id = 1; // Stable ID.
optional string link_name = 2; // Catalog name of the ability.
optional uint32 link_index = 3; // Catalog index of the ability.
optional string button_name = 4; // Name used for the command card. May not always be set.
optional string friendly_name = 5; // A human friendly name when the button name or link name isn't descriptive.
optional string hotkey = 6; // Hotkey. May not always be set.
optional uint32 remaps_to_ability_id = 7; // This ability id may be represented by the given more generic id.
uint32 ability_id = 1; // Stable ID.
string link_name = 2; // Catalog name of the ability.
uint32 link_index = 3; // Catalog index of the ability.
string button_name = 4; // Name used for the command card. May not always be set.
string friendly_name = 5; // A human friendly name when the button name or link name isn't descriptive.
string hotkey = 6; // Hotkey. May not always be set.
uint32 remaps_to_ability_id = 7; // This ability id may be represented by the given more generic id.

enum Target {
Target_UNSET = 0;
None = 1; // Does not require a target.
Point = 2; // Requires a target position.
Unit = 3; // Requires a unit to target. Given by position using feature layers.
PointOrUnit = 4; // Requires either a target point or target unit.
PointOrNone = 5; // Requires either a target point or no target. (eg. building add-ons)
}

optional bool available = 8; // If true, the ability may be used by this set of mods/map.
optional Target target = 9; // Determines if a point is optional or required.
optional bool allow_minimap = 10; // Can be cast in the minimap.
optional bool allow_autocast = 11; // Autocast can be set.
optional bool is_building = 12; // Requires placement to construct a building.
optional float footprint_radius = 13; // Estimation of the footprint size. Need a better footprint.
optional bool is_instant_placement = 14; // Placement next to an existing structure, e.g., an add-on like a Tech Lab.
optional float cast_range = 15; // Range unit can cast ability without needing to approach target.
bool available = 8; // If true, the ability may be used by this set of mods/map.
Target target = 9; // Determines if a point is optional or required.
bool allow_minimap = 10; // Can be cast in the minimap.
bool allow_autocast = 11; // Autocast can be set.
bool is_building = 12; // Requires placement to construct a building.
float footprint_radius = 13; // Estimation of the footprint size. Need a better footprint.
bool is_instant_placement = 14; // Placement next to an existing structure, e.g., an add-on like a Tech Lab.
float cast_range = 15; // Range unit can cast ability without needing to approach target.

}

enum Attribute {
Attribute_UNSET = 0;
Light = 1;
Armored = 2;
Biological = 3;
Expand All @@ -51,62 +54,63 @@ enum Attribute {
}

message DamageBonus {
optional Attribute attribute = 1;
optional float bonus = 2;
Attribute attribute = 1;
float bonus = 2;
}

message Weapon {
enum TargetType {
TargetType_UNSET = 0;
Ground = 1;
Air = 2;
Any = 3;
}
optional TargetType type = 1;
optional float damage = 2;
TargetType type = 1;
float damage = 2;
repeated DamageBonus damage_bonus = 3;
optional uint32 attacks = 4; // Number of hits per attack. (eg. Colossus has 2 beams)
optional float range = 5;
optional float speed = 6; // Time between attacks.
uint32 attacks = 4; // Number of hits per attack. (eg. Colossus has 2 beams)
float range = 5;
float speed = 6; // Time between attacks.
}

message UnitTypeData {
optional uint32 unit_id = 1; // Stable ID.
optional string name = 2; // Catalog name of the unit.
optional bool available = 3; // If true, the ability may be used by this set of mods/map.
optional uint32 cargo_size = 4; // Number of cargo slots it occupies in transports.
optional uint32 mineral_cost = 12;
optional uint32 vespene_cost = 13;
optional float food_required = 14;
optional float food_provided = 18;
optional uint32 ability_id = 15; // This is the ability the builds the unit
optional Race race = 16;
optional float build_time = 17;
optional bool has_vespene = 19;
optional bool has_minerals = 20;
uint32 unit_id = 1; // Stable ID.
string name = 2; // Catalog name of the unit.
bool available = 3; // If true, the ability may be used by this set of mods/map.
uint32 cargo_size = 4; // Number of cargo slots it occupies in transports.
uint32 mineral_cost = 12;
uint32 vespene_cost = 13;
float food_required = 14;
float food_provided = 18;
uint32 ability_id = 15; // This is the ability the builds the unit
Race race = 16;
float build_time = 17;
bool has_vespene = 19;
bool has_minerals = 20;

repeated uint32 tech_alias = 21; // Units this is equivalent to in terms of satisfying tech requirement.
optional uint32 unit_alias = 22; // Units that are morphed variants of the same unit.
uint32 unit_alias = 22; // Units that are morphed variants of the same unit.

optional uint32 tech_requirement = 23; // Structure required to build this unit. (Or any with the same tech_alias)
optional bool require_attached = 24; // Whether tech_requirement is an add-on.
uint32 tech_requirement = 23; // Structure required to build this unit. (Or any with the same tech_alias)
bool require_attached = 24; // Whether tech_requirement is an add-on.

// Values include changes from upgrades
repeated Attribute attributes = 8;
optional float movement_speed = 9;
optional float armor = 10;
float movement_speed = 9;
float armor = 10;
repeated Weapon weapons = 11;
}

message UpgradeData {
optional uint32 upgrade_id = 1; // Stable ID.
optional string name = 2;
optional uint32 mineral_cost = 3;
optional uint32 vespene_cost = 4;
optional float research_time = 5;
optional uint32 ability_id = 6;
uint32 upgrade_id = 1; // Stable ID.
string name = 2;
uint32 mineral_cost = 3;
uint32 vespene_cost = 4;
float research_time = 5;
uint32 ability_id = 6;
}

message BuffData {
optional uint32 buff_id = 1; // Stable ID.
optional string name = 2;
uint32 buff_id = 1; // Stable ID.
string name = 2;
}
64 changes: 34 additions & 30 deletions s2clientprotocol/debug.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

syntax = "proto2";
syntax = "proto3";

package SC2APIProtocol;

Expand Down Expand Up @@ -28,45 +28,46 @@ message DebugDraw {
}

message Line {
optional Point p0 = 1;
optional Point p1 = 2;
Point p0 = 1;
Point p1 = 2;
}

message Color {
optional uint32 r = 1;
optional uint32 g = 2;
optional uint32 b = 3;
uint32 r = 1;
uint32 g = 2;
uint32 b = 3;
}

// Display debug text on screen.
message DebugText {
optional Color color = 1;
optional string text = 2; // Text to display.
optional Point virtual_pos = 3; // Virtualized position in 2D (the screen is 0..1, 0..1 for any resolution).
optional Point world_pos = 4; // Position in the world.
Color color = 1;
string text = 2; // Text to display.
Point virtual_pos = 3; // Virtualized position in 2D (the screen is 0..1, 0..1 for any resolution).
Point world_pos = 4; // Position in the world.
}

// Display debug lines on screen.
message DebugLine {
optional Color color = 1;
optional Line line = 2; // World space line.
Color color = 1;
Line line = 2; // World space line.
}

// Display debug boxes on screen.
message DebugBox {
optional Color color = 1;
optional Point min = 2;
optional Point max = 3;
Color color = 1;
Point min = 2;
Point max = 3;
}

// Display debug spheres on screen.
message DebugSphere {
optional Color color = 1;
optional Point p = 2;
optional float r = 3;
Color color = 1;
Point p = 2;
float r = 3;
}

enum DebugGameState {
DebugGameState_UNSET = 0;
show_map = 1;
control_enemy = 2;
food = 3;
Expand All @@ -82,10 +83,10 @@ enum DebugGameState {
}

message DebugCreateUnit {
optional uint32 unit_type = 1;
optional int32 owner = 2;
optional Point2D pos = 3;
optional uint32 quantity = 4;
uint32 unit_type = 1;
int32 owner = 2;
Point2D pos = 3;
uint32 quantity = 4;
}

message DebugKillUnit {
Expand All @@ -94,37 +95,40 @@ message DebugKillUnit {

message DebugTestProcess {
enum Test {
UNSET = 0;
hang = 1;
crash = 2;
exit = 3;
}
optional Test test = 1;
optional int32 delay_ms = 2;
Test test = 1;
int32 delay_ms = 2;
}

message DebugSetScore {
optional float score = 1;
float score = 1;
}

message DebugEndGame {
enum EndResult {
EndResult_UNSET = 0;
Surrender = 1; // Default if nothing is set. The current player admits defeat.
DeclareVictory = 2;
}
optional EndResult end_result = 1;
EndResult end_result = 1;
}

message DebugSetUnitValue {
enum UnitValue {
UnitValue_UNSET = 0;
Energy = 1;
Life = 2;
Shields = 3;
}
optional UnitValue unit_value = 1;
optional float value = 2;
optional uint64 unit_tag = 3;
UnitValue unit_value = 1;
float value = 2;
uint64 unit_tag = 3;
}

message DebugChat {
optional string message = 1;
string message = 1;
}
3 changes: 2 additions & 1 deletion s2clientprotocol/error.proto
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

syntax = "proto2";
syntax = "proto3";

package SC2APIProtocol;

enum ActionResult {
ActionResult_UNSET = 0;
Success = 1;
NotSupported = 2;
Error = 3;
Expand Down
Loading