Purchase reserves at front lines.

This changes the ground unit purchase behavior such that the supply
limit is exceeded by 30%, with the extra units kept in reserve.

The old hard cap of 50 units is no longer needed, since the ammo supply
now does the same task, so that's been removed.
This commit is contained in:
SnappyComebacks 2021-05-29 23:47:10 -06:00 committed by Dan Albert
parent d61382f4e2
commit d440dc00f1
2 changed files with 4 additions and 5 deletions

View File

@ -20,6 +20,8 @@ from game.data.groundunitclass import GroundUnitClass
if TYPE_CHECKING:
from game import Game
FRONTLINE_RESERVES_FACTOR = 1.3
@dataclass(frozen=True)
class AircraftProcurementRequest:
@ -282,11 +284,9 @@ class ProcurementAi:
# No source of ground units, so can't buy anything.
continue
purchase_target = cp.frontline_unit_count_limit * FRONTLINE_RESERVES_FACTOR
allocated = cp.allocated_ground_units(self.game.transfers)
if (
allocated.total >= self.game.settings.front_line_procurement_target
or allocated.total >= cp.frontline_unit_count_limit
):
if allocated.total >= purchase_target:
# Control point is already sufficiently defended.
continue
if allocated.total < worst_supply:

View File

@ -57,7 +57,6 @@ class Settings:
perf_moving_units: bool = True
perf_infantry: bool = True
perf_destroyed_units: bool = True
front_line_procurement_target: int = 50
reserves_procurement_target: int = 10
# Performance culling