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:
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. |
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:
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. |
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:
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. |
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 |
|
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. |
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 |
|
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. |
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:
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. |