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  ProcessInfo() = default;
13  ProcessInfo(const std::string& path, uint64_t id, int port) :
14  process_path(path),
15  process_id(id),
16  port(port) {};
17 
18  std::string process_path;
19  uint64_t process_id;
20  int port;
21 };
22 
25  ProcessSettings() = default;
26  ProcessSettings(bool in_real_time,
27  int in_step_size,
28  const std::string& in_process_path,
29  const std::string& in_net_address,
30  int in_timeout_ms,
31  int in_port_start,
32  bool in_multi_threaded = false);
33 
34  bool realtime;
35  int step_size;
36  std::string process_path;
37  std::string data_version;
38  std::string net_address;
39  int timeout_ms;
40  int port_start;
41  // Run all OnSteps in parallel.
42  bool multi_threaded;
43  std::vector<std::string> extra_command_lines;
44  // PID and port of all running sc2 processes.
45  std::vector<ProcessInfo> process_info;
46 };
47 
50  RenderSettings() = default;
51  RenderSettings(int map_x, int map_y, int minimap_x, int minimap_y)
52  : map_x(map_x), map_y(map_y), minimap_x(minimap_x), minimap_y(minimap_y)
53  {}
55  int map_x = 800;
57  int map_y = 600;
59  int minimap_x = 300;
61  int minimap_y = 300;
62 };
63 
66  FeatureLayerSettings () = default;
67  FeatureLayerSettings (float in_camera_width, int in_map_x, int in_map_y, int in_minimap_x, int in_minimap_y)
68  : 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)
69  {}
71  float camera_width = 24.0f;
73  int map_x = 64;
75  int map_y = 64;
77  int minimap_x = 64;
79  int minimap_y = 64;
80 };
81 
85 
86  bool use_feature_layers;
87  FeatureLayerSettings feature_layer_settings;
88  bool use_render;
89  RenderSettings render_settings;
90 };
91 
93 struct GameSettings {
94  GameSettings();
95 
96  std::string map_name;
97  std::vector<PlayerSetup> player_setup;
98  Ports ports;
99 };
100 
103  ReplaySettings();
104 
105  // Fill with replays to analyze.
106  std::vector<std::string> replay_file;
107  std::string replay_dir;
108  uint32_t player_id;
109 };
110 
112 enum class AppState {
113  normal, // The game application has behaved normally.
114  timeout, // A timeout has occurred, and the game application was terminated.
115  timeout_zombie, // A timeout has occurred, but the game application could not be terminated.
116  crashed // A crash has been detected.
117 };
118 
122 extern const char* kMapBelShirVestigeLE;
123 extern const char* kMapEmpty;
124 extern const char* kMapEmptyLong;
125 extern const char* kMapEmptyTall;
126 extern const char* kMapMarineMicro;
127 
128 }
Settings for an RGB rendered output.
Definition: sc2_game_settings.h:49
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:83
Settings to run the game process.
Definition: sc2_game_settings.h:24
Port setup for one or more clients in a game.
Definition: sc2_gametypes.h:110
Types used in setting up a game.
Settings for starting a replay.
Definition: sc2_game_settings.h:102
Settings for feature layer output.
Definition: sc2_game_settings.h:65
Settings for starting a game.
Definition: sc2_game_settings.h:93