mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fine-tune attempt wrt DEAD autoplanning
A small note, this also affects the aggressiveness wrt SHORAD & AAA
This commit is contained in:
parent
be554c54b3
commit
a7d091c142
@ -14,6 +14,7 @@ from game.commander.missionproposals import EscortType, ProposedFlight, Proposed
|
|||||||
from game.commander.packagefulfiller import PackageFulfiller
|
from game.commander.packagefulfiller import PackageFulfiller
|
||||||
from game.commander.tasks.theatercommandertask import TheaterCommanderTask
|
from game.commander.tasks.theatercommandertask import TheaterCommanderTask
|
||||||
from game.commander.theaterstate import TheaterState
|
from game.commander.theaterstate import TheaterState
|
||||||
|
from game.data.groups import GroupTask
|
||||||
from game.settings import AutoAtoBehavior
|
from game.settings import AutoAtoBehavior
|
||||||
from game.theater import MissionTarget
|
from game.theater import MissionTarget
|
||||||
from game.theater.theatergroundobject import IadsGroundObject, NavalGroundObject
|
from game.theater.theatergroundobject import IadsGroundObject, NavalGroundObject
|
||||||
@ -136,6 +137,8 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
|||||||
else settings.opfor_autoplanner_aggressiveness
|
else settings.opfor_autoplanner_aggressiveness
|
||||||
)
|
)
|
||||||
target_range = target.max_threat_range() * (margin / 100)
|
target_range = target.max_threat_range() * (margin / 100)
|
||||||
|
corrective_factor = self.corrective_factor_for_type(target)
|
||||||
|
target_range *= corrective_factor
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown RangeType: {range_type}")
|
raise ValueError(f"Unknown RangeType: {range_type}")
|
||||||
if not target_range:
|
if not target_range:
|
||||||
@ -156,6 +159,18 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
|||||||
for target, _range in target_ranges:
|
for target, _range in target_ranges:
|
||||||
yield target
|
yield target
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def corrective_factor_for_type(
|
||||||
|
target: IadsGroundObject | NavalGroundObject,
|
||||||
|
) -> float:
|
||||||
|
return (
|
||||||
|
1.0
|
||||||
|
if target.task in [GroupTask.LORAD, GroupTask.MERAD]
|
||||||
|
else 0.5
|
||||||
|
if target.task == GroupTask.AAA
|
||||||
|
else 0.9
|
||||||
|
)
|
||||||
|
|
||||||
def iter_detecting_iads(
|
def iter_detecting_iads(
|
||||||
self, state: TheaterState
|
self, state: TheaterState
|
||||||
) -> Iterator[Union[IadsGroundObject, NavalGroundObject]]:
|
) -> Iterator[Union[IadsGroundObject, NavalGroundObject]]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user