Improve Ingress Waypoint Attack tasking

* Improve Ingress WP attack tasking and update pydcs

- Updated the Attack Tasking of SEAD, DEAD, Strike and BAI to match the pydcs changes
- Changed DEAD, BAI and SEAD AttackGroup task to expend=auto. This solves an issue where the AI uses all Ammo on one single target as we defined the expend param to All instead of Auto which is used by default.

* Set Expend=All for SEAD Ingress

This ensures that the AI will only do one Attack Pass and also really suppress the Target what they are expected to do.
This commit is contained in:
RndName 2022-04-19 10:21:15 +02:00 committed by GitHub
parent 4115ca6040
commit 679dfc3441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 28 deletions

View File

@ -19,6 +19,7 @@ Saves from 5.x are not compatible with 6.0.
* **[Mission Generation]** Fixed SA-13 incorrectly created as SA-8 Loading Unit which will not be spawned in the generated mission. * **[Mission Generation]** Fixed SA-13 incorrectly created as SA-8 Loading Unit which will not be spawned in the generated mission.
* **[Mission Generation]** Fixed an issue which generated the helipads at FARPs incorrectly and placed the helicopters within each other. * **[Mission Generation]** Fixed an issue which generated the helipads at FARPs incorrectly and placed the helicopters within each other.
* **[Mission Generation]** Fixed an issue with SEAD missions flown by the AI when using the Skynet Plugin and anti-radiation missiles (ARM). The AI now correctly engages the SAM when it comes alive instead of diving into it. * **[Mission Generation]** Fixed an issue with SEAD missions flown by the AI when using the Skynet Plugin and anti-radiation missiles (ARM). The AI now correctly engages the SAM when it comes alive instead of diving into it.
* **[Mission Generation]** Fixed an issue where SEAD/DEAD/BAI flights fired all missiles / bombs against a single unit in a group instead of targeting the whole group
# 5.2.0 # 5.2.0

View File

@ -36,10 +36,6 @@ class BaiIngressBuilder(PydcsWaypointBuilder):
continue continue
task = AttackGroup(miz_group.id, weapon_type=WeaponType.Auto) task = AttackGroup(miz_group.id, weapon_type=WeaponType.Auto)
task.params["attackQtyLimit"] = False
task.params["directionEnabled"] = False
task.params["altitudeEnabled"] = False
task.params["groupAttack"] = True
waypoint.tasks.append(task) waypoint.tasks.append(task)
waypoint.tasks.append(OptFormation.trail_open()) waypoint.tasks.append(OptFormation.trail_open())

View File

@ -27,12 +27,9 @@ class DeadIngressBuilder(PydcsWaypointBuilder):
) )
continue continue
task = AttackGroup(miz_group.id, weapon_type=WeaponType.Auto) task = AttackGroup(
task.params["expend"] = "All" miz_group.id, weapon_type=WeaponType.Auto, group_attack=True
task.params["attackQtyLimit"] = False )
task.params["directionEnabled"] = False
task.params["altitudeEnabled"] = False
task.params["groupAttack"] = True
waypoint.tasks.append(task) waypoint.tasks.append(task)
# Preemptively use ECM to better avoid getting swatted. # Preemptively use ECM to better avoid getting swatted.

View File

