10 #include "basetypes.h" 12 #include "buildtype.h" 13 #include "movefilters.h" 119 std::shared_ptr<UPCTuple>
moveTo(
Position pos,
bool protect =
true);
120 std::shared_ptr<UPCTuple>
moveTo(
Vec2 pos,
bool protect =
true);
129 std::function<
double(
Unit*
const)> scoring,
130 double minimumScore);
138 std::function<
double(
Unit*
const)> scoring,
Game state.
Definition: state.h:42
int lastTarget
On what frame did this unit last choose a target?
Definition: agent.h:72
int mutaliskTurning
Is this unit a Mutalisk turning to face a Scourge? Used to apply the triangle method for kiting Scour...
Definition: agent.h:94
State * state
The current game state.
Definition: agent.h:40
bool targetInRange
Is the target in range right now? This accounts for latency and unit/target velocities.
Definition: agent.h:59
bool prevTargetInRange
Definition: agent.h:60
SquadTask * task
To what squad does this unit belong?
Definition: agent.h:34
bool wantsToFight
Has this unit joined the vanguard of its squad? Or is it on the way?
Definition: agent.h:66
Represents and holds information about buildable types (units, upgrades, techs).
Definition: buildtype.h:36
std::shared_ptr< UPCTuple > moveTo(Position pos, bool protect=true)
Convenience method for issuing a move UPC.
Definition: agent.cpp:104
Position lastPosition
The unit's position last time we micromanaged it.
Definition: agent.h:87
int formationCounter
Used by SquadTask in calculating formations.
Definition: agent.h:102
Unit * target
Who has this unit decided to kill?
Definition: agent.h:55
static constexpr int unstickTriggerFrames
How many frames of being stuck before we attempt to un-stick a unit.
Definition: agent.h:105
std::vector< PPositionFilter > PositionFilters
Definition: movefilters.h:31
std::shared_ptr< UPCTuple > smartMove(const Position &tgt)
Convenience method for issuing a threat-aware move UPC.
Definition: agent.cpp:135
MicroAction currentAction
What action has been selected for this unit by a Behavior?
Definition: agent.h:49
void preMicro()
Prepare the unit for micro.
Definition: agent.cpp:14
An Agent represents the micromanagement state of one of our units.
Definition: agent.h:31
std::shared_ptr< UPCTuple > attack(Position const &pos)
Convenience method for issuing an attack-move UPC.
Definition: agent.cpp:70
Represents a decision of how to control a unit.
Definition: upc.h:135
std::vector< Unit * > legalTargets
Who is this unit intended to fight?
Definition: agent.h:52
std::shared_ptr< UPCTuple > tryCastSpellOnUnit(const BuildType *spell, std::function< double(Unit *const)> scoring, double minimumScore)
Attempt to cast a spell targeting a unit.
Definition: agent.cpp:144
Represents a unit in the game.
Definition: unitsinfo.h:35
std::shared_ptr< UPCTuple > microDelete()
Hand control of the unit over to the Agent for fighting.
Definition: agent.cpp:45
std::shared_ptr< UPCTuple > filterMove(const movefilters::PositionFilters &pfs)
Convenience method for issuing a move UPC using movefilters.
Definition: agent.cpp:129
std::shared_ptr< UPCTuple > tryCastSpellOnArea(const BuildType *spell, double areaWidth, double areaHeight, std::function< double(Unit *const)> scoring, double minimumScore, std::function< Position(Position input)> positionTransform=[](auto p){return p;})
Attempt to cast a spell targeting an area.
Definition: agent.cpp:213
int lastMove
On what frame did this unit start moving? -1 when the unit is attacking, rather than moving...
Definition: agent.h:76
std::shared_ptr< UPCTuple > microFlee()
Hand control of the unit over to the Agent for fleeing.
Definition: agent.cpp:52
constexpr Position kInvalidPosition
Definition: basetypes.h:179
int lastMicroFrame
On what frame was this unit last micromanaged?
Definition: agent.h:69
Unit * attacking
Tracks the last target this unit was commanded to attack.
Definition: agent.h:63
int lastAttack
On what frame did this unit start attacking? -1 when the unit is not attacking.
Definition: agent.h:80
Unit * unit
What unit is this Agent controlling?
Definition: agent.h:37
void postCommand(tc::BW::UnitCommandType command)
Issues a command to the Agent's unit by posting it to the Blackboard.
Definition: agent.cpp:59
Main namespace for bot-related code.
Definition: areainfo.cpp:17
std::shared_ptr< Behavior > behaviorFlee
Behaviors to perform when receiving a Flee UPC.
Definition: agent.h:46
int stuckFrames
How many consecutive frames has this unit been inadvertently idle?
Definition: agent.h:90
std::shared_ptr< Behavior > behaviorDelete
Behaviors to perform when receiving a Delete UPC.
Definition: agent.h:43
Position formationPosition
SquadTask organizes its units into a formation for attacking.
Definition: agent.h:99
Vec2T< int > Position
Definition: basetypes.h:178
Position lastMoveTo
If we attempted to move the unit, the last position to which we attempted to move it...
Definition: agent.h:84