SC2API
An API for AI for StarCraft II
sc2_game_settings.h
1 #pragma once
2 
3 #include "sc2api/sc2_gametypes.h"
4 
5 #include <string>
6 #include <vector>
7 
8 namespace sc2 {
9 
11 struct ProcessInfo {
12  std::string process_path;
13  uint64_t process_id;
14  int port;
15 };
16 
19  ProcessSettings(bool in_real_time,
20  int in_step_size,
21  const std::string& in_process_path,
22  const std::string& in_net_address,
23  int in_timeout_ms,
24  int in_port_start,
25  bool in_multi_threaded = false);
26 
27  bool realtime;
28  int step_size;
29  std::string process_path;
30  std::string data_version;
31  std::string net_address;
32  int timeout_ms;
33  int port_start;
34  // Run all OnSteps in parallel.
35  bool multi_threaded;
36  std::vector<std::string> extra_command_lines;
37  // PID and port of all running sc2 processes.
38  std::vector<ProcessInfo> process_info;
39 };
40 
43  RenderSettings() = default;
44  RenderSettings(int map_x, int map_y, int minimap_x, int minimap_y)
45  : map_x(map_x), map_y(map_y), minimap_x(minimap_x), minimap_y(minimap_y)
46  {}
48  int map_x = 800;
50  int map_y = 600;
52  int minimap_x = 300;
54  int minimap_y = 300;
55 };
56 
59  FeatureLayerSettings () = default;
60  FeatureLayerSettings (float in_camera_width, int in_map_x, int in_map_y, int in_minimap_x, int in_minimap_y)
61  : camera_width(in_camera_width), map_x(in_map_x), map_y(in_map_y), minimap_x(in_minimap_x), minimap_y(in_minimap_y)
62  {}
64  float camera_width = 24.0f;
66  int map_x = 64;
68  int map_y = 64;
70  int minimap_x = 64;
72  int minimap_y = 64;
73 };
74 
78 
79  bool use_feature_layers;
80  FeatureLayerSettings feature_layer_settings;
81  bool use_render;
82  RenderSettings render_settings;
83 };
84 
86 struct GameSettings {
87  GameSettings();
88 
89  std::string map_name;
90  std::vector<PlayerSetup> player_setup;
91  Ports ports;
92 };
93 
97 
98  // Fill with replays to analyze.
99  std::vector<std::string> replay_file;
100  std::string replay_dir;
101  uint32_t player_id;
102 };
103 
105 enum class AppState {
106  normal, // The game application has behaved normally.
107  timeout, // A timeout has occurred, and the game application was terminated.
108  timeout_zombie, // A timeout has occurred, but the game application could not be terminated.
109  crashed // A crash has been detected.
110 };
111 
115 extern const char* kMapBelShirVestigeLE;
116 extern const char* kMapEmpty;
117 extern const char* kMapEmptyLong;
118 extern const char* kMapEmptyTall;
119 extern const char* kMapMarineMicro;
120 
121 }
Settings for an RGB rendered output.
Definition: sc2_game_settings.h:42
Information about a running process.
Definition: sc2_game_settings.h:11
Definition: sc2_action.h:9
Settings for rendered feature layer output.
Definition: sc2_game_settings.h:76
Settings to run the game process.
Definition: sc2_game_settings.h:18
Port setup for one or more clients in a game.
Definition: sc2_gametypes.h:105
Types used in setting up a game.
Settings for starting a replay.
Definition: sc2_game_settings.h:95
Settings for feature layer output.
Definition: sc2_game_settings.h:58
Settings for starting a game.
Definition: sc2_game_settings.h:86