mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add new option in settings: OPFOR autoplanner aggressiveness (#61)
"Threatened" threshold based on a suggestion from FinCenturion. (#61)
This commit is contained in:
parent
ee1fc53dd3
commit
d2a7de2775
@ -3,6 +3,7 @@
|
|||||||
## Features/Improvements
|
## Features/Improvements
|
||||||
* **[Mission Generation]** Given a CAS flight was planned, delay ground force attack until first CAS flight is on station
|
* **[Mission Generation]** Given a CAS flight was planned, delay ground force attack until first CAS flight is on station
|
||||||
* **[Mission Generation]** Add option to switch ATFLIR to LITENING automatically for ground based F-18C flights
|
* **[Mission Generation]** Add option to switch ATFLIR to LITENING automatically for ground based F-18C flights
|
||||||
|
* **[Mission Generation]** Add option to configure OPFOR autoplanner aggressiveness and have the AI take risks and plan missions against defended targets
|
||||||
* **[Cheat Menu]** Option to instantly transfer squadrons across bases.
|
* **[Cheat Menu]** Option to instantly transfer squadrons across bases.
|
||||||
* **[UI]** Add selectable units in faction overview during campaign generation.
|
* **[UI]** Add selectable units in faction overview during campaign generation.
|
||||||
* **[UI]** Add button to rename pilots in Air Wing's Squadron dialog.
|
* **[UI]** Add button to rename pilots in Air Wing's Squadron dialog.
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import operator
|
|||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum, auto, unique
|
from enum import IntEnum, auto, unique
|
||||||
|
import random
|
||||||
from typing import Generic, Iterator, Optional, TYPE_CHECKING, TypeVar, Union
|
from typing import Generic, Iterator, Optional, TYPE_CHECKING, TypeVar, Union
|
||||||
|
|
||||||
from game.ato.flighttype import FlightType
|
from game.ato.flighttype import FlightType
|
||||||
@ -170,7 +171,15 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
|||||||
|
|
||||||
if not ignore_iads:
|
if not ignore_iads:
|
||||||
for iads_threat in self.iter_iads_threats(state):
|
for iads_threat in self.iter_iads_threats(state):
|
||||||
threatened = True
|
# Only consider blue faction flights threatened.
|
||||||
|
# Red might still plan missions into hostile territory,
|
||||||
|
# depending on the aggressiveness setting.
|
||||||
|
if (
|
||||||
|
state.context.coalition.player
|
||||||
|
or random.randint(1, 100)
|
||||||
|
> state.context.coalition.game.settings.opfor_autoplanner_aggressiveness
|
||||||
|
):
|
||||||
|
threatened = True
|
||||||
if iads_threat not in state.threatening_air_defenses:
|
if iads_threat not in state.threatening_air_defenses:
|
||||||
state.threatening_air_defenses.append(iads_threat)
|
state.threatening_air_defenses.append(iads_threat)
|
||||||
return not threatened
|
return not threatened
|
||||||
|
|||||||
@ -395,6 +395,19 @@ class Settings:
|
|||||||
min=1,
|
min=1,
|
||||||
max=100,
|
max=100,
|
||||||
)
|
)
|
||||||
|
opfor_autoplanner_aggressiveness: int = bounded_int_option(
|
||||||
|
"OPFOR autoplanner aggressiveness (%)",
|
||||||
|
page=MISSION_GENERATOR_PAGE,
|
||||||
|
section=GAMEPLAY_SECTION,
|
||||||
|
default=20,
|
||||||
|
min=0,
|
||||||
|
max=100,
|
||||||
|
detail=(
|
||||||
|
"Chance (larger number -> higher chance) that the OPFOR AI "
|
||||||
|
"autoplanner will take risks and plan flights against targets "
|
||||||
|
"within threatened airspace."
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
# Performance
|
# Performance
|
||||||
perf_smoke_gen: bool = boolean_option(
|
perf_smoke_gen: bool = boolean_option(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user