mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Mission planning on a per-control point basis lacked the context it needed to make good decisions, and the ability to make larger missions that pulled aircraft from multiple airfields. The per-CP planners have been replaced in favor of a global planner per coalition. The planner generates a list of potential missions in order of priority and then allocates aircraft to the proposed flights until no missions remain. Mission planning behavior has changed: * CAP flights will now only be generated for airfields within a predefined threat range of an enemy airfield. * CAS, SEAD, and strike missions get escorts. Strike missions get a SEAD flight. * CAS, SEAD, and strike missions will not be planned unless they have an escort available. * Missions may originate from multiple airfields. There's more to do: * The range limitations imposed on the mission planner should take aircraft range limitations into account. * Air superiority aircraft like the F-15 should be preferred for CAP over multi-role aircraft like the F/A-18 since otherwise we run the risk of running out of ground attack capable aircraft even though there are still unused aircraft. * Mission priorities may need tuning. * Target areas could be analyzed for potential threats, allowing escort flights to be optional or omitted if there is no threat to defend against. For example, late game a SEAD flight for a strike mission probably is not necessary. * SAM threat should be judged by how close the extent of the SAM's range is to friendly locations, not the distance to the site itself. An SA-10 30 nm away is more threatening than an SA-6 25 nm away. * Much of the planning behavior should be factored out into the coalition's doctrine. But as-is this is an improvement over the existing behavior, so those things can be follow ups. The potential regression in behavior here is that we're no longer planning multiple cycles of missions. Each objective will get one CAP. I think this fits better with the turn cycle of the game, as a CAP flight should be able to remain on station for the duration of the turn (especially with refueling). Note that this does break save compatibility as the old planner was a part of the game object, and since that class is now gone it can't be unpickled.
45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
from PySide2.QtCore import Qt
|
|
from PySide2.QtWidgets import QDialog, QPushButton
|
|
|
|
from game import Game
|
|
from gen.flights.flight import Flight
|
|
from gen.flights.flightplan import FlightPlanBuilder
|
|
from qt_ui.uiconstants import EVENT_ICONS
|
|
from qt_ui.windows.mission.flight.waypoints.QFlightWaypointInfoBox import QFlightWaypointInfoBox
|
|
|
|
|
|
class QAbstractMissionGenerator(QDialog):
|
|
|
|
def __init__(self, game: Game, flight: Flight, flight_waypoint_list, title):
|
|
super(QAbstractMissionGenerator, self).__init__()
|
|
self.game = game
|
|
self.flight = flight
|
|
self.setWindowFlags(Qt.WindowStaysOnTopHint)
|
|
self.setMinimumSize(400, 250)
|
|
self.setModal(True)
|
|
self.setWindowTitle(title)
|
|
self.setWindowIcon(EVENT_ICONS["strike"])
|
|
self.flight_waypoint_list = flight_waypoint_list
|
|
self.planner = FlightPlanBuilder(self.game, is_player=True)
|
|
|
|
self.selected_waypoints = []
|
|
self.wpt_info = QFlightWaypointInfoBox()
|
|
|
|
self.ok_button = QPushButton("Ok")
|
|
self.ok_button.clicked.connect(self.apply)
|
|
|
|
def on_select_wpt_changed(self):
|
|
self.selected_waypoints = self.wpt_selection_box.get_selected_waypoints(False)
|
|
if self.selected_waypoints is None or len(self.selected_waypoints) <= 0:
|
|
self.ok_button.setDisabled(True)
|
|
else:
|
|
self.wpt_info.set_flight_waypoint(self.selected_waypoints[0])
|
|
self.ok_button.setDisabled(False)
|
|
|
|
def apply(self):
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
|