diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..9a99eec --- /dev/null +++ b/404.html @@ -0,0 +1,955 @@ + + + +
+ + + + + + + + + + + + + + +CombatManeuver
+
+
+
+ dataclass
+
+
+¶
+ Bases: Behavior
Execute behaviors sequentially.
+Add behaviors
+Example: +
from ares import AresBot
+from ares.behaviors.combat import CombatManeuver
+from ares.behaviors.combat.individual import (
+ DropCargo,
+ KeepUnitSafe,
+ PathUnitToTarget,
+ PickUpCargo,
+)
+
+class MyBot(AresBot):
+ mine_drop_medivac_tag: int
+
+ async def on_step(self, iteration):
+ # Left out here, but `self.mine_drop_medivac_tag`
+ # bookkeeping is up to the user
+ medivac: Optional[Unit] = self.unit_tag_dict.get(
+ self.mine_drop_medivac_tag, None
+ )
+ if not medivac:
+ return
+
+ air_grid: np.ndarray = self.mediator.get_air_grid
+
+ # initiate a new CombatManeuver
+ mine_drop: CombatManeuver = CombatManeuver()
+
+ # then add behaviors in the order they should be executed
+ # first priority is picking up units
+ # (will return False if no cargo and move to next behavior)
+ mine_drop.add(
+ PickUpCargo(
+ unit=medivac,
+ grid=air_grid,
+ pickup_targets=mines_to_pickup
+ )
+ )
+
+ # if there is cargo, path to target and drop them off
+ if medivac.has_cargo:
+ # path
+ mine_drop.add(
+ PathUnitToTarget(
+ unit=medivac,
+ grid=air_grid,
+ target=self.enemy_start_locations[0],
+ )
+ )
+ # drop off the mines
+ mine_drop.add(DropCargo(unit=medivac, target=medivac.position))
+
+ # no cargo and no units to pick up, stay safe
+ else:
+ mine_drop.add(KeepUnitSafe(unit=medivac, grid=air_grid))
+
+ # register the mine_drop behavior
+ self.register_behavior(mine_drop)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
micros |
+
+ list[Behavior]
+ |
+
+
+
+ A list of behaviors that should be executed. Defaults to an empty list. + |
+
src/ares/behaviors/combat/combat_maneuver.py
13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 |
|
add(behavior)
+
+¶Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ behavior
+ |
+
+ Union[CombatIndividualBehavior, CombatGroupBehavior, CombatManeuver]
+ |
+
+
+
+ Add a new combat behavior to the current maneuver object. + |
+ + required + | +
src/ares/behaviors/combat/combat_maneuver.py
AMove
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
A-Move a unit to a target.
+Example: +
from ares.behaviors.combat.individual import AMove
+
+self.register_behavior(AMove(unit, self.game_info.map_center))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to stay safe. + |
+
target |
+
+ Union[Point2, Unit]
+ |
+
+
+
+ Where the unit is going. + |
+
src/ares/behaviors/combat/individual/a_move.py
AttackTarget
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Shoot a target.
+Example: +
from ares.behaviors.combat.individual import AttackTarget
+
+unit: Unit
+target: Unit
+self.register_behavior(AttackTarget(unit, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to shoot. + |
+
target |
+
+ Unit
+ |
+
+
+
+ The unit we want to shoot at. + |
+
src/ares/behaviors/combat/individual/attack_target.py
DropCargo
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Handle releasing cargo from a container.
+Medivacs, WarpPrism, Overlords, Nydus.
+Example: +
from ares.behaviors.combat import DropCargo
+
+unit: Unit
+target: Unit
+self.register_behavior(DropCargo(unit, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The container unit. + |
+
target |
+
+ Point2
+ |
+
+
+
+ The target position where to drop the cargo. + |
+
src/ares/behaviors/combat/individual/drop_cargo.py
KeepUnitSafe
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Get a unit to safety based on the influence grid passed in.
+Example: +
from ares.behaviors.combat import KeepUnitSafe
+
+unit: Unit
+grid: np.ndarray = self.mediator.get_ground_grid
+self.register_behavior(KeepUnitSafe(unit, grid))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to stay safe. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ 2D grid which usually contains enemy influence. + |
+
src/ares/behaviors/combat/individual/keep_unit_safe.py
MedivacHeal
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Given close allied units, heal things up.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The siege tank unit. + |
+
close_allied |
+
+ list[Unit]
+ |
+
+
+
+ All close by allied units we want to heal. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ The path for medivac to heal on + |
+
keep_safe |
+
+ bool
+ |
+
+
+
+ Attempt to stay safe, this may result in +not always healing units (Default is True) + |
+
src/ares/behaviors/combat/individual/medivac_heal.py
PathUnitToTarget
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Path a unit to its target destination.
+ + +Not added yet since that may be it's own Behavior
+Example: +
from ares.behaviors.combat import PathUnitToTarget
+
+unit: Unit
+grid: np.ndarray = self.mediator.get_ground_grid
+target: Point2 = self.game_info.map_center
+self.register_behavior(PathUnitToTarget(unit, grid, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to path. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ 2D grid to path on. + |
+
target |
+
+ Point2
+ |
+
+
+
+ Target destination. + |
+
success_at_distance |
+
+ float
+ |
+
+
+
+ If the unit has gotten this close, consider path +behavior complete. Defaults to 0.0. + |
+
sensitivity |
+
+ int
+ |
+
+
+
+ Path precision. Defaults to 5. + |
+
smoothing |
+
+ bool
+ |
+
+
+
+ Whether to smooth out the path. Defaults to False. + |
+
sense_danger |
+
+ bool
+ |
+
+
+
+ Whether to check for dangers. If none are present, +the pathing query is skipped. Defaults to True. + |
+
danger_distance |
+
+ float
+ |
+
+
+
+ If |
+
danger_threshold |
+
+ float
+ |
+
+
+
+ Influence at which a danger is respected. +Defaults to 5.0. + |
+
src/ares/behaviors/combat/individual/path_unit_to_target.py
PickUpCargo
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Handle loading cargo into a container.
+Medivacs, WarpPrism, Overlords, Nydus.
+Example: +
from ares.behaviors.combat import PickUpCargo
+
+unit: Unit # medivac for example
+grid: np.ndarray = self.mediator.get_ground_grid
+pickup_targets: Union[Units, list[Unit]] = self.workers
+self.register_behavior(PickUpCargo(unit, grid, pickup_targets))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The container unit. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ Pathing grid for the container unit. + |
+
pickup_targets |
+
+ Union[Units, list[Unit]]
+ |
+
+
+
+ Units we want to load into the container. + |
+
cargo_switch_to_role |
+
+ Optional[UnitRole]
+ |
+
+
+
+ Sometimes useful to switch cargo to +a new role immediately after loading. Defaults to None. + |
+
src/ares/behaviors/combat/individual/pick_up_cargo.py
RavenAutoTurret
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Drop a turret, opinionated and could be improved +Create own behavior based on this if needed.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ Unit + |
+
all_close_enemy |
+
+ list[Unit]
+ |
+
+
+
+ All close by allied units we want to heal. + |
+
src/ares/behaviors/combat/individual/raven_auto_turret.py
SiegeTankDecision
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Decide if a tank should either siege or unsiege.
+VERY OPINIONATED, recommend to write own version based on this.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The siege tank unit. + |
+
close_enemy |
+
+ list[Unit]
+ |
+
+
+
+ All close by enemies. + |
+
target |
+
+ Point2
+ |
+
+
+
+ Intended destination for this tank. + |
+
stay_sieged_near_target |
+
+ bool
+ |
+
+
+
+ This is useful for tanks in defensive position. +If on offensive, might not be needed +Default is False. + |
+
remain_sieged |
+
+ bool
+ |
+
+
+
+ Sometimes we might just want to leave the tank sieged up +Default is False. + |
+
force_unsiege |
+
+ bool
+ |
+
+
+
+ We might want to not ever siege +Default is False. + |
+
src/ares/behaviors/combat/individual/siege_tank_decision.py
29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 |
|
PlacePredictiveAoE
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Predict an enemy position and fire AoE accordingly.
+Warning: Use this at your own risk. Work in progress.
+ + +Cythonize this.
+Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to fire the AoE. + |
+
path |
+
+ List[Point2]
+ |
+
+
+
+ How we're getting to the target position (the last point in the list). + |
+
enemy_center_unit |
+
+ Unit
+ |
+
+
+
+ Enemy unit to calculate positions based on. + |
+
aoe_ability |
+
+ AbilityId
+ |
+
+
+
+ AoE ability to use. + |
+
ability_delay |
+
+ int
+ |
+
+
+
+ Amount of frames between using the ability and +the ability occurring. + |
+
src/ares/behaviors/combat/individual/place_predictive_aoe.py
18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 |
|
ShootTargetInRange
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Find something to shoot at.
+ + +Might want to pick best one shot KO for example
+Example: +
from ares.behaviors.combat import ShootTargetInRange
+
+unit: Unit
+target: Unit
+self.register_behavior(ShootTargetInRange(unit, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to shoot. + |
+
targets |
+
+ Union[list[Unit], Units]
+ |
+
+
+
+ Units we want to check. + |
+
extra_range |
+
+ float
+ |
+
+
+
+ Look outside the unit's weapon range. +This might be useful for hunting down low HP units. + |
+
src/ares/behaviors/combat/individual/shoot_target_in_range.py
StutterUnitBack
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Shoot at the target if possible, else move back.
+Example: +
from ares.behaviors.combat import StutterUnitBack
+
+unit: Unit
+target: Unit
+self.register_behavior(StutterUnitBack(unit, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to shoot. + |
+
target |
+
+ Unit
+ |
+
+
+
+ The unit we want to shoot at. + |
+
kite_via_pathing |
+
+ bool
+ |
+
+
+
+ Kite back using pathing? Value for |
+
grid |
+
+ Optional[ndarray]
+ |
+
+
+
+ Pass in if using |
+
src/ares/behaviors/combat/individual/stutter_unit_back.py
StutterUnitForward
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Shoot at the target if possible, else move back.
+Example: +
from ares.behaviors.combat import StutterUnitForward
+
+unit: Unit
+target: Unit
+self.register_behavior(StutterUnitForward(unit, target))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to shoot. + |
+
target |
+
+ Unit
+ |
+
+
+
+ The unit we want to shoot at. + |
+
src/ares/behaviors/combat/individual/stutter_unit_forward.py
UseAbility
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
A-Move a unit to a target.
+Example: +
from ares.behaviors.combat import UseAbility
+from sc2.ids.ability_id import AbilityId
+
+unit: Unit
+target: Union[Unit, Point2]
+self.register_behavior(
+ UseAbility(
+ AbilityId.FUNGALGROWTH_FUNGALGROWTH, unit, target
+ )
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
ability |
+
+ AbilityId
+ |
+
+
+
+ The ability we want to use. + |
+
unit |
+
+ Unit
+ |
+
+
+
+ The unit to use the ability. + |
+
target |
+
+ Optional[Union[Point2, Unit]]
+ |
+
+
+
+ Target for this ability. + |
+
src/ares/behaviors/combat/individual/use_ability.py
UseAOEAbility
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Attempt to use AOE ability for a unit.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit that potentially has an AOE ability. + |
+
ability_id |
+
+ AbilityId
+ |
+
+
+
+ Ability we want to use. + |
+
targets |
+
+ list[Unit]
+ |
+
+
+
+ The targets we want to hit. + |
+
min_targets |
+
+ int
+ |
+
+
+
+ Minimum targets to hit with spell. + |
+
avoid_own_flying |
+
+ bool
+ |
+
+
+
+ Avoid own flying with this spell? +Default is False. + |
+
avoid_own_ground |
+
+ bool
+ |
+
+
+
+ Avoid own ground with this spell? +Default is False. + |
+
bonus_tags |
+
+ Optional[set]
+ |
+
+
+
+ Give more emphasize on this unit tags.
+For example, perhaps a ravager can do corrosive bile
+Provide enemy tags that are currently fungaled?
+Default is empty |
+
recalculate |
+
+ bool
+ |
+
+
+
+ If unit is already using ability, should +we recalculate this behavior? +WARNING: could have performance impact +Default is False. + |
+
stack_same_spell |
+
+ bool
+ |
+
+
+
+ Stack spell in same position? +Default is False. + |
+
src/ares/behaviors/combat/individual/use_aoe_ability.py
24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 |
|
UseTransfuse
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Queen tries to transfuse something
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The queen that should transfuse. + |
+
targets |
+
+ Union[list[Unit], Units]
+ |
+
+
+
+ Our own units to transfuse. + |
+
extra_range |
+
+ float
+ |
+
+
+
+ Look a bit further out of transfuse range? +Default is 0.0 + |
+
src/ares/behaviors/combat/individual/use_transfuse.py
WorkerKiteBack
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatIndividualBehavior
Shoot at the target if possible, else move back.
+This is similar to stutter unit back, but takes advantage of +mineral walking.
+Example: +
from ares.behaviors.combat import WorkerKiteBack
+
+unit: Unit
+target: Unit
+self.register_behavior(
+ WorkerKiteBack(
+ unit, target
+ )
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
unit |
+
+ Unit
+ |
+
+
+
+ The unit to shoot. + |
+
target |
+
+ Unit
+ |
+
+
+
+ The unit we want to shoot at. + |
+
src/ares/behaviors/combat/individual/worker_kite_back.py
AMoveGroup
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
A-Move group to a target.
+Example: +
from ares.behaviors.combat.group import AMoveGroup
+
+self.register_behavior(AMoveGroup(units, self.game_info.map_center))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
group |
+
+ list[Unit]
+ |
+
+
+
+ Units we want to control. + |
+
group_tags |
+
+ set[int]
+ |
+
+
+
+ The group unit tags. + |
+
target |
+
+ Point2
+ |
+
+
+
+ Where the unit is going. + |
+
src/ares/behaviors/combat/group/a_move_group.py
KeepGroupSafe
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
A-Move group to a target.
+Example: +
from ares.behaviors.combat.group import AMoveGroup
+
+self.register_behavior(AMoveGroup(units, self.game_info.map_center))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
group |
+
+ list[Unit]
+ |
+
+
+
+ Units we want to control. + |
+
close_enemy |
+
+ Union[Units, list[Unit]]
+ |
+
+
+
+ Nearby enemy. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ Grid we should check for safety. + |
+
attack_in_range_enemy |
+
+ bool
+ |
+
+
+
+ Whether to attack in range if weapon is ready. +Defaults to True. + |
+
src/ares/behaviors/combat/group/keep_group_safe.py
PathGroupToTarget
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
Path a group to its target destination.
+We issue only one action for the whole group and +attempt to filter spammed actions.
+Example: +
from ares.behaviors.combat.group import PathGroupToTarget
+
+group: list[Unit] = [u for u in self.units]
+group_tags: set[int] = {u.tag for u in group}
+grid: np.ndarray = self.mediator.get_ground_grid
+start: Point2 = self.ai.start_location
+target: Point2 = self.game_info.map_center
+
+self.register_behavior(
+ PathGroupToTarget(start, group, group_tags, grid, target)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
start |
+
+ Point2
+ |
+
+
+
+ Where to start the path query. + |
+
group |
+
+ list[Unit]
+ |
+
+
+
+ The actual group units. + |
+
group_tags |
+
+ set[int]
+ |
+
+
+
+ The units to path. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ 2D grid to path on. + |
+
target |
+
+ Point2
+ |
+
+
+
+ Target destination. + |
+
success_at_distance |
+
+ float
+ |
+
+
+
+ If the unit has gotten this close, +consider the path behavior complete. Defaults to 0.0. + |
+
sensitivity |
+
+ int
+ |
+
+
+
+ Path precision. Defaults to 5. + |
+
smoothing |
+
+ bool
+ |
+
+
+
+ Whether to smooth out the path. Defaults to False. + |
+
sense_danger |
+
+ bool
+ |
+
+
+
+ Whether to check for dangers. If none are present, +the pathing query is skipped. Defaults to False. + |
+
danger_distance |
+
+ float
+ |
+
+
+
+ If |
+
danger_threshold |
+
+ float
+ |
+
+
+
+ Influence at which a danger is respected. +Defaults to 5.0. + |
+
prevent_duplicate |
+
+ bool
+ |
+
+
+
+ Whether to try to prevent spamming actions. +Defaults to True. + |
+
src/ares/behaviors/combat/group/path_group_to_target.py
17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 |
|
StutterGroupBack
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
Stutter a group back in unison.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
group |
+
+ list[Unit]
+ |
+
+
+
+ The group of units we want to control. + |
+
group_tags |
+
+ set[int]
+ |
+
+
+
+ The group unit tags. + |
+
group_position |
+
+ Point2
+ |
+
+
+
+ The position where this group is situated. + |
+
target |
+
+ Union[Point2, Unit]
+ |
+
+
+
+ Target for the group. + |
+
grid |
+
+ ndarray
+ |
+
+
+
+ Grid this group will use to path on. + |
+
src/ares/behaviors/combat/group/stutter_group_back.py
28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 |
|
StutterGroupForward
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
Stutter a group forward in unison.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
group |
+
+ list[Unit]
+ |
+
+
+
+ The group of units we want to control. + |
+
group_tags |
+
+ set[int]
+ |
+
+
+
+ The group unit tags. + |
+
group_position |
+
+ Point2
+ |
+
+
+
+ The position where this group is situated. + |
+
target |
+
+ Union[Point2, Unit]
+ |
+
+
+
+ Target for the group, used if no enemies are present. + |
+
enemies |
+
+ Union[Units, list[Unit]]
+ |
+
+
+
+ The enemy units we want to stutter towards. + |
+
src/ares/behaviors/combat/group/stutter_group_forward.py
GroupUseAbility
+
+
+
+ dataclass
+
+
+¶
+ Bases: CombatGroupBehavior
Issue a single ability command for a group of units.
+Example: +
from ares.behaviors.combat.group import GroupUseAbility
+
+self.register_behavior(
+ GroupUseAbility(
+ AbilityId.MOVE_MOVE,
+ units,
+ {u.tag for u in units}
+ self.game_info.map_center
+ )
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
ability |
+
+ AbilityId
+ |
+
+
+
+ Ability we want to use. + |
+
group |
+
+ list[Unit]
+ |
+
+
+
+ Units we want to control. + |
+
group_tags |
+
+ set[int]
+ |
+
+
+
+ The group unit tags. + |
+
target |
+
+ Union[Point2, Unit, None]
+ |
+
+
+
+ The target for this ability. + |
+
sync_command |
+
+ bool
+ |
+
+
+
+ (default=True) If True, wait for all units +to be ready before trying ability. + |
+
src/ares/behaviors/combat/group/group_use_ability.py
Use the menu to browse available combat and macro behaviors.
+ + + + + + + + + + + + + +from ares import AresBot
+from ares.behaviors.macro.mining import Mining
+
+class MyBot(AresBot):
+ async def on_step(self, iteration: int) -> None:
+ await super(MyBot, self).on_step(iteration)
+ self.register_behavior(Mining())
+
MacroPlan
+
+
+
+ dataclass
+
+
+¶
+ Bases: Behavior
Execute macro behaviors sequentially.
+Idea here is to put macro behaviors in priority order.
+Example: +
from ares.behaviors.macro import MacroPlan
+from ares.behaviors.macro import (
+ AutoSupply,
+ Mining
+ SpawnController
+)
+
+# initiate a new MacroPlan
+macro_plan: MacroPlan = MacroPlan()
+
+# then add behaviors in the order they should be executed
+macro_plan.add(AutoSupply())
+macro.plan.add(SpawnController(army_composition_dict=self.army_comp))
+
+
+# register the macro plan
+self.ai.register_behavior(macro_plan)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
macros |
+
+ list[Behavior]
+ |
+
+
+
+ A list of behaviors that should be executed. Defaults to an empty list. + |
+
src/ares/behaviors/macro/macro_plan.py
AddonSwap
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
For Terran only, swap 3x3 structures. +Pass in two structures and they will swap positions.
+TODO: Extend this to support an exact swap, ie. swap techlab and reactor
+Example: +
from ares.behaviors.macro import AddonSwap
+
+# factory will find a reactor to fly to, any existing
+# structure will fly to the factory's starting position
+self.register_behavior(
+ AddonSwap(factory, UnitID.REACTOR)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
structure_needing_addon |
+
+ Unit
+ |
+
+
+
+ The structure type we want the addon for. + |
+
addon_required |
+
+ UnitTypeId
+ |
+
+
+
+ Type of addon required. + |
+
src/ares/behaviors/macro/addon_swap.py
AutoSupply
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Automatically build supply, works for all races.
+Example: +
from ares.behaviors.macro import AutoSupply
+
+self.register_behavior(AutoSupply(self.start_location))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
base_location |
+
+ Point2
+ |
+
+
+
+ The base location where supply should be built. + |
+
return_true_if_supply_required |
+
+ bool
+ |
+
+
+
+ If supply can't be afforded but is
+required, return true. Useful for creating a |
+
src/ares/behaviors/macro/auto_supply.py
20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 |
|
BuildStructure
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Handy behavior for Terran and Protoss.
+Especially combined with Mining
and ares built in placement solver.
+Finds an ideal mining worker, and an available precalculated placement.
+Then removes worker from mining records and provides a new role.
Example: +
from ares.behaviors.macro import BuildStructure
+
+self.register_behavior(
+ BuildStructure(self.start_location, UnitTypeId.BARRACKS)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
base_location |
+
+ Point2
+ |
+
+
+
+ The base location to build near. + |
+
structure_id |
+
+ UnitTypeId
+ |
+
+
+
+ The structure type we want to build. + |
+
max_on_route |
+
+ int
+ |
+
+
+
+ The max number of workers on route to build this. Defaults to 1. + |
+
first_pylon |
+
+ bool
+ |
+
+
+
+ Will look for the first pylon in placements dict. +Defaults to False. + |
+
static_defence |
+
+ bool
+ |
+
+
+
+ Will look for static defense in placements dict. +Defaults to False. + |
+
wall |
+
+ bool
+ |
+
+
+
+ Find wall placement if possible. Only the main base is currently +supported. Defaults to False. + |
+
closest_to |
+
+ Optional[Point2]
+ |
+
+
+
+ Find placement at this base closest to the given point. Optional. + |
+
to_count |
+
+ int
+ |
+
+
+
+ Prevent going over this amount in total. +Defaults to 0, turning this check off. + |
+
to_count_per_base |
+
+ int
+ |
+
+
+
+ Prevent going over this amount at this base location. +Defaults to 0, turning this check off. + |
+
tech_progress_check |
+
+ float
+ |
+
+
+
+ Check if tech is ready before trying to build. +Defaults to 0.85; setting it to 0.0 turns this check off. + |
+
src/ares/behaviors/macro/build_structure.py
19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 |
|
BuildWorkers
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Finds idle townhalls / larvae and build workers.
+Example: +
from ares.behaviors.macro import BuildWorkers
+
+self.register_behavior(
+ BuildWorkers(to_count=80)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
to_count |
+
+ int
+ |
+
+
+
+ The target count of workers we want to hit. + |
+
src/ares/behaviors/macro/build_workers.py
ExpansionController
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Manage expanding.
+Example: +
from ares.behaviors.macro import ExpansionController
+
+self.register_behavior(
+ ExpansionController(to_count=8, max_pending=2)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
to_count |
+
+ int
+ |
+
+
+
+ The target base count. + |
+
can_afford_check |
+
+ bool
+ |
+
+
+
+ Check if we can afford expansion. Setting this to False +will allow the worker to move to a location ready to build the expansion. +Defaults to True. + |
+
check_location_is_safe |
+
+ bool
+ |
+
+
+
+ Check if we don't knowingly expand at a dangerous +location. Defaults to True. + |
+
max_pending |
+
+ int
+ |
+
+
+
+ Maximum pending townhalls at any time. Defaults to 1. + |
+
src/ares/behaviors/macro/expansion_controller.py
18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 |
|
GasBuildingController
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Maintain gas building count. +Finds an ideal mining worker, and an available geyser. +Then removes worker from mining records and provides a new role.
+Example: +
from ares.behaviors.macro import GasBuildingController
+
+self.register_behavior(
+ GasBuildingController(to_count=len(self.townhalls)*2)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
to_count |
+
+ int
+ |
+
+
+
+ How many gas buildings would we like? + |
+
max_pending |
+
+ int
+ |
+
+
+
+ How many gas buildings can be pending at any time? +Defaults to 1. + |
+
closest_to |
+
+ Optional[Point2]
+ |
+
+
+
+ Find available geyser closest to this location.
+Optional, defaults to |
+
src/ares/behaviors/macro/gas_building_controller.py
15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 |
|
Mining
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Handle worker mining control.
+Note: Could technically be CombatBehavior
, but is treated here as a
+MacroBehavior since many tasks are carried out.
Example: +
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
flee_at_health_perc |
+
+ float
+ |
+
+
+
+ If worker is in danger, at what +health percentage should it flee? Defaults to 0.5. + |
+
keep_safe |
+
+ bool
+ |
+
+
+
+ Should workers flee if they are in danger? +Defaults to True. + |
+
long_distance_mine |
+
+ bool
+ |
+
+
+
+ Can the worker long distance mine if it has nothing to do? +Defaults to True. + |
+
mineral_boost |
+
+ bool
+ |
+
+
+
+ Turn mineral boosting on or off. Defaults to True. + |
+
vespene_boost |
+
+ bool
+ |
+
+
+
+ Turn vespene boosting on or off +(only active when workers_per_gas < 3). +WARNING: VESPENE BOOSTING CURRENTLY NOT WORKING. +Defaults to True. + |
+
workers_per_gas |
+
+ int
+ |
+
+
+
+ Control how many workers are assigned to each gas. +Defaults to 3. + |
+
self_defence_active |
+
+ bool
+ |
+
+
+
+ If set to True, workers will have some basic defence. +Certain workers will attack enemy in range. Defaults to True. + |
+
safe_long_distance_mineral_fields |
+
+ Optional[Units]
+ |
+
+
+
+ Used internally, set when a worker starts +long distance mining. Defaults to None. + |
+
weight_safety_limit |
+
+ float
+ |
+
+
+
+ Workers will flee if enemy influence is above this number. +Defaults to 12.0 + |
+
src/ares/behaviors/macro/mining.py
37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 |
|
ProductionController
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Handle creating extra production facilities based +on an army composition dictionary. +This dictionary should be structured the same as the one +passed into SpawnController
+Terran / Protoss only
+Example bot code: +
from ares.behaviors.production_controller import ProductionController
+
+# Note: This does not try to build production facilities and
+# will ignore units that are impossible to currently spawn.
+army_composition: dict[UnitID: {float, bool}] = {
+ UnitID.MARINE: {"proportion": 0.6, "priority": 2}, # lowest priority
+ UnitID.MEDIVAC: {"proportion": 0.25, "priority": 1},
+ UnitID.SIEGETANK: {"proportion": 0.15, "priority": 0}, # highest priority
+}
+# where `self` is an `AresBot` object
+self.register_behavior(ProductionController(
+ army_composition, self.ai.start_location))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
army_composition_dict |
+
+ dict[UnitTypeId, dict[str, float, str, int]]
+ |
+
+
+
+ A dictionary detailing how an army composition +should be made up. The proportional values should all add up to 1.0, +with a priority integer for unit emphasis. + |
+
base_location |
+
+ Point2
+ |
+
+
+
+ The location where production should be built. + |
+
add_production_at_bank |
+
+ tuple[int, int]
+ |
+
+
+
+ When the bank reaches this size, calculate what
+extra production would be useful. Tuple where the first value is
+minerals and the second is vespene. Defaults to |
+
alpha |
+
+ float
+ |
+
+
+
+ Controls how much production to add when the bank is higher than
+ |
+
unit_pending_progress |
+
+ float
+ |
+
+
+
+ Check for production structures almost ready.
+For example, a marine might almost be ready, meaning we don't need to
+add extra production just yet. Defaults to |
+
ignore_below_proportion |
+
+ float
+ |
+
+
+
+ If we don't want many of a unit, there's no point
+adding production. Checks if it's possible to build a unit first.
+Defaults to |
+
should_repower_structures |
+
+ bool
+ |
+
+
+
+ Search for unpowered structures and build a
+new pylon if needed. Defaults to |
+
src/ares/behaviors/macro/production_controller.py
26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 |
|
RestorePower
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Restore power for protoss structures.
+Note: ProductionController
is set to call this automatically
+configured via should_repower_structures
parameter.
+Though this behavior may also be used separately.
Example: +
+ + + + + + +src/ares/behaviors/macro/restore_power.py
26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 |
|
SpawnController
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Handle spawning army compositions.
+Example bot code: +
from ares.behaviors.spawn_controller import SpawnController
+
+# Note: This does not try to build production facilities and
+# will ignore units that are impossible to currently spawn.
+army_composition: dict[UnitID: {float, bool}] = {
+ UnitID.MARINE: {"proportion": 0.6, "priority": 2}, # lowest priority
+ UnitID.MEDIVAC: {"proportion": 0.25, "priority": 1},
+ UnitID.SIEGETANK: {"proportion": 0.15, "priority": 0}, # highest priority
+}
+# where `self` is an `AresBot` object
+self.register_behavior(SpawnController(army_composition))
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
army_composition_dict |
+
+ dict[UnitTypeId, dict[str, float, str, int]]
+ |
+
+
+
+ A dictionary detailing how an army +composition should be made up. The proportional values should +all add up to 1.0, with a priority integer for unit emphasis. + |
+
freeflow_mode |
+
+ bool
+ |
+
+
+
+ If set to True, army composition proportions are ignored,
+and resources will be spent freely.
+Defaults to |
+
ignore_proportions_below_unit_count |
+
+ int
+ |
+
+
+
+ In early game, units affect the
+army proportions significantly. This allows some units to be freely
+built before proportions are respected. Defaults to |
+
over_produce_on_low_tech |
+
+ bool
+ |
+
+
+
+ If only one tech is available for a unit,
+this allows that unit to be constantly produced.
+Defaults to |
+
ignored_build_from_tags |
+
+ set[int]
+ |
+
+
+
+ A set of tags to prevent the spawn controller +from morphing from these tags. +Example: Prevent selecting barracks that need to build an addon. + |
+
maximum |
+
+ int
+ |
+
+
+
+ The maximum number of a unit type that can be produced
+in a single step. Defaults to |
+
spawn_target |
+
+ Optional[Point2]
+ |
+
+
+
+ A location to prioritize spawning units near. + |
+
src/ares/behaviors/macro/spawn_controller.py
22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 |
|
TechUp
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Automatically tech up so desired upgrade/unit can be built.
+Example: +
from ares.behaviors.macro import TechUp
+from sc2.ids.upgrade_id import UpgradeId
+
+self.register_behavior(
+ TechUp(UpgradeId.BANSHEECLOAK, base_location=self.start_location)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
desired_tech |
+
+ Union[UpgradeId, UnitTypeId]
+ |
+
+
+
+ The desired upgrade or unit type. + |
+
base_location |
+
+ Point2
+ |
+
+
+
+ The main building location to make tech. + |
+
ignore_existing_techlabs |
+
+ bool
+ |
+
+
+
+ If set to |
+
src/ares/behaviors/macro/tech_up.py
27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 |
|
UpgradeController
+
+
+
+ dataclass
+
+
+¶
+ Bases: MacroBehavior
Research upgrades, if the upgrade is not +currently researchable this behavior will automatically +make the tech buildings required.
+Example: +
from ares.behaviors.macro import UpgradeController
+from sc2.ids.upgrade_id import UpgradeId
+
+desired_upgrades: list[UpgradeId] = [
+ UpgradeId.TERRANINFANTRYWEAPONSLEVEL1,
+ UpgradeId.TERRANINFANTRYWEAPONSLEVEL2,
+ UpgradeId.BANSHEECLOAK,
+ UpgradeId.PERSONALCLOAKING
+]
+
+self.register_behavior(
+ UpgradeController(desired_upgrades, base_location=self.start_location)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
upgrade_list |
+
+ list[UpgradeId]
+ |
+
+
+
+ List of desired upgrades. + |
+
base_location |
+
+ Point2
+ |
+
+
+
+ Location to build upgrade buildings. + |
+
src/ares/behaviors/macro/upgrade_controller.py
23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 |
|
Explore the menu to access the available features, organized into two main sections:
+Convenient methods globally available: +
+ + +AresBot
+
+
+¶
+ Bases: CustomBotAI
Final setup of CustomBotAI for usage.
+Most bot logic should go in Hub.
+ + + + + + +src/ares/main.py
60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + 445 + 446 + 447 + 448 + 449 + 450 + 451 + 452 + 453 + 454 + 455 + 456 + 457 + 458 + 459 + 460 + 461 + 462 + 463 + 464 + 465 + 466 + 467 + 468 + 469 + 470 + 471 + 472 + 473 + 474 + 475 + 476 + 477 + 478 + 479 + 480 + 481 + 482 + 483 + 484 + 485 + 486 + 487 + 488 + 489 + 490 + 491 + 492 + 493 + 494 + 495 + 496 + 497 + 498 + 499 + 500 + 501 + 502 + 503 + 504 + 505 + 506 + 507 + 508 + 509 + 510 + 511 + 512 + 513 + 514 + 515 + 516 + 517 + 518 + 519 + 520 + 521 + 522 + 523 + 524 + 525 + 526 + 527 + 528 + 529 + 530 + 531 + 532 + 533 + 534 + 535 + 536 + 537 + 538 + 539 + 540 + 541 + 542 + 543 + 544 + 545 + 546 + 547 + 548 + 549 + 550 + 551 + 552 + 553 + 554 + 555 + 556 + 557 + 558 + 559 + 560 + 561 + 562 + 563 + 564 + 565 + 566 + 567 + 568 + 569 + 570 + 571 + 572 + 573 + 574 + 575 + 576 + 577 + 578 + 579 + 580 + 581 + 582 + 583 + 584 + 585 + 586 + 587 + 588 + 589 + 590 + 591 + 592 + 593 + 594 + 595 + 596 + 597 + 598 + 599 + 600 + 601 + 602 + 603 + 604 + 605 + 606 + 607 + 608 + 609 + 610 + 611 + 612 + 613 + 614 + 615 + 616 + 617 + 618 + 619 + 620 + 621 + 622 + 623 + 624 + 625 + 626 + 627 + 628 + 629 + 630 + 631 + 632 + 633 + 634 + 635 + 636 + 637 + 638 + 639 + 640 + 641 + 642 + 643 + 644 + 645 + 646 + 647 + 648 + 649 + 650 + 651 + 652 + 653 + 654 + 655 + 656 + 657 + 658 + 659 + 660 + 661 + 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 + 673 + 674 + 675 + 676 + 677 + 678 + 679 + 680 + 681 + 682 + 683 + 684 + 685 + 686 + 687 + 688 + 689 + 690 + 691 + 692 + 693 + 694 + 695 + 696 + 697 + 698 + 699 + 700 + 701 + 702 + 703 + 704 + 705 + 706 + 707 + 708 + 709 + 710 + 711 + 712 + 713 + 714 + 715 + 716 + 717 + 718 + 719 + 720 + 721 + 722 + 723 + 724 + 725 + 726 + 727 + 728 + 729 + 730 + 731 + 732 + 733 + 734 + 735 + 736 + 737 + 738 + 739 + 740 + 741 + 742 + 743 + 744 + 745 + 746 + 747 + 748 + 749 + 750 + 751 + 752 + 753 + 754 + 755 + 756 + 757 + 758 + 759 + 760 + 761 + 762 + 763 + 764 + 765 + 766 + 767 + 768 + 769 + 770 + 771 + 772 + 773 + 774 + 775 + 776 + 777 + 778 + 779 + 780 + 781 + 782 + 783 + 784 + 785 + 786 + 787 + 788 + 789 + 790 + 791 + 792 + 793 + 794 + 795 + 796 + 797 + 798 + 799 + 800 + 801 + 802 + 803 + 804 + 805 + 806 + 807 + 808 + 809 + 810 + 811 + 812 + 813 + 814 + 815 + 816 + 817 + 818 + 819 + 820 + 821 + 822 + 823 + 824 + 825 + 826 + 827 + 828 + 829 + 830 + 831 + 832 + 833 + 834 + 835 + 836 + 837 + 838 + 839 + 840 + 841 + 842 + 843 + 844 + 845 + 846 + 847 + 848 + 849 + 850 + 851 + 852 + 853 + 854 + 855 + 856 + 857 + 858 + 859 + 860 + 861 + 862 + 863 + 864 + 865 + 866 + 867 + 868 + 869 + 870 + 871 + 872 + 873 + 874 + 875 + 876 + 877 + 878 + 879 + 880 + 881 + 882 + 883 + 884 + 885 + 886 + 887 + 888 + 889 + 890 + 891 + 892 + 893 + 894 + 895 + 896 + 897 + 898 + 899 + 900 + 901 + 902 + 903 + 904 + 905 + 906 + 907 + 908 + 909 + 910 + 911 + 912 + 913 + 914 + 915 + 916 + 917 + 918 + 919 + 920 + 921 + 922 + 923 + 924 + 925 + 926 + 927 + 928 + 929 + 930 + 931 + 932 + 933 + 934 + 935 + 936 + 937 + 938 + 939 + 940 + 941 + 942 + 943 + 944 + 945 + 946 + 947 + 948 + 949 + 950 + 951 + 952 + 953 + 954 + 955 + 956 + 957 + 958 + 959 + 960 + 961 + 962 + 963 + 964 + 965 + 966 + 967 + 968 + 969 + 970 + 971 + 972 + 973 + 974 + 975 + 976 + 977 + 978 + 979 + 980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 |
|
mediator
+
+
+ property
+
+
+¶__init__(game_step_override=None)
+
+¶Load config and set up necessary attributes.
+game_step_override : + If provided, set the game_step to this value regardless of how it was + specified elsewhere
+ +src/ares/main.py
get_build_structures(structure_unit_types, unit_type, build_dict=None, ignored_build_from_tags=None)
+
+¶Get all structures (or units) where we can spawn unit_type. +Takes into account techlabs and reactors. And Gateway / warp gate
+structure_unit_types : + The valid build structures we can spawn this unit_type from. +unit_type : + The target unit we are trying to spawn. +build_dict : dict[Unit, UnitID] (optional) + Use to prevent selecting idle build structures that + have already got a pending order this frame. + Key: Unit that should get order, value: what UnitID to build +ignored_build_from_tags : Set[int] + Pass in if you don't want certain build structures selected.
+list[Unit] : + List of structures / units where this unit could possibly be spawned from.
+ +src/ares/main.py
865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 |
|
on_before_start()
+
+
+ async
+
+
+¶Train a drone and split workers before managers are set up
+Called before bot properly initializes
+None
+ +src/ares/main.py
on_building_construction_complete(unit)
+
+
+ async
+
+
+¶on_building_construction_started(unit)
+
+
+ async
+
+
+¶on_end(game_result)
+
+
+ async
+
+
+¶Output game info to the log and save data (if enabled)
+Called on game end
+game_result : Result + The game result
+None
+ +src/ares/main.py
on_start()
+
+
+ async
+
+
+¶Set up game step, managers, and information that requires game data
+Called just before the first step, all game info is available
+None
+ +src/ares/main.py
on_step(iteration)
+
+
+ async
+
+
+¶Play the game
+Called on every game step
+iteration : int + The current game iteration
+None
+ +src/ares/main.py
on_unit_created(unit)
+
+
+ async
+
+
+¶On unit created event (own units)
+unit : + The Unit that was just created
+None
+ +src/ares/main.py
on_unit_destroyed(unit_tag)
+
+
+ async
+
+
+¶on_unit_took_damage(unit, amount_damage_taken)
+
+
+ async
+
+
+¶On unit or structure taking damage
+unit : + The Unit that took damage +amount_damage_taken : + The amount of damage the Unit took
+None
+ +src/ares/main.py
register_behavior(behavior)
+
+¶Register behavior.
+Shortcut to self.behavior_executioner.register_behavior
behavior : Behavior + Class that follows the Behavior interface.
+None
+ +src/ares/main.py
register_managers()
+
+¶Register standard and custom managers.
+Override in your bot class if you wish to use custom managers.
+custom_production_manager = CustomProductionManager( + self, self.config, manager_mediator +) +new_manager = NewManager(self, self.config, manager_mediator)
+self.manager_hub = Hub( + self, + self.config, + manager_mediator, + production_manager=custom_production_manager, + additional_managers=[new_manager], +)
+None
+ +src/ares/main.py
structure_pending(structure_type)
+
+¶Checks pending structures, includes workers on route.
+Alternative and faster version of self.already_pending
structure_type
+int
+ +src/ares/main.py
structure_present_or_pending(structure_type)
+
+¶Checks presence of a structure, or if worker is on route to +build structure.
+structure_type
+bool
+ +src/ares/main.py
To enable communication between managers in ares-sc2, the mediator pattern is used internally. If you need to request
+information or perform an action from a manager, it is strongly recommended that you do so through the mediator,
+which can be accessed via self.mediator
. For example:
Mediator concrete class is the single source of truth and coordinator of +communications between the managers.
+ + + + + + +src/ares/managers/manager_mediator.py
68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + 445 + 446 + 447 + 448 + 449 + 450 + 451 + 452 + 453 + 454 + 455 + 456 + 457 + 458 + 459 + 460 + 461 + 462 + 463 + 464 + 465 + 466 + 467 + 468 + 469 + 470 + 471 + 472 + 473 + 474 + 475 + 476 + 477 + 478 + 479 + 480 + 481 + 482 + 483 + 484 + 485 + 486 + 487 + 488 + 489 + 490 + 491 + 492 + 493 + 494 + 495 + 496 + 497 + 498 + 499 + 500 + 501 + 502 + 503 + 504 + 505 + 506 + 507 + 508 + 509 + 510 + 511 + 512 + 513 + 514 + 515 + 516 + 517 + 518 + 519 + 520 + 521 + 522 + 523 + 524 + 525 + 526 + 527 + 528 + 529 + 530 + 531 + 532 + 533 + 534 + 535 + 536 + 537 + 538 + 539 + 540 + 541 + 542 + 543 + 544 + 545 + 546 + 547 + 548 + 549 + 550 + 551 + 552 + 553 + 554 + 555 + 556 + 557 + 558 + 559 + 560 + 561 + 562 + 563 + 564 + 565 + 566 + 567 + 568 + 569 + 570 + 571 + 572 + 573 + 574 + 575 + 576 + 577 + 578 + 579 + 580 + 581 + 582 + 583 + 584 + 585 + 586 + 587 + 588 + 589 + 590 + 591 + 592 + 593 + 594 + 595 + 596 + 597 + 598 + 599 + 600 + 601 + 602 + 603 + 604 + 605 + 606 + 607 + 608 + 609 + 610 + 611 + 612 + 613 + 614 + 615 + 616 + 617 + 618 + 619 + 620 + 621 + 622 + 623 + 624 + 625 + 626 + 627 + 628 + 629 + 630 + 631 + 632 + 633 + 634 + 635 + 636 + 637 + 638 + 639 + 640 + 641 + 642 + 643 + 644 + 645 + 646 + 647 + 648 + 649 + 650 + 651 + 652 + 653 + 654 + 655 + 656 + 657 + 658 + 659 + 660 + 661 + 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 + 673 + 674 + 675 + 676 + 677 + 678 + 679 + 680 + 681 + 682 + 683 + 684 + 685 + 686 + 687 + 688 + 689 + 690 + 691 + 692 + 693 + 694 + 695 + 696 + 697 + 698 + 699 + 700 + 701 + 702 + 703 + 704 + 705 + 706 + 707 + 708 + 709 + 710 + 711 + 712 + 713 + 714 + 715 + 716 + 717 + 718 + 719 + 720 + 721 + 722 + 723 + 724 + 725 + 726 + 727 + 728 + 729 + 730 + 731 + 732 + 733 + 734 + 735 + 736 + 737 + 738 + 739 + 740 + 741 + 742 + 743 + 744 + 745 + 746 + 747 + 748 + 749 + 750 + 751 + 752 + 753 + 754 + 755 + 756 + 757 + 758 + 759 + 760 + 761 + 762 + 763 + 764 + 765 + 766 + 767 + 768 + 769 + 770 + 771 + 772 + 773 + 774 + 775 + 776 + 777 + 778 + 779 + 780 + 781 + 782 + 783 + 784 + 785 + 786 + 787 + 788 + 789 + 790 + 791 + 792 + 793 + 794 + 795 + 796 + 797 + 798 + 799 + 800 + 801 + 802 + 803 + 804 + 805 + 806 + 807 + 808 + 809 + 810 + 811 + 812 + 813 + 814 + 815 + 816 + 817 + 818 + 819 + 820 + 821 + 822 + 823 + 824 + 825 + 826 + 827 + 828 + 829 + 830 + 831 + 832 + 833 + 834 + 835 + 836 + 837 + 838 + 839 + 840 + 841 + 842 + 843 + 844 + 845 + 846 + 847 + 848 + 849 + 850 + 851 + 852 + 853 + 854 + 855 + 856 + 857 + 858 + 859 + 860 + 861 + 862 + 863 + 864 + 865 + 866 + 867 + 868 + 869 + 870 + 871 + 872 + 873 + 874 + 875 + 876 + 877 + 878 + 879 + 880 + 881 + 882 + 883 + 884 + 885 + 886 + 887 + 888 + 889 + 890 + 891 + 892 + 893 + 894 + 895 + 896 + 897 + 898 + 899 + 900 + 901 + 902 + 903 + 904 + 905 + 906 + 907 + 908 + 909 + 910 + 911 + 912 + 913 + 914 + 915 + 916 + 917 + 918 + 919 + 920 + 921 + 922 + 923 + 924 + 925 + 926 + 927 + 928 + 929 + 930 + 931 + 932 + 933 + 934 + 935 + 936 + 937 + 938 + 939 + 940 + 941 + 942 + 943 + 944 + 945 + 946 + 947 + 948 + 949 + 950 + 951 + 952 + 953 + 954 + 955 + 956 + 957 + 958 + 959 + 960 + 961 + 962 + 963 + 964 + 965 + 966 + 967 + 968 + 969 + 970 + 971 + 972 + 973 + 974 + 975 + 976 + 977 + 978 + 979 + 980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864 +1865 +1866 +1867 +1868 +1869 +1870 +1871 +1872 +1873 +1874 +1875 +1876 +1877 +1878 +1879 +1880 +1881 +1882 +1883 +1884 +1885 +1886 +1887 +1888 +1889 +1890 +1891 +1892 +1893 +1894 +1895 +1896 +1897 +1898 +1899 +1900 +1901 +1902 +1903 +1904 +1905 +1906 +1907 +1908 +1909 +1910 +1911 +1912 +1913 +1914 +1915 +1916 +1917 +1918 +1919 +1920 +1921 +1922 +1923 +1924 +1925 +1926 +1927 +1928 +1929 +1930 +1931 +1932 +1933 +1934 +1935 +1936 +1937 +1938 +1939 +1940 +1941 +1942 +1943 +1944 +1945 +1946 +1947 +1948 +1949 +1950 +1951 +1952 +1953 +1954 +1955 +1956 +1957 +1958 +1959 +1960 +1961 +1962 +1963 +1964 +1965 +1966 +1967 +1968 +1969 +1970 +1971 +1972 +1973 +1974 +1975 +1976 +1977 +1978 +1979 +1980 +1981 +1982 +1983 +1984 +1985 +1986 +1987 +1988 +1989 +1990 +1991 +1992 +1993 +1994 +1995 +1996 +1997 +1998 +1999 +2000 +2001 +2002 +2003 +2004 +2005 +2006 +2007 +2008 +2009 +2010 +2011 +2012 +2013 +2014 +2015 +2016 +2017 +2018 +2019 +2020 +2021 +2022 +2023 +2024 +2025 +2026 +2027 +2028 +2029 +2030 +2031 +2032 +2033 +2034 +2035 +2036 +2037 +2038 +2039 +2040 +2041 +2042 +2043 +2044 +2045 +2046 +2047 +2048 +2049 +2050 +2051 +2052 +2053 +2054 +2055 +2056 +2057 +2058 +2059 +2060 +2061 +2062 +2063 +2064 +2065 +2066 +2067 +2068 +2069 +2070 +2071 +2072 +2073 +2074 +2075 +2076 +2077 +2078 +2079 +2080 +2081 +2082 +2083 +2084 +2085 +2086 |
|
get_air_avoidance_grid
+
+
+ property
+
+
+¶get_air_grid
+
+
+ property
+
+
+¶get_air_vs_ground_grid
+
+
+ property
+
+
+¶get_all_enemy
+
+
+ property
+
+
+¶Get all enemy units.
+UnitMemoryManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ All enemy units. + |
+
get_building_counter
+
+
+ property
+
+
+¶Get a dictionary containing the number of each type of building in progress.
+BuildingManager.
+ + +Returns:
+Type | +Description | +
---|---|
+ DefaultDict[UnitTypeId, int]
+ |
+
+
+
+ DefaultDict[UnitTypeId, int]: +Number of each type of UnitTypeId +currently being tracked for building. + |
+
get_building_tracker_dict
+
+
+ property
+
+
+¶Get the building tracker dictionary.
+Building Manager.
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, dict[str, Union[Point2, Unit, UnitTypeId, float]]]
+ |
+
+
+
+ dict[int, dict[str, Union[Point2, Unit, UnitTypeId, float]]]: +Tracks the worker tag to details such as the UnitTypeId of the +building, the Point2 location for placement, the in-game +time when the order started, and the purpose of the building. + |
+
get_cached_enemy_army
+
+
+ property
+
+
+¶Get the Units object for the enemy army.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ The enemy army. + |
+
get_cached_enemy_workers
+
+
+ property
+
+
+¶Get the Units object for the enemy workers.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ The enemy workers. + |
+
get_cached_ground_grid
+
+
+ property
+
+
+¶get_climber_grid
+
+
+ property
+
+
+¶get_defensive_third
+
+
+ property
+
+
+¶Get the third furthest from enemy.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Location of the third base furthest from the enemy. + |
+
get_enemy_army_dict
+
+
+ property
+
+
+¶Get the dictionary of enemy army unit types to the units themselves.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ DefaultDict[UnitTypeId, Units]
+ |
+
+
+
+ The dictionary of enemy army unit types to the units themselves. + |
+
get_enemy_expanded
+
+
+ property
+
+
+¶Has the enemy expanded?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Has enemy expanded out of their main? + |
+
get_enemy_expansions
+
+
+ property
+
+
+¶Get the expansions, as ordered from the enemy's point of view.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ list[Tuple[Point2, float]]
+ |
+
+
+
+ list[Tuple[Point2, float]]: +The first element is the +location of the base. The second element is the pathing +distance from the enemy main base. + |
+
get_enemy_fliers
+
+
+ property
+
+
+¶Get enemy flying units.
+UnitMemoryManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Enemy flying units. + |
+
get_enemy_four_gate
+
+
+ property
+
+
+¶Has the enemy gone four gate?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Is enemy four gate? + |
+
get_enemy_fourth
+
+
+ property
+
+
+¶Get the enemy fourth base.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Location of the enemy fourth base. + |
+
get_enemy_ground
+
+
+ property
+
+
+¶Get enemy ground units.
+UnitMemoryManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Enemy ground units. + |
+
get_enemy_has_base_outside_natural
+
+
+ property
+
+
+¶Has the enemy expanded outside of their natural?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Has enemy expanded out of natural? + |
+
get_enemy_ling_rushed
+
+
+ property
+
+
+¶Has the enemy ling rushed?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Enemy ling rushed? + |
+
get_enemy_marauder_rush
+
+
+ property
+
+
+¶Is the enemy currently marauder rushing?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Enemy marauder rush? + |
+
get_enemy_marine_rush
+
+
+ property
+
+
+¶Is the enemy currently marine rushing?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Enemy marine rushed? + |
+
get_enemy_nat
+
+
+ property
+
+
+¶Get the enemy natural expansion.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Location of the enemy natural expansion. + |
+
get_enemy_ramp
+
+
+ property
+
+
+¶Get the enemy main base ramp.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Ramp
+ |
+
+
+
+ sc2 Ramp object for the enemy main base ramp. + |
+
get_enemy_ravager_rush
+
+
+ property
+
+
+¶Has the enemy ravager rushed?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy ravager rush? + |
+
get_enemy_roach_rushed
+
+
+ property
+
+
+¶Did the enemy roach rush?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy roach rushed? + |
+
get_enemy_third
+
+
+ property
+
+
+¶Get the enemy third base.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Location of the enemy third base. + |
+
get_enemy_tree
+
+
+ property
+
+
+¶Get the KDTree representing all enemy unit positions.
+UnitMemoryManager
+ + +Returns:
+Type | +Description | +
---|---|
+ KDTree
+ |
+
+
+
+ KDTree representing all enemy unit positions. + |
+
get_enemy_was_greedy
+
+
+ property
+
+
+¶Was the enemy greedy?
+WARNING: Currently not working, will always return False
+WARNING: Opinionated method, please write your own if you don't
+agree with this decision.
Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy was greedy? + |
+
get_enemy_went_four_gate
+
+
+ property
+
+
+¶The enemy went four gate this game?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy went four gate in this game? + |
+
get_enemy_went_marauder_rush
+
+
+ property
+
+
+¶The enemy went marauder rush this game?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy went marauder rush in this game? + |
+
get_enemy_went_marine_rush
+
+
+ property
+
+
+¶The enemy went marine rush this game?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy went marine rush in this game? + |
+
get_enemy_went_reaper
+
+
+ property
+
+
+¶The enemy opened with reaper this game?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy went reaper in this game? + |
+
get_enemy_worker_rushed
+
+
+ property
+
+
+¶The enemy went for a worker rush this game?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Enemy went worker rush in this game? + |
+
get_flying_enemy_near_bases
+
+
+ property
+
+
+¶Get dictionary containing flying enemy near townhalls.
+EnemyToBase Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, set[int]]
+ |
+
+
+
+ dict[int, set[int]]: +A dictionary mapping townhall tags (keys) to sets of + enemy tags (values) near each base. + |
+
get_flying_structure_tracker
+
+
+ property
+
+
+¶Get the current information stored by FlyingStructureManager.
+FlyingStructureManager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, Any]
+ |
+
+
+
+ Key -> structure_tag, Value -> Information about the flight. + |
+
get_forcefield_positions
+
+
+ property
+
+
+¶get_ground_avoidance_grid
+
+
+ property
+
+
+¶Get the ground avoidance pathing grid.
+GridManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The ground avoidance pathing grid. + |
+
get_ground_enemy_near_bases
+
+
+ property
+
+
+¶Get dictionary containing ground enemy near townhalls.
+EnemyToBase Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, set[int]]
+ |
+
+
+
+ dict[int, set[int]]: +A dictionary where the integer key is a townhall tag. +And the value contains a set of ints containing +enemy tags near this base. + |
+
get_ground_grid
+
+
+ property
+
+
+¶Get the ground pathing grid.
+GridManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The ground pathing grid. + |
+
get_ground_to_air_grid
+
+
+ property
+
+
+¶Get the ground pathing grid.
+GridManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The ground pathing grid. + |
+
get_initial_pathing_grid
+
+
+ property
+
+
+¶Get the pathing grid as it was on the first iteration.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The pathing grid as it was on the first iteration. + |
+
get_is_free_expansion
+
+
+ property
+
+
+¶Check all bases for a free expansion.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ True if there exists a free expansion, False otherwise. + |
+
get_is_proxy_zealot
+
+
+ property
+
+
+¶There is currently proxy zealot attempt from enemy?
+WARNING: Opinionated method, please write your own if you don't +agree with this decision.
+Intel Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Enemy is attempting a proxy zealot rush? + |
+
get_main_air_threats_near_townhall
+
+
+ property
+
+
+¶Get the main enemy air force near one of our bases.
+EnemyToBase Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ The largest enemy air force near our bases. + |
+
get_main_ground_threats_near_townhall
+
+
+ property
+
+
+¶Get the main enemy ground force near one of our bases.
+EnemyToBase Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ The largest enemy ground force near our bases. + |
+
get_map_choke_points
+
+
+ property
+
+
+¶All the points on the map that compose choke points.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ set[Point2]
+ |
+
+
+
+ All the points on the map that compose choke points. + |
+
get_map_data_object
+
+
+ property
+
+
+¶Get the MapAnalyzer.MapData object being used.
+PathManager
+ + +Returns:
+Type | +Description | +
---|---|
+ MapData
+ |
+
+
+
+ The MapAnalyzer.MapData object being used. + |
+
get_mineral_patch_to_list_of_workers
+
+
+ property
+
+
+¶Get a dictionary containing mineral tag to worker tags
+Resource Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ Dict[int, Set[int]]
+ |
+
+
+
+ Dictionary where key is mineral tag, and value is workers assigned here. + |
+
get_mineral_target_dict
+
+
+ property
+
+
+¶Get position in front of each mineral.
+This position is used for speed mining, and is also useful for +making sure worker is moved to the right side of a mineral.
+ResourceManager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, Point2]
+ |
+
+
+
+ Key -> mineral tag, Value -> Position + |
+
get_num_available_mineral_patches
+
+
+ property
+
+
+¶Get the number available mineral fields.
+An available mineral field is one that is near a townhall and has fewer than two +assigned workers.
+ResourceManager
+ + +Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ Number available mineral fields. + |
+
get_ol_spot_near_enemy_nat
+
+
+ property
+
+
+¶Get the overlord spot nearest to the enemy natural.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Overlord spot near the enemy natural. + |
+
get_ol_spots
+
+
+ property
+
+
+¶High ground Overlord hiding spots.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ List of Overlord hiding spots. + |
+
get_old_own_army_dict
+
+
+ property
+
+
+¶Get the previous iteration's own_army
dict.
UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Dict[UnitTypeId, Units]
+ |
+
+
+
+ The dictionary of own army unit types to the units themselves. + |
+
get_own_army
+
+
+ property
+
+
+¶Get the Units object for our own army.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Our own army. + |
+
get_own_army_dict
+
+
+ property
+
+
+¶Get the dictionary of own army unit types to the units themselves.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Dict[UnitTypeId, Units]
+ |
+
+
+
+ The dictionary of own army unit types to the units themselves. + |
+
get_own_expansions
+
+
+ property
+
+
+¶Get the expansions.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ list[Tuple[Point2, float]]
+ |
+
+
+
+ List[Tuple[Point2, float]]: List of Tuples where +The first element is the location of the base. +The second element is the pathing distance from our main base. + |
+
get_own_nat
+
+
+ property
+
+
+¶Get our natural expansion.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Location of our natural expansion. + |
+
get_own_structures_dict
+
+
+ property
+
+
+¶Get the dictionary of own structure types to the units themselves.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ DefaultDict[UnitTypeId, Units]
+ |
+
+
+
+ The dictionary of own structure types to the units themselves. + |
+
get_own_tree
+
+
+ property
+
+
+¶Get the KDTree representing all friendly unit positions.
+UnitMemoryManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ KDTree representing all friendly unit positions. + |
+
get_placements_dict
+
+
+ property
+
+
+¶Get the placement dict ares calculated at beginning +of the game.
+Structure of dictionary:
+base_loc is a Point2 key for every expansion location on map.
+placement_dict = {
+ base_loc: Point2:
+ BuildingSize.TWO_BY_TWO: {
+ building_pos: Point2((2, 2)):
+ {
+ available: True,
+ has_addon: False
+ taken: False,
+ is_wall: True,
+ building_tag: 0,
+ worker_on_route: False,
+ time_requested: 0.0,
+ production_pylon: False,
+ bunker: False,
+ optimal_pylon: False
+ },
+ {...}
+ },
+ BuildingSize.THREE_BY_THREE: {
+ building_pos: Point2((5, 5)):
+ {
+ available: True,
+ has_addon: False
+ taken: False,
+ is_wall: True,
+ building_tag: 0,
+ worker_on_route: False,
+ time_requested: 0.0,
+ production_pylon: False,
+ bunker: False,
+ optimal_pylon: False
+ },
+ {...}
+ },
+ {...}
+}
+
PlacementManager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict
+ |
+
+
+
+ Indicating if structure can be placed at given position. + |
+
get_positions_blocked_by_burrowed_enemy
+
+
+ property
+
+
+¶Build positions that are blocked by a burrowed enemy unit.
+TerrainManager
+ + +Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ List of build positions that are blocked by a burrowed enemy unit. + |
+
get_priority_ground_avoidance_grid
+
+
+ property
+
+
+¶Get the pathing grid containing things ground units should always avoid.
+GridManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The priority ground avoidance pathing grid. + |
+
get_pvz_nat_gatekeeping_pos
+
+
+ property
+
+
+¶Get the gatekeeper position in a PvZ natural wall if available.
+WARNING: This can return None
so your code should account for this.
PlacementManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Union[Point2, None]
+ |
+
+
+
+ Position of gatekeeper in natural wall + |
+
get_removed_units
+
+
+ property
+
+
+¶Get the units removed from memory units.
+UnitCacheManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ The units removed from memory units. + |
+
get_tactical_ground_grid
+
+
+ property
+
+
+¶Get the tactical ground grid.
+Normal pathable tiles with no units on them +have a value of 1000.0
+Tiles with more enemy have value > 1000 +Tiles with more friendly have value < 1000
+GridManager
+ + +Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ The ground tactical grid. + |
+
get_th_tag_with_largest_ground_threat
+
+
+ property
+
+
+¶Get the tag of our townhall with the largest enemy ground force nearby.
+WARNING: This will remember the townhall tag even if enemy has gone.
+Do not use this to detect enemy at a base.
+Use get_main_ground_threats_near_townhall
+Or get_ground_enemy_near_bases
instead
EnemyToBase Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ The largest enemy ground force near our bases. + |
+
get_unit_role_dict
+
+
+ property
+
+
+¶Get the dictionary of UnitRole
to the set of tags of units with that role.
UnitRoleManager
+ + +Returns:
+Type | +Description | +
---|---|
+ Dict[UnitRole, Set[int]]
+ |
+
+
+
+ Dictionary of |
+
get_unit_to_ability_dict
+
+
+ property
+
+
+¶Get a dictionary containing unit tag, to ability frame cooldowns.
+AbilityTrackerManager.
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, Any]
+ |
+
+
+
+ Unit tag to abilities and the next frame they can be casted. + |
+
get_whole_map_array
+
+
+ property
+
+
+¶Get the list containing every point on the map.
+GridManager
+This does not return Point2s.
+ + +Returns:
+Type | +Description | +
---|---|
+ list[list[int]]
+ |
+
+
+
+ Every point on the map. + |
+
get_whole_map_tree
+
+
+ property
+
+
+¶Get the KDTree of all points on the map.
+PathManager
+ + +Returns:
+Type | +Description | +
---|---|
+ KDTree
+ |
+
+
+
+ KDTree of all points on the map. + |
+
get_worker_tag_to_townhall_tag
+
+
+ property
+
+
+¶Get a dictionary containing worker tag to townhall tag. +Where the townhall is the place where worker returns resources
+Resource Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, int]
+ |
+
+
+
+ Dictionary where key is worker tag, and value is townhall tag. + |
+
get_worker_to_mineral_patch_dict
+
+
+ property
+
+
+¶Get a dictionary containing worker tag to mineral patch tag.
+Resource Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict[int, int]
+ |
+
+
+
+ Dictionary where key is worker tag, and value is mineral tag. + |
+
get_worker_to_vespene_dict
+
+
+ property
+
+
+¶Get a dictionary containing worker tag to gas building tag.
+Resource Manager
+ + +Returns:
+Type | +Description | +
---|---|
+ dict
+ |
+
+
+
+ Dictionary where key is worker tag, and value is gas building tag. + |
+
add_managers(managers)
+
+¶Generate manager dictionary.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ managers
+ |
+
+ list['Manager']
+ |
+
+
+
+ List of all Managers capable of handling ManagerRequests. + |
+ + required + | +
src/ares/managers/manager_mediator.py
assign_role(**kwargs)
+
+¶Assign a unit a role.
+UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ tag
+ |
+
+ int
+ |
+
+
+
+ Tag of the unit to be assigned. + |
+ + required + | +
+ role
+ |
+
+ UnitRole
+ |
+
+
+
+ What role the unit should have. + |
+ + required + | +
+ remove_from_squad
+ |
+
+ bool
+ |
+
+
+
+ Attempt to remove +this unit from squad bookkeeping. Default is True. + |
+ + required + | +
src/ares/managers/manager_mediator.py
batch_assign_role(**kwargs)
+
+¶Assign a given role to a List of unit tags.
+Nothing more than a for loop, provided for convenience.
+UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ tags
+ |
+
+ Set[int]
+ |
+
+
+
+ Tags of the units to assign to a role. + |
+ + required + | +
+ role
+ |
+
+ UnitRole
+ |
+
+
+
+ The role the units should be assigned to. + |
+ + required + | +
src/ares/managers/manager_mediator.py
build_with_specific_worker(**kwargs)
+
+¶Build a structure with a specific worker.
+BuildingManager.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ worker
+ |
+
+ Unit
+ |
+
+
+
+ The chosen worker. + |
+ + required + | +
+ structure_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ What type of structure to build. + |
+ + required + | +
+ pos
+ |
+
+ Point2
+ |
+
+
+
+ Where the structure should be placed. + |
+ + required + | +
+ building_purpose
+ |
+
+ BuildingPurpose
+ |
+
+
+
+ Why the structure is being placed. + |
+ + required + | +
Returns:
+Name | Type | +Description | +
---|---|---|
bool |
+ bool
+ |
+
+
+
+ True if a position for the building is found and + |
+
+ bool
+ |
+
+
+
+ the worker is valid, otherwise False. + |
+
src/ares/managers/manager_mediator.py
building_position_blocked_by_burrowed_unit(**kwargs)
+
+¶See if the building position is blocked by a burrowed unit.
+TerrainManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ worker_tag
+ |
+
+ int
+ |
+
+
+
+ The worker attempting to build the structure. + |
+ + required + | +
+ position
+ |
+
+ Point2
+ |
+
+
+
+ Where the structure is attempting to be placed. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Optional[Point2]
+ |
+
+
+
+ The position that's blocked by an enemy unit. + |
+
src/ares/managers/manager_mediator.py
can_place_structure(**kwargs)
+
+¶Check if structure can be placed at a given position.
+Faster cython alternative to python-sc2
await self.can_place()
PlacementManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ position
+ |
+
+ Point2
+ |
+
+
+
+ The intended building position. + |
+ + required + | +
+ structure_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ Structure type we want to place. + |
+ + required + | +
+ include_addon
+ |
+
+ bool
+ |
+
+
+
+ For Terran structures, +check addon will place too. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Indicating if structure can be placed at given position. + |
+
src/ares/managers/manager_mediator.py
can_win_fight(**kwargs)
+
+¶Get the predicted engagement result between two forces.
+Combat Sim Manager.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ own_units
+ |
+
+ Units
+ |
+
+
+
+ Our units involved in the battle. + |
+ + required + | +
+ enemy_units
+ |
+
+ Units
+ |
+
+
+
+ The enemy units. + |
+ + required + | +
+ timing_adjust
+ |
+
+ bool
+ |
+
+
+
+ Whether to consider the distance between units. + |
+ + required + | +
+ good_positioning
+ |
+
+ bool
+ |
+
+
+
+ Whether to assume units are decently split. + |
+ + required + | +
+ workers_do_no_damage
+ |
+
+ bool
+ |
+
+
+
+ Whether to ignore workers' damage. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ EngagementResult
+ |
+
+
+
+ Enum indicating the human-readable engagement result. + |
+
src/ares/managers/manager_mediator.py
cancel_structure(**kwargs)
+
+¶Cancel a structure and remove from internal ares bookkeeping.
+If you try cancelling without calling this method, ares may try +to keep rebuilding the cancelled structure.
+BuildingManager.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ structure
+ |
+
+ Unit
+ |
+
+
+
+ The actual structure to cancel. + |
+ + required + | +
src/ares/managers/manager_mediator.py
clear_role(**kwargs)
+
+¶Clear a unit's role.
+UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ tag
+ |
+
+ int
+ |
+
+
+
+ Tag of the unit to clear the role of. + |
+ + required + | +
src/ares/managers/manager_mediator.py
find_closest_safe_spot(**kwargs)
+
+¶Find the closest point with the lowest cost on a grid.
+PathManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ from_pos
+ |
+
+ Point2
+ |
+
+
+
+ Where the search starts from. + |
+ + required + | +
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ The grid to find the low-cost point on. + |
+ + required + | +
+ radius
+ |
+
+ float
+ |
+
+
+
+ How far away the safe point can be. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ The closest location with the lowest cost. + |
+
src/ares/managers/manager_mediator.py
find_low_priority_path(**kwargs)
+
+¶Find several points in a path.
+This way a unit can queue them up all at once for performance reasons.
+i.e. running drones from a base or sending an overlord to a new position.
+This does not return every point in the path. Instead, it returns points spread +along the path.
+PathManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ start
+ |
+
+ Point2
+ |
+
+
+
+ Start point of the path. + |
+ + required + | +
+ target
+ |
+
+ Point2
+ |
+
+
+
+ Desired end point of the path. + |
+ + required + | +
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ The grid that should be used for pathing. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ List of points composing the path. + |
+
src/ares/managers/manager_mediator.py
find_lowest_cost_points(**kwargs)
+
+¶Find the point(s) with the lowest cost within radius
from from_pos
.
PathManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ from_pos
+ |
+
+ Point2
+ |
+
+
+
+ Point to start the search from. + |
+ + required + | +
+ radius
+ |
+
+ float
+ |
+
+
+
+ How far away the returned points can be. + |
+ + required + | +
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ Which grid to query for lowest cost points. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ Points with the lowest cost on the grid. + |
+
src/ares/managers/manager_mediator.py
find_path_next_point(**kwargs)
+
+¶Find the next point in a path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ start
+ |
+
+ Point2
+ |
+
+
+
+ Start point of the path. + |
+ + required + | +
+ target
+ |
+
+ Point2
+ |
+
+
+
+ Desired end point of the path. + |
+ + required + | +
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ The grid that should be used for pathing. + |
+ + required + | +
+ sensitivity
+ |
+
+ int
+ |
+
+
+
+ Amount of points that should be +skipped in the full path between tiles that are returned. +Default value is 5. + |
+ + required + | +
+ smoothing
+ |
+
+ bool
+ |
+
+
+
+ Optional path smoothing where nodes are +removed if it's possible to jump ahead some tiles in +a straight line with a lower cost. +Default value is False. + |
+ + required + | +
+ sense_danger
+ |
+
+ bool
+ |
+
+
+
+ Check to see if there are any +dangerous tiles near the starting point. If this is True and +there are no dangerous tiles near the starting point, +the pathing query is skipped and the target is returned. +Default value is True. + |
+ + required + | +
+ danger_distance
+ |
+
+ float
+ |
+
+
+
+ How far away from the +start to look for danger. +Default value is 20. + |
+ + required + | +
+ danger_threshold
+ |
+
+ float
+ |
+
+
+
+ Minimum value for a tile +to be considered dangerous. +Default value is 5. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ The next point in the path from the start to the target which may be the + |
+
+ Point2
+ |
+
+
+
+ same as the target if it's safe. + |
+
src/ares/managers/manager_mediator.py
find_raw_path(**kwargs)
+
+¶Used for finding a full path, mostly for distance checks.
+PathManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ start
+ |
+
+ Point2
+ |
+
+
+
+ Start point of the path. + |
+ + required + | +
+ target
+ |
+
+ Point2
+ |
+
+
+
+ Desired end point of the path. + |
+ + required + | +
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ The grid that should be used for pathing. + |
+ + required + | +
+ sensitivity
+ |
+
+ int
+ |
+
+
+
+ Amount of points that should be skipped in +the full path between tiles that are returned. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ List of points composing the path. + |
+
src/ares/managers/manager_mediator.py
get_all_from_roles_except(**kwargs)
+
+¶Get all units from the given roles except for unit types in excluded.
+UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ roles
+ |
+
+ Set[UnitRole]
+ |
+
+
+
+ Roles to get units from. + |
+ + required + | +
+ excluded
+ |
+
+ Set[UnitTypeId]
+ |
+
+
+
+ Unit types that should not be included. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Units matching the role that are not of an excluded type. + |
+
src/ares/managers/manager_mediator.py
get_behind_mineral_positions(**kwargs)
+
+¶Finds 3 spots behind the mineral line
+This is useful for building structures out of typical cannon range.
+TerrainManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ th_pos
+ |
+
+ Point2
+ |
+
+
+
+ Position of townhall to find points behind +the mineral line of. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list[Point2]
+ |
+
+
+
+ Points behind the mineral line of the designated base. + |
+
src/ares/managers/manager_mediator.py
get_closest_overlord_spot(**kwargs)
+
+¶Given a position, find the closest high ground overlord spot.
+TerrainManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ from_pos
+ |
+
+ Point2
+ |
+
+
+
+ Position the Overlord spot should be closest to. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ The closest Overlord hiding spot to the position. + |
+
src/ares/managers/manager_mediator.py
get_flood_fill_area(**kwargs)
+
+¶Given a point, flood fill outward from it and return the valid points.
+This flood fill does not continue through chokes.
+TerrainManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ start_point
+ |
+
+ Point2
+ |
+
+
+
+ Where to start the flood fill. + |
+ + required + | +
+ max_dist
+ |
+
+ float
+ |
+
+
+
+ Only include points closer than this +distance to the start point. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ set[tuple[int, int]]
+ |
+
+
+
+ Tuple[int, List[Tuple[int, int]]]: +First element is the number of valid points. +Second element is the list of all valid points. + |
+
src/ares/managers/manager_mediator.py
get_own_unit_count(**kwargs)
+
+¶Get the dictionary of own structure types to the units themselves.
+UnitCacheManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ unit_type_id
+ |
+
+ UnitTypeId
+ |
+
+
+
+ Unit type to count. + |
+ + required + | +
+ include_alias
+ |
+
+ bool
+ |
+
+
+
+ Check aliases. (default=True) + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ Total count of this unit including aliases if specified. + |
+
src/ares/managers/manager_mediator.py
get_position_of_main_squad(**kwargs)
+
+¶Given a unit role, find where the main squad is.
+SquadManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ role
+ |
+
+ UnitRole
+ |
+
+
+
+ Get the squads for this unit role. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Point2
+ |
+
+
+
+ Position of main squad for this |
+
src/ares/managers/manager_mediator.py
get_squads(**kwargs)
+
+¶Given a unit role, get the updated squads.
+SquadManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ role
+ |
+
+ UnitRole
+ |
+
+
+
+ Get the squads for this unit role. + |
+ + required + | +
+ squad_radius
+ |
+ + | +
+
+
+ The threshold as to which separate squads are formed. + |
+ + required + | +
+ unit_type
+ |
+ + | +
+
+
+ If specified, only form squads with these unit types +WARNING: Will not remove units that have already + been assigned to a squad. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list['UnitSquad']
+ |
+
+
+
+ Each squad with this unit role. + |
+
src/ares/managers/manager_mediator.py
get_units_from_role(**kwargs)
+
+¶Get a Units object containing units with a given role.
+If a UnitID or set of UnitIDs are given, it will only return units of those
+types, otherwise it will return all units with the role. If restrict_to
is
+specified, it will only retrieve units from that object.
UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ role
+ |
+
+ UnitRole
+ |
+
+
+
+ Role to get units from. + |
+ + required + | +
+ unit_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ Type(s) of units that should be returned. +If omitted, all units with the role will be returned. + |
+ + required + | +
+ restrict_to
+ |
+
+ Set[UnitTypeId]
+ |
+
+
+
+ If supplied, only take Units +with the given role and type if they also exist here. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Units with the given role. + |
+
src/ares/managers/manager_mediator.py
get_units_from_roles(**kwargs)
+
+¶Get the units matching unit_type
from the given roles.
UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ roles
+ |
+
+ Set[UnitRole]
+ |
+
+
+
+ Roles to get units from. + |
+ + required + | +
+ unit_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ Type(s) of units that should be returned. +If omitted, all units with the role will be returned. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Units
+ |
+
+
+
+ Units with the given roles. + |
+
src/ares/managers/manager_mediator.py
get_units_from_tags(**kwargs)
+
+¶Get a list
of Unit
objects corresponding to the given tags.
UnitCacheManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ tags
+ |
+ + | +
+
+
+ Tags of the units to retrieve. + |
+ + required + | +
src/ares/managers/manager_mediator.py
get_units_in_range(**kwargs)
+
+¶Get units in range of other units or points.
+UnitMemoryManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ start_points
+ |
+
+ List[Union[Unit, Tuple[float, float]]]
+ |
+
+
+
+ List of |
+ + required + | +
+ distances
+ |
+
+ Union[float, List[float]]
+ |
+
+
+
+ How far away from each point to
+query. Must broadcast to the length of |
+ + required + | +
+ query_tree
+ |
+
+ UnitTreeQueryType
+ |
+
+
+
+ Which KDTree should be queried. + |
+ + required + | +
+ return_as_dict
+ |
+
+ bool
+ |
+
+
+
+ Sets whether the returned units in range +should be a dictionary or list. Default is False. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Union[Dict[Union[int, Tuple[float, float]], Units], list[Units]]
+ |
+
+
+
+ Union[Dict[Union[int, Tuple[float, float]], Units], List[Units]]:
+Returns the units in range of each start point as a |
+
src/ares/managers/manager_mediator.py
is_position_safe(**kwargs)
+
+¶Check if the given position is considered dangerous.
+PathManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ grid
+ |
+
+ ndarray
+ |
+
+
+
+ The grid to evaluate safety on. + |
+ + required + | +
+ position
+ |
+
+ Point2
+ |
+
+
+
+ The position to check the safety of. + |
+ + required + | +
+ weight_safety_limit
+ |
+
+ float
+ |
+
+
+
+ The maximum value the point can +have on the grid to be considered safe. +Default value is 1.0. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ True if the position is considered safe, False otherwise. + |
+
src/ares/managers/manager_mediator.py
manager_request(receiver, request, reason=None, **kwargs)
+
+¶Function to request information from a manager.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ receiver
+ |
+
+ ManagerName
+ |
+
+
+
+ Manager receiving the request. + |
+ + required + | +
+ request
+ |
+
+ ManagerRequestType
+ |
+
+
+
+ Requested attribute/function call. + |
+ + required + | +
+ reason
+ |
+
+ str
+ |
+
+
+
+ Why the request is being made. + |
+
+ None
+ |
+
+ kwargs
+ |
+ + | +
+
+
+ Keyword arguments (if any) to be passed to the requested function. + |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Any |
+ Any
+ |
+
+
+
+ There are too many possible return types to list all of them. + |
+
src/ares/managers/manager_mediator.py
move_structure(**kwargs)
+
+¶Request a structure to move via flight.
+FlyingStructureManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ structure
+ |
+
+ Unit
+ |
+
+
+
+ The structure to be moved or landed. + |
+ + required + | +
+ target
+ |
+
+ Point2
+ |
+
+
+
+ The target location for the structure. + |
+ + required + | +
+ should_land
+ |
+
+ bool
+ |
+
+
+
+ Whether the structure should +land after moving. Defaults to False. + |
+ + required + | +
src/ares/managers/manager_mediator.py
remove_gas_building(**kwargs)
+
+¶Request for a gas building to be removed from bookkeeping.
+Resource Manager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ gas_building_tag
+ |
+
+ int
+ |
+
+
+
+ The tag of the gas building to remove. + |
+ + required + | +
src/ares/managers/manager_mediator.py
remove_mineral_field(**kwargs)
+
+¶Request for a mineral field to be removed from bookkeeping.
+Resource Manager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ mineral_field_tag
+ |
+
+ int
+ |
+
+
+
+ The tag of the mineral patch to remove. + |
+ + required + | +
src/ares/managers/manager_mediator.py
remove_tag_from_squads(**kwargs)
+
+¶SquadManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ tag
+ |
+
+ int
+ |
+
+
+
+ Get the squads for this unit role. + |
+ + required + | +
+ squad_radius
+ |
+
+ float
+ |
+
+
+
+ The threshold as to which separate squads are formed. + |
+ + required + | +
+ unit_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ If specified, only form squads with these unit types +WARNING: Will not remove units that have already + been assigned to a squad. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ Each squad with this unit role. + |
+
src/ares/managers/manager_mediator.py
remove_worker_from_mineral(**kwargs)
+
+¶Remove worker from internal data structures.
+This happens if worker gets assigned to do something else
+ResourceManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ worker_tag
+ |
+ + | +
+
+
+ Tag of the worker to be removed. + |
+ + required + | +
src/ares/managers/manager_mediator.py
request_building_placement(**kwargs)
+
+¶Request a building placement from the precalculated building formation.
+PlacementManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ base_location
+ |
+
+ Point2
+ |
+
+
+
+ The general area where the placement should be near. +This should be an expansion location. + |
+ + required + | +
+ structure_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ Structure type requested. + |
+ + required + | +
+ first_pylon
+ |
+
+ bool
+ |
+
+
+
+ Try to take designated +first pylon if available. +Default value is False. + |
+ + required + | +
+ static_defence
+ |
+
+ bool
+ |
+
+
+
+ Try to take designated +static defence placements if available. +Default value is False. + |
+ + required + | +
+ wall
+ |
+
+ bool
+ |
+
+
+
+ Request a wall structure placement. +Will find alternative if no wall placements available. +Default value is False. + |
+ + required + | +
+ find_alternative
+ |
+
+ bool
+ |
+
+
+
+ If no placements available +at base_location, find an alternative at a nearby base. +Default value is True. + |
+ + required + | +
+ reserve_placement
+ |
+
+ bool
+ |
+
+
+
+ Reserve this booking for a +while, so another customer doesn't request it. +Default value is True. + |
+ + required + | +
+ within_psionic_matrix
+ |
+
+ bool
+ |
+
+
+
+ Protoss specific -> calculated +position have power? +Default value is False. + |
+ + required + | +
+ pylon_build_progress
+ |
+
+ float
+ |
+
+
+
+ Only relevant
+if |
+ + required + | +
+ closest_to
+ |
+
+ Point2
+ |
+
+
+
+ Find placement at base closest to this. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Optional[Point2]
+ |
+
+
+
+ Indicating if structure can be placed at given position. + |
+
src/ares/managers/manager_mediator.py
request_warp_in(**kwargs)
+
+¶Request a warp in spot, without making a query to the game client.
+PlacementManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ unit_type
+ |
+
+ UnitTypeId
+ |
+
+
+
+ The unit we want to warp in. + |
+ + required + | +
+ target
+ |
+
+ Optional[Point2]
+ |
+
+
+
+ If provided, attempt to find +spot closest to this location. + |
+ + required + | +
src/ares/managers/manager_mediator.py
select_worker(**kwargs)
+
+¶Select a worker via the ResourceManager.
+This way we can select one assigned to a far mineral patch. +Make sure to change the worker role once selected, otherwise it will be selected +to mine again. This doesn't select workers from geysers, so make sure to remove +workers from gas if low on workers.
+ResourceManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ target_position
+ |
+
+ Point2
+ |
+
+
+
+ Location to get the closest workers to. + |
+ + required + | +
+ force_close
+ |
+
+ bool
+ |
+
+
+
+ Select the available worker closest to
+ |
+ + required + | +
+ select_persistent_builder
+ |
+
+ bool
+ |
+
+
+
+ If True, we can select +the persistent_builder if it's available. + |
+ + required + | +
+ only_select_persistent_builder
+ |
+
+ bool
+ |
+
+
+
+ If True, don't find an +alternative worker. + |
+ + required + | +
+ min_health_perc
+ |
+
+ float
+ |
+
+
+
+ Only select workers above this health percentage. + |
+ + required + | +
+ min_shield_perc
+ |
+
+ float
+ |
+
+
+
+ Only select workers above this shield percentage. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Optional[Unit]
+ |
+
+
+
+ Selected worker, if available. + |
+
src/ares/managers/manager_mediator.py
set_workers_per_gas(**kwargs)
+
+¶Give all units in a role a different role.
+ResourceManager
+amount (int): Num workers to assign to each gas building
+ +src/ares/managers/manager_mediator.py
switch_roles(**kwargs)
+
+¶Give all units in a role a different role.
+UnitRoleManager
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ from_role
+ |
+
+ UnitRole
+ |
+
+
+
+ Role the units currently have. + |
+ + required + | +
+ to_role
+ |
+
+ UnitRole
+ |
+
+
+
+ Role to assign to the units. + |
+ + required + | +
src/ares/managers/manager_mediator.py
update_unit_to_ability_dict(**kwargs)
+
+¶Update tracking to reflect ability usage.
+After a unit uses an ability it should call this to update the frame the +ability will next be available
+AbilityTrackerManager.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ ability
+ |
+
+ AbilityId
+ |
+
+
+
+ The AbilityId that was used. + |
+ + required + | +
+ unit_tag
+ |
+
+ int
+ |
+
+
+
+ The tag of the Unit that used the ability. + |
+ + required + | +
src/ares/managers/manager_mediator.py