From 270301958a52410db67dea4df21c6898a5aafad8 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 13 Aug 2023 19:53:38 +0200 Subject: [PATCH] Fix helicopters oscillating due to over-speeding --- changelog.md | 1 + game/ato/traveltime.py | 2 +- game/dcs/aircrafttype.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 2251ce8a..456d99c4 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,7 @@ * **[Payloads]** Added/Updated (missing) payloads * **[Aircraft Tasking]** Revised aircraft tasking, filtering out incompatible tasks for several aircraft * **[Data]** Corrected the class of the USS Samuel Chase from Logistics to LandingShip, in order to prevent it being spawned as part of AAA sites. +* **[Mission Generation]** Helicopters oscillating due to over-speeding # Retribution v1.2.1 (hotfix) diff --git a/game/ato/traveltime.py b/game/ato/traveltime.py index 79d73cdf..e48731c4 100644 --- a/game/ato/traveltime.py +++ b/game/ato/traveltime.py @@ -39,7 +39,7 @@ class GroundSpeed: # as it can at sea level. This probably isn't great assumption, but # might. be sufficient given the wiggle room. We can come up with # another heuristic if needed. - cruise_mach = max_speed.mach() * 0.85 + cruise_mach = max_speed.mach() * (0.65 if flight.is_helo else 0.85) return mach(cruise_mach, altitude) diff --git a/game/dcs/aircrafttype.py b/game/dcs/aircrafttype.py index 83110d07..d441f0d9 100644 --- a/game/dcs/aircrafttype.py +++ b/game/dcs/aircrafttype.py @@ -292,9 +292,9 @@ class AircraftType(UnitType[Type[FlyingType]]): ) else: # Slow like warbirds or helicopters - # Use whichever is slowest - mach 0.35 or 70% of max speed - logging.debug(f"{self.name} max_speed * 0.7 is {max_speed * 0.7}") - return min(Speed.from_mach(0.35, altitude), max_speed * 0.7) + # Use whichever is slowest - mach 0.35 or 50% of max speed + logging.debug(f"{self.name} max_speed * 0.5 is {max_speed * 0.5}") + return min(Speed.from_mach(0.35, altitude), max_speed * 0.5) def alloc_flight_radio(self, radio_registry: RadioRegistry) -> RadioFrequency: from game.radio.radios import ChannelInUseError, kHz