diff --git a/changelog.md b/changelog.md index c6446692..bdc9b8f6 100644 --- a/changelog.md +++ b/changelog.md @@ -28,6 +28,7 @@ Saves from 5.x are not compatible with 6.0. * **[Campaign]** Allow campaign designers to define default values for the economy settings (starting budget and multiplier). * **[Plugins]** Allow full support of the SkynetIADS plugin with all advanced features (connection nodes, power sources, command centers) if campaign supports it. * **[Plugins]** Added support for the CTLD script by ciribob with many possible customization options and updated the JTAC Autolase to the CTLD included script. +* **[Performance]** Added performance option: Maximum front-line unit supply per control point. ## Fixes diff --git a/game/settings/settings.py b/game/settings/settings.py index 3378920a..cc6fab5f 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -443,6 +443,27 @@ class Settings: section=PERFORMANCE_SECTION, default=True, ) + # perf_disable_convoys: bool = boolean_option( + # "Disable convoys", + # page=MISSION_GENERATOR_PAGE, + # section=PERFORMANCE_SECTION, + # default=False, + # ) + # perf_frontline_units_prefer_roads: bool = boolean_option( + # "Front line troops prefer roads", + # page=MISSION_GENERATOR_PAGE, + # section=PERFORMANCE_SECTION, + # default=False, + # ) + perf_frontline_units_max_supply: int = bounded_int_option( + "Maximum frontline unit supply per control point", + page=MISSION_GENERATOR_PAGE, + section=PERFORMANCE_SECTION, + default=60, + min=10, + max=300, + causes_expensive_game_update=True, + ) perf_infantry: bool = boolean_option( "Generate infantry squads alongside vehicles", page=MISSION_GENERATOR_PAGE, diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index 034bd165..78a9e968 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -976,11 +976,13 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC): self.front_line_capacity_with(ammo_depot_count), self.base.total_armor ) - @classmethod - def front_line_capacity_with(cls, ammo_depot_count: int) -> int: - return ( - FREE_FRONTLINE_UNIT_SUPPLY - + ammo_depot_count * AMMO_DEPOT_FRONTLINE_UNIT_CONTRIBUTION + def front_line_capacity_with(self, ammo_depot_count: int) -> int: + return min( + self.coalition.game.settings.perf_frontline_units_max_supply, + ( + FREE_FRONTLINE_UNIT_SUPPLY + + ammo_depot_count * AMMO_DEPOT_FRONTLINE_UNIT_CONTRIBUTION + ), ) @property