TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Functions
cherrypi::featureimpl Namespace Reference

Functions

void extractCandidateEnemyStartLocations (torch::Tensor t, State *state, Rect const &r)
 2D tensor representation of whether a tile is a start location. More...
 
void noop (torch::Tensor, State *, Rect const &)
 
void extractGroundHeight (torch::Tensor t, State *state, Rect const &r)
 Extracts a 2D tensor of ground height, which impacts vision and the probability that a bullet attack will miss. More...
 
void extractWalkability (torch::Tensor t, State *state, Rect const &r)
 Extracts a 2D tensor of whether the terrain on a walktile is walkable by ground units. More...
 
void extractOneHotGroundHeight (torch::Tensor t, State *state, Rect const &r)
 Extracts a 3D tensor of ground height, where each of the 3 ground heights (plus "on the map") is a one-hot dimension. More...
 
void extractBuildability (torch::Tensor, State *, Rect const &)
 
void extractTallDoodad (torch::Tensor t, State *state, Rect const &r)
 Extracts a 2D tensor of the presence of tall doodads, which impact vision and the probability that a bullet attack will miss. More...
 
void extractStartLocations (torch::Tensor t, State *state, Rect const &r)
 Set tensor to '1' for every start location reported by TorchCraft. More...
 
void extractXYGrid (torch::Tensor t, State *state, Rect const &r)
 Grid of X/Y coordinates. More...
 
void extractResources (torch::Tensor t, State *state, Rect const &r)
 Set tensor to '1' for every walktile occupied by resources. More...
 
void extractHasStructure (torch::Tensor t, State *state, Rect const &r)
 Set tensor to '1' for every walktile occupied by a structure. More...
 
void extractFogOfWar (torch::Tensor t, State *state, Rect const &r)
 2D tensor representation of whether a tile is visible to the current player (as opposed to being in the fog of war). More...
 
void extractCreep (torch::Tensor t, State *state, Rect const &r)
 2D tensor representation of whether a tile has creep More...
 
void extractReservedAsUnbuildable (torch::Tensor t, State *state, Rect const &r)
 2D tensor representation of whether we have reserved this area for placing a building, rendering it unavailable for further buildings. More...
 

Function Documentation

void cherrypi::featureimpl::extractBuildability ( torch::Tensor  t,
State state,
Rect const &  r 
)
void cherrypi::featureimpl::extractCandidateEnemyStartLocations ( torch::Tensor  t,
State state,
Rect const &  r 
)

2D tensor representation of whether a tile is a start location.

void cherrypi::featureimpl::extractCreep ( torch::Tensor  t,
State state,
Rect const &  r 
)

2D tensor representation of whether a tile has creep

void cherrypi::featureimpl::extractFogOfWar ( torch::Tensor  t,
State state,
Rect const &  r 
)

2D tensor representation of whether a tile is visible to the current player (as opposed to being in the fog of war).

void cherrypi::featureimpl::extractGroundHeight ( torch::Tensor  t,
State state,
Rect const &  r 
)

Extracts a 2D tensor of ground height, which impacts vision and the probability that a bullet attack will miss.

Ignores the presence of doodads.

  • 0: Low ground
  • 1: High ground
  • 2: Very high ground

See https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#a94eb3e3fe7850078c2086638a46214be

void cherrypi::featureimpl::extractHasStructure ( torch::Tensor  t,
State state,
Rect const &  r 
)

Set tensor to '1' for every walktile occupied by a structure.

void cherrypi::featureimpl::extractOneHotGroundHeight ( torch::Tensor  t,
State state,
Rect const &  r 
)

Extracts a 3D tensor of ground height, where each of the 3 ground heights (plus "on the map") is a one-hot dimension.

Ignores the presence of doodads.

See https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#a94eb3e3fe7850078c2086638a46214be

void cherrypi::featureimpl::extractReservedAsUnbuildable ( torch::Tensor  t,
State state,
Rect const &  r 
)

2D tensor representation of whether we have reserved this area for placing a building, rendering it unavailable for further buildings.

void cherrypi::featureimpl::extractResources ( torch::Tensor  t,
State state,
Rect const &  r 
)

Set tensor to '1' for every walktile occupied by resources.

void cherrypi::featureimpl::extractStartLocations ( torch::Tensor  t,
State state,
Rect const &  r 
)

Set tensor to '1' for every start location reported by TorchCraft.

void cherrypi::featureimpl::extractTallDoodad ( torch::Tensor  t,
State state,
Rect const &  r 
)

Extracts a 2D tensor of the presence of tall doodads, which impact vision and the probability that a bullet attack will miss.

  • 0: No tall doodad
  • 1: Tall doodad

See https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#a94eb3e3fe7850078c2086638a46214be

void cherrypi::featureimpl::extractWalkability ( torch::Tensor  t,
State state,
Rect const &  r 
)

Extracts a 2D tensor of whether the terrain on a walktile is walkable by ground units.

See https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#a91153ca71797617ce225adf28d508510

void cherrypi::featureimpl::extractXYGrid ( torch::Tensor  t,
State state,
Rect const &  r 
)

Grid of X/Y coordinates.

Channel 0 for Y, channel 1 for X. Uniform stepping with 1/512

void cherrypi::featureimpl::noop ( torch::Tensor  ,
State ,
Rect const &   
)