From 9edb4ecc45a752dd4ad4777ea2255757e3e3cad7 Mon Sep 17 00:00:00 2001 From: MetalStormGhost Date: Tue, 3 Oct 2023 13:56:43 +0300 Subject: [PATCH] Implemented a list of units which will be removed from Pretense ground assault groups due to pathfinding problems. The units will just remain still instead of advancing. Also added one tank to each group and increased the maximum size of the groups to 5. Removed artillery units from the groups, similarly due to pathfinding problems. --- game/pretense/pretensetgogenerator.py | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/game/pretense/pretensetgogenerator.py b/game/pretense/pretensetgogenerator.py index 74f99a6e..aa1ee203 100644 --- a/game/pretense/pretensetgogenerator.py +++ b/game/pretense/pretensetgogenerator.py @@ -91,7 +91,11 @@ if TYPE_CHECKING: FARP_FRONTLINE_DISTANCE = 10000 AA_CP_MIN_DISTANCE = 40000 -PRETENSE_GROUND_UNIT_GROUP_SIZE = 4 +PRETENSE_GROUND_UNIT_GROUP_SIZE = 5 +PRETENSE_GROUND_UNITS_TO_REMOVE_FROM_ASSAULT = [ + vehicles.Armor.Stug_III, + vehicles.Artillery.Grad_URAL, +] class PretenseGroundObjectGenerator(GroundObjectGenerator): @@ -131,6 +135,12 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator): ) of_class = list({u for u in faction_units if u.unit_class is unit_class}) + # Remove units from list with known pathfinding issues in Pretense missions + for unit_to_remove in PRETENSE_GROUND_UNITS_TO_REMOVE_FROM_ASSAULT: + for groundunittype_to_remove in GroundUnitType.for_dcs_type(unit_to_remove): + if groundunittype_to_remove in of_class: + of_class.remove(groundunittype_to_remove) + if len(of_class) > 0: return random.choice(of_class) else: @@ -200,6 +210,14 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator): group_name = f"{cp_name_trimmed}-{group_role}-{group.id}" group.name = group_name + self.generate_ground_unit_of_class( + UnitClass.TANK, + group, + vehicle_units, + cp_name_trimmed, + group_role, + PRETENSE_GROUND_UNIT_GROUP_SIZE - 4, + ) self.generate_ground_unit_of_class( UnitClass.TANK, group, @@ -232,14 +250,6 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator): group_role, PRETENSE_GROUND_UNIT_GROUP_SIZE, ) - self.generate_ground_unit_of_class( - UnitClass.ARTILLERY, - group, - vehicle_units, - cp_name_trimmed, - group_role, - PRETENSE_GROUND_UNIT_GROUP_SIZE, - ) self.generate_ground_unit_of_class( UnitClass.RECON, group,