10 #include <cereal/archives/binary.hpp> 12 #include "fmt/format.h" 13 #include "gameutils/scenariospecification.h" 30 template <
class Archive>
32 ar(type, x, y, health, shields, energy);
44 std::vector<SnapshotUnit>
units;
46 template <
class Archive>
48 ar(upgradeLevels, techs, units);
54 int getUpgradeLevel(
int upgradeId)
const;
65 std::vector<SnapshotPlayer> players = {{}, {}};
70 template <
class Archive>
91 int cooldownFramesMax = 24 * 10;
94 int maxSnapshots = 20;
96 virtual std::string outputDirectory();
97 std::string snapshotName =
"snapshot";
103 int cooldownFrames_ = 0;
void serialize(Archive &ar)
Definition: snapshotter.h:31
A low-resolution snapshot of a player state, used as a component of Snapshots.
Definition: snapshotter.h:38
int mapBuildTileHeight
Definition: snapshotter.h:67
std::vector< SnapshotUnit > units
Definition: snapshotter.h:44
Records "snapshots" – low-fidelity recordings of game state which can be loaded as micro scenarios...
Definition: snapshotter.h:83
std::string mapTitle
Definition: snapshotter.h:68
int64_t upgrades
Definition: snapshotter.h:41
int y
Definition: snapshotter.h:23
int x
Definition: snapshotter.h:22
int64_t upgradeLevels
Definition: snapshotter.h:42
void saveSnapshot(const Snapshot &snapshot, const std::string &path)
Definition: snapshotter.cpp:164
bool hasTech(const BuildState &st, const BuildType *type)
Returns true if we have this tech in this BuildState.
Definition: autobuild.cpp:73
int health
Definition: snapshotter.h:24
A low-resolution snapshot of a game state, intended for producing micro training scenarios.
Definition: snapshotter.h:64
FixedScenario snapshotToScenario(const Snapshot &snapshot)
Definition: snapshotter.cpp:13
int mapBuildTileWidth
Definition: snapshotter.h:66
void serialize(Archive &ar)
Definition: snapshotter.h:47
Definition: scenariospecification.h:57
virtual bool isCameraReady(torchcraft::State *)
Is the current game state appropriate for taking a snapshot?
Definition: snapshotter.h:86
Main namespace for bot-related code.
Definition: areainfo.cpp:17
A low-resolution snapshot of a unit state, used as a component of Snapshots.
Definition: snapshotter.h:20
int64_t techs
Definition: snapshotter.h:43
Snapshot stateToSnapshot(torchcraft::State *state)
Definition: snapshotter.cpp:77
Snapshot loadSnapshot(const std::string &path)
Definition: snapshotter.cpp:170
void serialize(Archive &ar)
Definition: snapshotter.h:71
int energy
Definition: snapshotter.h:26
int type
Definition: snapshotter.h:21
int shields
Definition: snapshotter.h:25