Group Combat Behaviors
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¶
group : list[Unit] Units we want to control. group_tags : set[int] The group unit tags. target: Point2 Where the unit is going.
Source code in 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¶
group : list[Unit] Units we want to control. close_enemy : Union[Units, list[Unit]] Nearby enemy. grid : np.ndarray Grid we should check for safety. attack_in_range_enemy : bool (default=True) Attack in range if weapon is ready.
Source code in 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¶
start : Point2 Where to start the path query. group: list[Unit] The actual group units. group_tags : set[int] The units to path. grid : np.ndarray 2D Grid to path on. target : Point2 Target destination. success_at_distance : float (default: 0.0) If unit has got this close, consider path behavior complete. sensitivity : int (default: 5) Path precision. smoothing : bool (default: False) Smooth out the path. sense_danger : bool (default: False) Check for dangers, if none are present pathing query is skipped. danger_distance : float (default: 20.0) If sense_danger=True, how far to check for dangers? danger_threshold : float (default: 5.0) Influence at which a danger is respected. prevent_duplicate : bool (default: True) Try to prevent spamming action.
Source code in 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 114 115 116 117 118 119 120 121 |
|
StutterGroupBack
dataclass
¶
Bases: CombatGroupBehavior
Stutter a group back in unison.
Attributes¶
group : Unit The group of units we want to control. group_tags: Point2 The group unit tags. group_position : Point2 The position where this group is situated. target : Union[Point2, Unit] Target for the group. grid : np.ndarray Grid this group will use to path on.
Source code in 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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
calculate_retreat_position(ai)
¶
Search 8 directions for somewhere to retreat to.
Parameters¶
ai
Returns¶
Source code in src/ares/behaviors/combat/group/stutter_group_back.py
StutterGroupForward
dataclass
¶
Bases: CombatGroupBehavior
Stutter a group forward in unison.
Attributes¶
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 present. enemies : Union[Units, list[Unit]] The enemy units we want to stutter towards
Source code in 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¶
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