@ -1,7 +1,13 @@
import logging import logging
from dcs.point import MovingPoint from dcs.point import MovingPoint
from dcs.task import AttackGroup, EngageGroup, OptECMUsing, WeaponType as DcsWeaponType from dcs.task import (
AttackGroup,
EngageGroup,
Expend,
OptECMUsing,
WeaponType as DcsWeaponType,
)
from game.data.weapons import WeaponType from game.data.weapons import WeaponType
from game.theater import TheaterGroundObject from game.theater import TheaterGroundObject
@ -36,17 +42,17 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
# into the SAM instead of waiting for it to come alive # into the SAM instead of waiting for it to come alive
engage_task = EngageGroup(miz_group.id) engage_task = EngageGroup(miz_group.id)
engage_task.params["weaponType"] = DcsWeaponType.Guided.value engage_task.params["weaponType"] = DcsWeaponType.Guided.value
# Ensure that they fire all ammunition in one attack pass
engage_task.params["expend"] = Expend.All.value
waypoint.tasks.append(engage_task) waypoint.tasks.append(engage_task)
else: else:
# All non ARM types like Decoys will use the normal AttackGroup Task # All non ARM types like Decoys will use the normal AttackGroup Task
attack_task = AttackGroup( attack_task = AttackGroup(
miz_group.id, weapon_type=DcsWeaponType.Guided miz_group.id,
weapon_type=DcsWeaponType.Guided,
group_attack=True,
expend=Expend.All,
) )
attack_task.params["expend"] = "All"
attack_task.params["attackQtyLimit"] = False
attack_task.params["directionEnabled"] = False
attack_task.params["altitudeEnabled"] = False
attack_task.params["groupAttack"] = True
waypoint.tasks.append(attack_task) waypoint.tasks.append(attack_task)
# Preemptively use ECM to better avoid getting swatted. # Preemptively use ECM to better avoid getting swatted.

View File

@ -2,7 +2,7 @@ import copy
from dcs.planes import B_17G, B_52H, Tu_22M3 from dcs.planes import B_17G, B_52H, Tu_22M3
from dcs.point import MovingPoint from dcs.point import MovingPoint
from dcs.task import Bombing, OptFormation, WeaponType from dcs.task import Bombing, OptFormation, WeaponType, Expend
from .pydcswaypointbuilder import PydcsWaypointBuilder from .pydcswaypointbuilder import PydcsWaypointBuilder
@ -25,21 +25,19 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
for target in targets[1:]: for target in targets[1:]:
center += target.position center += target.position
center /= len(targets) center /= len(targets)
bombing = Bombing(center, weapon_type=WeaponType.Bombs) bombing = Bombing(
bombing.params["expend"] = "All" center, weapon_type=WeaponType.Bombs, expend=Expend.All, group_attack=True
bombing.params["attackQtyLimit"] = False )
bombing.params["directionEnabled"] = False
bombing.params["altitudeEnabled"] = False
bombing.params["groupAttack"] = True
waypoint.tasks.append(bombing) waypoint.tasks.append(bombing)
def add_strike_tasks(self, waypoint: MovingPoint) -> None: def add_strike_tasks(self, waypoint: MovingPoint) -> None:
for target in self.waypoint.targets: for target in self.waypoint.targets:
bombing = Bombing(target.position, weapon_type=WeaponType.Auto) bombing = Bombing(
target.position, weapon_type=WeaponType.Auto, group_attack=True
)
# If there is only one target, drop all ordnance in one pass. # If there is only one target, drop all ordnance in one pass.
if len(self.waypoint.targets) == 1: if len(self.waypoint.targets) == 1:
bombing.params["expend"] = "All" bombing.params["expend"] = Expend.All.value
bombing.params["groupAttack"] = True
waypoint.tasks.append(bombing) waypoint.tasks.append(bombing)
# Register special waypoints # Register special waypoints

View File

@ -32,7 +32,7 @@ pluggy==1.0.0
pre-commit==2.17.0 pre-commit==2.17.0
py==1.11.0 py==1.11.0
pydantic==1.9.0 pydantic==1.9.0
-e git+https://github.com/pydcs/dcs@fac1bd084f22150acfde3bff220f8e69487048d1#egg=pydcs -e git+https://github.com/pydcs/dcs@04248fa93573029ee76db6c30f62140dfa4a58c8#egg=pydcs
pyinstaller==4.9 pyinstaller==4.9
pyinstaller-hooks-contrib==2022.1 pyinstaller-hooks-contrib==2022.1
pyparsing==3.0.7 pyparsing==3.0.7