TorchCraftAI
  • Tutorials
  • API
  • Blog
  • GitHub

›TorchCraftAI

Getting Started

  • Installation (Linux)
  • Installation (Windows)
  • Installation (macOS)
  • Play games with CherryPi

TorchCraftAI

  • Overview
  • System Architecture
  • Core Abstractions
  • Modules Overview
  • Module Training Blueprints

Tutorial - Building Placement

  • Building Placement Intro
  • Neural Network Architecture
  • Supervised Learning
  • Reinforcement Learning

Tutorial - Micro-Manamagent

  • Micromanagement Intro
  • Model
  • Training Setup

Modules Overview

TorchCraftAI comprises any number of modules, which are each responsible for an aspect of gameplay. Modules consume UPCTuples from the Blackboard, and post UPCs back to the Blackboard. This page lists the currently available rule-based modules that are enabled for standard games, along with a brief description and the nature of UPC tuples that they typically consume and produce.

  • Top
  • CreateGatherAttack
  • Strategy
  • GenericAutoBuild
  • BuildingPlacer
  • Builder
  • Tactics
  • SquadCombat
  • Scouting
  • Gatherer
  • Harass
  • StaticDefenceFocusFire
  • UPCToCommand

Top

Posts a UPC of all units for future modules to consume. This is the default top-level module

CreateGatherAttack

A high-level module that posts three UPCs with \(\Pr(C=Create)=1\), \(\Pr(C=Gather)=1\) and \(\Pr(C=Attack \mid C=Move)=1\), respectively. These serve as inputs for the strategy, resource gathering and military modules below.

Strategy

StrategyModule fulfills multiple duties that can be defined during construction -- by default, all of them are performed.

BuildOrder

The module emits UPCs that enable GenericAutoBuild to instantiate a build order (by name). Usually, a bandit algorithm is used to select an initial opening build order, based on the opponent and available paste game outcomes.

Scouting

Post UPCTuples that initiate scouting with ScoutingModule.

Harassment

If the enemy's start location has been found, post a UPC to initiate harassment of its base with HarassmentModule.

GenericAutoBuild

Realizes UPCTuples with \(Pr(C=Create) = 1\) and a string state field by creating a build order task (as requested by the state field). As long as the task is active, the build order is re-evaluated in regular intervals. This results in new UPCs, one for each unit that should be created. The order in which UPCs are being posted corresponds to their priority.

Re-evaluation can also result in a change of priority for previously posted UPCTuples that are already being realized by downstream modules. These changes are propagated with UPCTuples for which (Pr(C=SetCreatePriority)=1) and the state field contains a mapping from original UPC IDs to new priorities.

BuildingPlacer

This module refines the position entry for UPCTuples with \(Pr(C=Create)=1)\), a state containing a dirac distribution over unit types with the single entry referring to a building. The UPCs that will be generated each contain a concrete map position for the requested building. If a generated UPC cannot be realized (i.e. the ProxyTask detects a failure), a new location will be selected.

Placement can be performed with heuristics (this is the default) or with a BuildingPlacerModel.

Builder

This module realizes all UPCs with \(Pr(C=Create)=1\) and a dirac distribution over unit types. It selects units that can perform the requested construction, and will automatically do retries on failure. For buildings for which the target position became invalid, the task corresponding to the UPC will fail and retries will not be performed (this is being done by BuildingPlacer instead).

Tactics

Decides how to allocate all otherwise-unoccupied combat units across the map. Clusters units into groups, matches them with nearby enemies, then decides whether the group should fight or flee. Issues \(Pr(C=Delete) > 0 \) to fight and \(Pr(C=Flee) = 1\) to run away.

SquadCombat

Controls individual units in combat. This includes behaviors like attacking, fleeing, kiting, or burrowing. Issues UPCs for individual units to perform fully-specified (1.0 probability in all dimensions) commands.

Scouting

Consumes \(Pr(C=Scout) = 1\) UPCs. Sends worker and Overlord units to find enemy bases by issuing \(Pr(C=Move) = 1\) UPCs.

Gatherer

Manages workers for resource gathering (both minerals and gas) in a centralized fashion. UPCs with \(Pr(C=Gather)=1\) will be consumed and all units that are assigned non-zero probabilities will be included in gathering efforts. For each controlled unit, UPCs are regularly generated for gathering resources and returning them to an appropriate resource depot.

Harass

Realizes UPCTuples with \(Pr(C=Harass)=1\) by attacking buildings inside the enemy base.

StaticDefenceFocusFire

This module operates outside of the usual UPC communication mechanism and posts TorchCraft attack commands for all defense buildings if targets are in range.

UPCToCommand

This module consumes all UPCs on the Blackboard that are actionable, i.e. that concretely describe an in-game action, translates them into TorchCraft game commands and posts them to the Blackboard. Actionable UPCTuples are required to have probabilities of 1 for the unit, position and command entries, i.e. they describe a specific action towards a specific position for a specific unit.

← Core AbstractionsModule Training Blueprints →
TorchCraftAI
Docs
Getting Started (Linux)Getting Started (Windows)Getting Started (Mac)API Reference
Community
Starcraft AI DiscordStarcraft AI Facebook groupTorchCraftAI on GitHub
More
TorchCraft on GitHubStarData on GitHubBlog
Facebook Open Source
Copyright © 2019 Facebook