Make default AEW&C missions ASAP.

This commit is contained in:
Dan Albert 2021-05-24 17:21:33 -07:00
parent 305d1f0523
commit c255aee3b9
2 changed files with 11 additions and 3 deletions

View File

@ -10,6 +10,7 @@ Saves from 2.5 are not compatible with 3.0.
* **[Campaign]** Non-control point FOBs will no longer spawn.
* **[Campaign AI]** AI now considers Ju-88s for CAS, strike, and DEAD missions.
* **[Campaign AI]** Fix purchase of aircraft by priority (the faction's list was being used as the priority list rather than the game's).
* **[Campaign AI]** AI planned AEW&C missions will now be scheduled ASAP.
* **[Flight Planner]** Desired mission length is now configurable (defaults to 60 minutes). A BARCAP will be planned every 30 minutes. Other packages will simply have their takeoffs spread out or compressed such that the last flight will take off around the mission end time.
* **[Flight Planner]** AI strike flight plans now include the correct target actions for building groups.
* **[Flight Planner]** Flight plans now include bullseye waypoints.

View File

@ -109,6 +109,8 @@ class ProposedMission:
#: The proposed flights that are required for the mission.
flights: List[ProposedFlight]
asap: bool = field(default=False)
def __str__(self) -> str:
flights = ", ".join([str(f) for f in self.flights])
return f"{self.location.name}: {flights}"
@ -183,11 +185,12 @@ class PackageBuilder:
is_player: bool,
package_country: str,
start_type: str,
asap: bool,
) -> None:
self.closest_airfields = closest_airfields
self.is_player = is_player
self.package_country = package_country
self.package = Package(location)
self.package = Package(location, auto_asap=asap)
self.allocator = AircraftAllocator(
closest_airfields, global_inventory, is_player
)
@ -571,7 +574,10 @@ class CoalitionMissionPlanner:
cp = self.objective_finder.farthest_friendly_control_point()
if cp is not None:
yield ProposedMission(
cp, [ProposedFlight(FlightType.AEWC, 1, self.MAX_AWEC_RANGE)]
cp,
[ProposedFlight(FlightType.AEWC, 1, self.MAX_AWEC_RANGE)],
# Supports all the early CAP flights, so should be in the air ASAP.
asap=True,
)
# Find friendly CPs within 100 nmi from an enemy airfield, plan CAP.
@ -857,6 +863,7 @@ class CoalitionMissionPlanner:
self.is_player,
package_country,
self.game.settings.default_start_type,
mission.asap,
)
# Attempt to plan all the main elements of the mission first. Escorts
@ -975,7 +982,7 @@ class CoalitionMissionPlanner:
logging.error(f"Could not determine mission end time for {package}")
continue
previous_cap_end_time[package.target] = departure_time
else:
elif not package.auto_asap:
# But other packages should be spread out a bit. Note that take
# times are delayed, but all aircraft will become active at
# mission start. This makes it more worthwhile to attack enemy