From 9914848356308428df809d2352b0ee65822a903b Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 8 Dec 2018 19:21:15 +0100 Subject: [PATCH] BaseBuilder- and BuildingRepairBotModule update rule --- .../Rules/20180923/ExtractHackyAIModules.cs | 121 ++++++ mods/cnc/rules/ai.yaml | 236 ++++++------ mods/d2k/rules/ai.yaml | 261 +++++++------ mods/ra/rules/ai.yaml | 345 ++++++++++-------- mods/ts/rules/ai.yaml | 93 ++--- 5 files changed, 642 insertions(+), 414 deletions(-) diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20180923/ExtractHackyAIModules.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20180923/ExtractHackyAIModules.cs index 0969fbb2a4..bc9433c069 100644 --- a/OpenRA.Mods.Common/UpdateRules/Rules/20180923/ExtractHackyAIModules.cs +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20180923/ExtractHackyAIModules.cs @@ -39,6 +39,41 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules "SupportPowerDecisions" }; + readonly string[] baseBuilderFields = + { + "BuildingQueues", + "DefenseQueues", + "MinimumExcessPower", + "MaximumExcessPower", + "ExcessPowerIncrement", + "ExcessPowerIncreaseThreshold", + "StructureProductionInactiveDelay", + "StructureProductionActiveDelay", + "StructureProductionRandomBonusDelay", + "StructureProductionResumeDelay", + "MaximumFailedPlacementAttempts", + "MaxResourceCellsToCheck", + "CheckForNewBasesDelay", + "MinBaseRadius", + "MaxBaseRadius", + "MinimumDefenseRadius", + "MaximumDefenseRadius", + "RallyPointScanRadius", + "CheckForWaterRadius", + "WaterTerrainTypes", + "NewProductionCashThreshold", + "BuildingCommonNames", + "BuildingLimits", + "BuildingFractions", + }; + + // Fields that should (for now) only be copied instead of moved, for backwards-compatibility reasons + readonly string[] copyBaseBuilderFields = + { + "MinBaseRadius", + "MaxBaseRadius", + }; + public override IEnumerable AfterUpdate(ModData modData) { if (!messageShown) @@ -71,6 +106,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules // and only add more for AIs that define custom values for one of its fields. var defaultHarvNode = new MiniYamlNode("HarvesterBotModule", ""); + // We add a 'default' BuildingRepairBotModule in any case, + // and just don't enable it for AIs that had 'ShouldRepairBuildings: false'. + var defaultRepairNode = new MiniYamlNode("BuildingRepairBotModule", ""); + foreach (var hackyAINode in hackyAIs) { // HackyAIInfo.Name might contain spaces, so Type is better suited to be used as condition name. @@ -156,6 +195,56 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules addNodes.Add(spNode); } + + if (baseBuilderFields.Any(f => hackyAINode.ChildrenMatching(f).Any())) + { + var bmNode = new MiniYamlNode("BaseBuilderBotModule@" + aiType, ""); + bmNode.AddNode(new MiniYamlNode("RequiresCondition", conditionString)); + + foreach (var bmf in baseBuilderFields) + { + var fieldNode = hackyAINode.LastChildMatching(bmf); + if (fieldNode != null) + { + if (fieldNode.KeyMatches("BuildingFractions", includeRemovals: false)) + { + var buildingNodes = fieldNode.Value.Nodes; + foreach (var n in buildingNodes) + ConvertFractionToInteger(n); + } + + if (copyBaseBuilderFields.Any(f => f == bmf)) + bmNode.AddNode(fieldNode); + else if (fieldNode.KeyMatches("BuildingCommonNames", includeRemovals: false)) + foreach (var n in fieldNode.Value.Nodes) + bmNode.AddNode(n.Key + "Types", n.Value.Value); + else + fieldNode.MoveNode(hackyAINode, bmNode); + } + } + + addNodes.Add(bmNode); + } + + // We want the default repair module to be enabled for every AI that didn't disable 'ShouldRepairBuildings', + // so we need to update RequiresCondition to be enabled on any of the conditions granted by these AIs, + // but only if the condition hasn't been added yet. + var shouldRepairNode = hackyAINode.LastChildMatching("ShouldRepairBuildings"); + var enableBuildingRepair = shouldRepairNode == null || shouldRepairNode.NodeValue(); + if (enableBuildingRepair) + { + var requiresConditionNode = defaultRepairNode.LastChildMatching("RequiresCondition"); + if (requiresConditionNode == null) + defaultRepairNode.AddNode(new MiniYamlNode("RequiresCondition", conditionString)); + else + { + var oldValue = requiresConditionNode.NodeValue(); + if (oldValue.Contains(conditionString)) + continue; + + requiresConditionNode.ReplaceValue(oldValue + " || " + conditionString); + } + } } // Only add module if any bot is using/enabling it. @@ -163,10 +252,42 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules if (harvRequiresConditionNode != null) addNodes.Add(defaultHarvNode); + // Only add module if any bot is using/enabling it. + var repRequiresConditionNode = defaultRepairNode.LastChildMatching("RequiresCondition"); + if (repRequiresConditionNode != null) + addNodes.Add(defaultRepairNode); + foreach (var node in addNodes) actorNode.AddNode(node); yield break; } + + void ConvertFractionToInteger(MiniYamlNode node) + { + // Is the value a percentage or a 'real' float? + var isPercentage = node.NodeValue().Contains("%"); + if (isPercentage) + { + // Remove '%' first, then remove potential '.' and finally clamp to minimum of 1, unless the old value was really zero + var oldValueAsString = node.NodeValue().Split('%')[0]; + var oldValueWasZero = oldValueAsString == "0"; + var newValue = oldValueAsString.Split('.')[0]; + newValue = !oldValueWasZero && newValue == "0" ? "1" : newValue; + + node.ReplaceValue(newValue); + } + else + { + var oldValueAsFloat = node.NodeValue(); + var oldValueWasZero = node.NodeValue() == "0" || node.NodeValue() == "0.0"; + var newValue = (int)(oldValueAsFloat * 100); + + // Clamp to minimum of 1, unless the old value was really zero + newValue = !oldValueWasZero && newValue == 0 ? 1 : newValue; + + node.ReplaceValue(newValue.ToString()); + } + } } } diff --git a/mods/cnc/rules/ai.yaml b/mods/cnc/rules/ai.yaml index 8826ec1b42..e84d479a25 100644 --- a/mods/cnc/rules/ai.yaml +++ b/mods/cnc/rules/ai.yaml @@ -2,10 +2,6 @@ Player: HackyAI@Cabal: Name: Cabal Type: cabal - MinimumExcessPower: 30 - ExcessPowerIncrement: 30 - ExcessPowerIncreaseThreshold: 5 - MaximumExcessPower: 150 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -17,38 +13,7 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harv - BuildingQueues: Building.Nod, Building.GDI - DefenseQueues: Defence.Nod, Defence.GDI UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI - BuildingLimits: - proc: 4 - pyle: 3 - hand: 3 - hq: 1 - weap: 3 - afld: 3 - hpad: 0 - eye: 1 - tmpl: 1 - fix: 1 - silo: 1 - BuildingFractions: - proc: 20% - pyle: 5% - hand: 5% - hq: 4% - weap: 9% - afld: 9% - gtwr: 5% - gun: 5% - atwr: 9% - obli: 7% - sam: 7% - eye: 1% - tmpl: 1% - silo: 0% - fix: 1% - hpad: 2% UnitsToBuild: e1: 65% e2: 25% @@ -74,10 +39,6 @@ Player: HackyAI@Watson: Name: Watson Type: watson - MinimumExcessPower: 30 - ExcessPowerIncrement: 30 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 150 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -89,38 +50,7 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harv - BuildingQueues: Building.Nod, Building.GDI - DefenseQueues: Defence.Nod, Defence.GDI UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI - BuildingLimits: - proc: 4 - pyle: 3 - hand: 3 - hq: 1 - weap: 3 - afld: 3 - hpad: 2 - eye: 1 - tmpl: 1 - fix: 1 - silo: 1 - BuildingFractions: - proc: 17% - pyle: 2% - hand: 2% - hq: 1% - weap: 5% - afld: 5% - hpad: 4% - gtwr: 5% - gun: 5% - atwr: 9% - obli: 7% - eye: 1% - tmpl: 1% - sam: 7% - silo: 0% - fix: 1% UnitsToBuild: e1: 65% e2: 30% @@ -146,10 +76,6 @@ Player: HackyAI@HAL9001: Name: HAL 9001 Type: hal9001 - MinimumExcessPower: 30 - ExcessPowerIncrement: 30 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 210 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -161,38 +87,7 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harv - BuildingQueues: Building.Nod, Building.GDI - DefenseQueues: Defence.Nod, Defence.GDI UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI - BuildingLimits: - proc: 4 - pyle: 4 - hand: 4 - hq: 1 - weap: 4 - afld: 4 - hpad: 2 - eye: 1 - tmpl: 1 - fix: 1 - silo: 1 - BuildingFractions: - proc: 17% - pyle: 7% - hand: 9% - hq: 1% - weap: 8% - afld: 6% - hpad: 4% - gtwr: 5% - gun: 5% - atwr: 9% - obli: 7% - eye: 1% - tmpl: 1% - sam: 7% - silo: 0% - fix: 1% UnitsToBuild: e1: 65% e2: 30% @@ -289,3 +184,134 @@ Player: Bots: hal9001 HarvesterBotModule: RequiresCondition: enable-cabal-ai || enable-watson-ai || enable-hal9001-ai + BaseBuilderBotModule@cabal: + RequiresCondition: enable-cabal-ai + BuildingQueues: Building.Nod, Building.GDI + DefenseQueues: Defence.Nod, Defence.GDI + MinimumExcessPower: 30 + MaximumExcessPower: 150 + ExcessPowerIncrement: 30 + ExcessPowerIncreaseThreshold: 5 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: nuke,nuk2 + BarracksTypes: pyle,hand + VehiclesFactoryTypes: weap,afld + ProductionTypes: pyle,hand,weap,afld,hpad + SiloTypes: silo + BuildingLimits: + proc: 4 + pyle: 3 + hand: 3 + hq: 1 + weap: 3 + afld: 3 + hpad: 0 + eye: 1 + tmpl: 1 + fix: 1 + silo: 1 + BuildingFractions: + proc: 20 + pyle: 5 + hand: 5 + hq: 4 + weap: 9 + afld: 9 + gtwr: 5 + gun: 5 + atwr: 9 + obli: 7 + sam: 7 + eye: 1 + tmpl: 1 + fix: 1 + hpad: 2 + BaseBuilderBotModule@watson: + RequiresCondition: enable-watson-ai + BuildingQueues: Building.Nod, Building.GDI + DefenseQueues: Defence.Nod, Defence.GDI + MinimumExcessPower: 30 + MaximumExcessPower: 150 + ExcessPowerIncrement: 30 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: nuke,nuk2 + BarracksTypes: pyle,hand + VehiclesFactoryTypes: weap,afld + ProductionTypes: pyle,hand,weap,afld,hpad + SiloTypes: silo + BuildingLimits: + proc: 4 + pyle: 3 + hand: 3 + hq: 1 + weap: 3 + afld: 3 + hpad: 2 + eye: 1 + tmpl: 1 + fix: 1 + silo: 1 + BuildingFractions: + proc: 17 + pyle: 2 + hand: 2 + hq: 1 + weap: 5 + afld: 5 + hpad: 4 + gtwr: 5 + gun: 5 + atwr: 9 + obli: 7 + eye: 1 + tmpl: 1 + sam: 7 + fix: 1 + BaseBuilderBotModule@hal9001: + RequiresCondition: enable-hal9001-ai + BuildingQueues: Building.Nod, Building.GDI + DefenseQueues: Defence.Nod, Defence.GDI + MinimumExcessPower: 30 + MaximumExcessPower: 210 + ExcessPowerIncrement: 30 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: nuke,nuk2 + BarracksTypes: pyle,hand + VehiclesFactoryTypes: weap,afld + ProductionTypes: pyle,hand,weap,afld,hpad + SiloTypes: silo + BuildingLimits: + proc: 4 + pyle: 4 + hand: 4 + hq: 1 + weap: 4 + afld: 4 + hpad: 2 + eye: 1 + tmpl: 1 + fix: 1 + silo: 1 + BuildingFractions: + proc: 17 + pyle: 7 + hand: 9 + hq: 1 + weap: 8 + afld: 6 + hpad: 4 + gtwr: 5 + gun: 5 + atwr: 9 + obli: 7 + eye: 1 + tmpl: 1 + sam: 7 + fix: 1 + BuildingRepairBotModule: + RequiresCondition: enable-cabal-ai || enable-watson-ai || enable-hal9001-ai diff --git a/mods/d2k/rules/ai.yaml b/mods/d2k/rules/ai.yaml index c4cad5b572..a9efceacaf 100644 --- a/mods/d2k/rules/ai.yaml +++ b/mods/d2k/rules/ai.yaml @@ -2,11 +2,6 @@ Player: HackyAI@Omnius: Name: Omnius Type: omnius - MinimumExcessPower: 50 - ExcessPowerIncrement: 50 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 200 - BuildingQueues: Building, Upgrade UnitQueues: Infantry, Vehicle, Armor, Starport, Aircraft BuildingCommonNames: ConstructionYard: construction_yard @@ -18,40 +13,6 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harvester - BuildingLimits: - barracks: 1 - refinery: 4 - outpost: 1 - high_tech_factory: 1 - light_factory: 1 - heavy_factory: 1 - starport: 1 - repair_pad: 1 - research_centre: 1 - palace: 1 - upgrade.conyard: 1 - upgrade.barracks: 1 - upgrade.light: 1 - upgrade.heavy: 1 - upgrade.hightech: 1 - BuildingFractions: - barracks: 0.1% - refinery: 20.1% - medium_gun_turret: 8% - outpost: 0.1% - high_tech_factory: 0.1% - large_gun_turret: 6% - light_factory: 0.1% - heavy_factory: 0.1% - starport: 0.1% - repair_pad: 0.1% - research_centre: 0.1% - palace: 0.1% - upgrade.conyard: 0.1% - upgrade.barracks: 0.1% - upgrade.light: 0.1% - upgrade.heavy: 0.1% - upgrade.hightech: 0.1% UnitsToBuild: carryall: 1% light_inf: 65% @@ -86,11 +47,6 @@ Player: HackyAI@Vidius: Name: Vidious Type: vidious - MinimumExcessPower: 50 - ExcessPowerIncrement: 50 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 200 - BuildingQueues: Building, Upgrade UnitQueues: Infantry, Vehicle, Armor, Starport, Aircraft BuildingCommonNames: ConstructionYard: construction_yard @@ -102,40 +58,6 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harvester - BuildingLimits: - barracks: 1 - refinery: 4 - outpost: 1 - high_tech_factory: 1 - light_factory: 1 - heavy_factory: 1 - starport: 1 - repair_pad: 1 - research_centre: 1 - palace: 1 - upgrade.conyard: 1 - upgrade.barracks: 1 - upgrade.light: 1 - upgrade.heavy: 1 - upgrade.hightech: 1 - BuildingFractions: - barracks: 0.1% - refinery: 20.1% - medium_gun_turret: 5% - outpost: 0.1% - high_tech_factory: 0.1% - large_gun_turret: 10% - light_factory: 0.1% - heavy_factory: 0.1% - starport: 0.1% - repair_pad: 0.1% - research_centre: 0.1% - palace: 0.1% - upgrade.conyard: 0.1% - upgrade.barracks: 0.1% - upgrade.light: 0.1% - upgrade.heavy: 0.1% - upgrade.hightech: 0.1% UnitsToBuild: carryall: 1% light_inf: 65% @@ -170,11 +92,6 @@ Player: HackyAI@Gladius: Name: Gladius Type: gladius - MinimumExcessPower: 50 - ExcessPowerIncrement: 50 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 200 - BuildingQueues: Building, Upgrade UnitQueues: Infantry, Vehicle, Armor, Starport, Aircraft BuildingCommonNames: ConstructionYard: construction_yard @@ -186,39 +103,6 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harvester - BuildingLimits: - barracks: 1 - refinery: 4 - outpost: 1 - high_tech_factory: 1 - light_factory: 1 - heavy_factory: 1 - starport: 1 - repair_pad: 1 - research_centre: 1 - palace: 1 - upgrade.conyard: 1 - upgrade.barracks: 1 - upgrade.light: 1 - upgrade.heavy: 1 - upgrade.hightech: 1 - BuildingFractions: - barracks: 0.1% - refinery: 20.1% - medium_gun_turret: 4% - outpost: 0.1% - high_tech_factory: 0.1% - large_gun_turret: 12% - light_factory: 0.1% - heavy_factory: 0.1% - repair_pad: 0.1% - research_centre: 0.1% - palace: 0.1% - upgrade.conyard: 0.1% - upgrade.barracks: 0.1% - upgrade.light: 0.1% - upgrade.heavy: 0.1% - upgrade.hightech: 0.1% UnitsToBuild: carryall: 1% light_inf: 65% @@ -304,3 +188,148 @@ Player: Bots: gladius HarvesterBotModule: RequiresCondition: enable-omnius-ai || enable-vidious-ai || enable-gladius-ai + BaseBuilderBotModule@omnius: + RequiresCondition: enable-omnius-ai + BuildingQueues: Building, Upgrade + MinimumExcessPower: 50 + MaximumExcessPower: 200 + ExcessPowerIncrement: 50 + ExcessPowerIncreaseThreshold: 4 + MaxBaseRadius: 40 + ConstructionYardTypes: construction_yard + RefineryTypes: refinery + PowerTypes: wind_trap + VehiclesFactoryTypes: light_factory, heavy_factory, starport + ProductionTypes: light_factory, heavy_factory, barracks, starport + SiloTypes: silo + BuildingLimits: + barracks: 1 + refinery: 4 + outpost: 1 + high_tech_factory: 1 + light_factory: 1 + heavy_factory: 1 + starport: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BuildingFractions: + barracks: 1 + refinery: 20 + medium_gun_turret: 8 + outpost: 1 + high_tech_factory: 1 + large_gun_turret: 6 + light_factory: 1 + heavy_factory: 1 + starport: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BaseBuilderBotModule@vidious: + RequiresCondition: enable-vidious-ai + BuildingQueues: Building, Upgrade + MinimumExcessPower: 50 + MaximumExcessPower: 200 + ExcessPowerIncrement: 50 + ExcessPowerIncreaseThreshold: 4 + MaxBaseRadius: 40 + ConstructionYardTypes: construction_yard + RefineryTypes: refinery + PowerTypes: wind_trap + VehiclesFactoryTypes: light_factory, heavy_factory, starport + ProductionTypes: light_factory, heavy_factory, barracks, starport + SiloTypes: silo + BuildingLimits: + barracks: 1 + refinery: 4 + outpost: 1 + high_tech_factory: 1 + light_factory: 1 + heavy_factory: 1 + starport: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BuildingFractions: + barracks: 1 + refinery: 20 + medium_gun_turret: 5 + outpost: 1 + high_tech_factory: 1 + large_gun_turret: 10 + light_factory: 1 + heavy_factory: 1 + starport: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BaseBuilderBotModule@gladius: + RequiresCondition: enable-gladius-ai + BuildingQueues: Building, Upgrade + MinimumExcessPower: 50 + MaximumExcessPower: 200 + ExcessPowerIncrement: 50 + ExcessPowerIncreaseThreshold: 4 + MaxBaseRadius: 40 + ConstructionYardTypes: construction_yard + RefineryTypes: refinery + PowerTypes: wind_trap + VehiclesFactoryTypes: light_factory, heavy_factory, starport + ProductionTypes: light_factory, heavy_factory, barracks, starport + SiloTypes: silo + BuildingLimits: + barracks: 1 + refinery: 4 + outpost: 1 + high_tech_factory: 1 + light_factory: 1 + heavy_factory: 1 + starport: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BuildingFractions: + barracks: 1 + refinery: 20 + medium_gun_turret: 4 + outpost: 1 + high_tech_factory: 1 + large_gun_turret: 12 + light_factory: 1 + heavy_factory: 1 + repair_pad: 1 + research_centre: 1 + palace: 1 + upgrade.conyard: 1 + upgrade.barracks: 1 + upgrade.light: 1 + upgrade.heavy: 1 + upgrade.hightech: 1 + BuildingRepairBotModule: + RequiresCondition: enable-omnius-ai || enable-vidious-ai || enable-gladius-ai diff --git a/mods/ra/rules/ai.yaml b/mods/ra/rules/ai.yaml index cc03227fe6..fccc0a60f3 100644 --- a/mods/ra/rules/ai.yaml +++ b/mods/ra/rules/ai.yaml @@ -2,10 +2,6 @@ Player: HackyAI@RushAI: Name: Rush AI Type: rush - MinimumExcessPower: 60 - MaximumExcessPower: 160 - ExcessPowerIncrement: 40 - ExcessPowerIncreaseThreshold: 4 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -18,34 +14,6 @@ Player: Mcv: mcv ExcludeFromSquads: harv NavalUnits: ss,msub,dd,ca,lst,pt - BuildingLimits: - proc: 4 - barr: 1 - tent: 1 - kenn: 1 - dome: 1 - weap: 1 - atek: 1 - stek: 1 - fix: 1 - BuildingFractions: - proc: 30% - barr: 1% - kenn: 0.5% - tent: 1% - weap: 1% - pbox: 7% - gun: 7% - tsla: 5% - gap: 2% - ftur: 10% - agun: 5% - sam: 5% - atek: 1% - stek: 1% - fix: 0.1% - dome: 10% - mslo: 1% UnitsToBuild: e1: 65% e2: 15% @@ -74,10 +42,6 @@ Player: HackyAI@NormalAI: Name: Normal AI Type: normal - MinimumExcessPower: 60 - MaximumExcessPower: 200 - ExcessPowerIncrement: 40 - ExcessPowerIncreaseThreshold: 4 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -91,43 +55,6 @@ Player: Mcv: mcv ExcludeFromSquads: harv NavalUnits: ss,msub,dd,ca,lst,pt - BuildingLimits: - proc: 4 - barr: 1 - tent: 1 - dome: 1 - weap: 1 - spen: 1 - syrd: 1 - hpad: 4 - afld: 4 - afld.ukraine: 4 - atek: 1 - stek: 1 - fix: 1 - BuildingFractions: - proc: 15% - tent: 1% - barr: 1% - kenn: 0.5% - dome: 1% - weap: 6% - hpad: 4% - spen: 1% - syrd: 1% - afld: 4% - afld.ukraine: 4% - pbox: 7% - gun: 7% - ftur: 10% - tsla: 5% - gap: 2% - fix: 1% - agun: 5% - sam: 1% - atek: 1% - stek: 1% - mslo: 1% UnitsToBuild: e1: 65% e2: 15% @@ -165,10 +92,6 @@ Player: HackyAI@TurtleAI: Name: Turtle AI Type: turtle - MinimumExcessPower: 60 - MaximumExcessPower: 250 - ExcessPowerIncrement: 50 - ExcessPowerIncreaseThreshold: 4 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -182,44 +105,6 @@ Player: Mcv: mcv ExcludeFromSquads: harv NavalUnits: ss,msub,dd,ca,lst,pt - BuildingLimits: - proc: 4 - barr: 1 - tent: 1 - kenn: 1 - dome: 1 - weap: 1 - spen: 1 - syrd: 1 - hpad: 4 - afld: 4 - afld.ukraine: 4 - atek: 1 - stek: 1 - fix: 1 - BuildingFractions: - proc: 30% - tent: 1% - barr: 1% - kenn: 0.5% - weap: 3% - hpad: 2% - afld: 2% - afld.ukraine: 2% - spen: 1% - syrd: 1% - pbox: 10% - gun: 10% - ftur: 10% - tsla: 7% - gap: 3% - fix: 0.1% - dome: 10% - agun: 5% - sam: 5% - atek: 1% - stek: 1% - mslo: 1% UnitsToBuild: e1: 65% e2: 15% @@ -257,10 +142,6 @@ Player: HackyAI@NavalAI: Name: Naval AI Type: naval - MinimumExcessPower: 60 - MaximumExcessPower: 200 - ExcessPowerIncrement: 40 - ExcessPowerIncreaseThreshold: 4 BuildingCommonNames: ConstructionYard: fact Refinery: proc @@ -274,39 +155,6 @@ Player: Mcv: mcv ExcludeFromSquads: harv NavalUnits: ss,msub,dd,ca,lst,pt - BuildingLimits: - proc: 4 - dome: 1 - barr: 1 - tent: 1 - spen: 1 - syrd: 1 - hpad: 8 - afld: 8 - afld.ukraine: 8 - weap: 1 - atek: 1 - stek: 1 - fix: 1 - BuildingFractions: - proc: 30% - dome: 1% - weap: 1% - hpad: 20% - afld: 20% - afld.ukraine: 20% - atek: 1% - stek: 1% - spen: 1% - syrd: 1% - fix: 0.1% - pbox: 12% - gun: 12% - ftur: 12% - tsla: 12% - agun: 5% - sam: 5% - mslo: 1% UnitsToBuild: harv: 1% heli: 30% @@ -386,3 +234,196 @@ Player: Bots: naval HarvesterBotModule: RequiresCondition: enable-rush-ai || enable-normal-ai || enable-turtle-ai || enable-naval-ai + BaseBuilderBotModule@rush: + RequiresCondition: enable-rush-ai + MinimumExcessPower: 60 + MaximumExcessPower: 160 + ExcessPowerIncrement: 40 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: powr,apwr + BarracksTypes: barr,tent + VehiclesFactoryTypes: weap + ProductionTypes: barr,tent,weap + SiloTypes: silo + BuildingLimits: + proc: 4 + barr: 1 + tent: 1 + kenn: 1 + dome: 1 + weap: 1 + atek: 1 + stek: 1 + fix: 1 + BuildingFractions: + proc: 30 + barr: 1 + kenn: 1 + tent: 1 + weap: 1 + pbox: 7 + gun: 7 + tsla: 5 + gap: 2 + ftur: 10 + agun: 5 + sam: 5 + atek: 1 + stek: 1 + fix: 1 + dome: 10 + mslo: 1 + BaseBuilderBotModule@normal: + RequiresCondition: enable-normal-ai + MinimumExcessPower: 60 + MaximumExcessPower: 200 + ExcessPowerIncrement: 40 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: powr,apwr + BarracksTypes: barr,tent + VehiclesFactoryTypes: weap + ProductionTypes: barr,tent,weap,afld,hpad + NavalProductionTypes: spen,syrd + SiloTypes: silo + BuildingLimits: + proc: 4 + barr: 1 + tent: 1 + dome: 1 + weap: 1 + spen: 1 + syrd: 1 + hpad: 4 + afld: 4 + afld.ukraine: 4 + atek: 1 + stek: 1 + fix: 1 + BuildingFractions: + proc: 15 + tent: 1 + barr: 1 + kenn: 1 + dome: 1 + weap: 6 + hpad: 4 + spen: 1 + syrd: 1 + afld: 4 + afld.ukraine: 4 + pbox: 7 + gun: 7 + ftur: 10 + tsla: 5 + gap: 2 + fix: 1 + agun: 5 + sam: 1 + atek: 1 + stek: 1 + mslo: 1 + BaseBuilderBotModule@turtle: + RequiresCondition: enable-turtle-ai + MinimumExcessPower: 60 + MaximumExcessPower: 250 + ExcessPowerIncrement: 50 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: powr,apwr + BarracksTypes: barr,tent + VehiclesFactoryTypes: weap + ProductionTypes: barr,tent,weap,afld,hpad + NavalProductionTypes: spen,syrd + SiloTypes: silo + BuildingLimits: + proc: 4 + barr: 1 + tent: 1 + kenn: 1 + dome: 1 + weap: 1 + spen: 1 + syrd: 1 + hpad: 4 + afld: 4 + afld.ukraine: 4 + atek: 1 + stek: 1 + fix: 1 + BuildingFractions: + proc: 30 + tent: 1 + barr: 1 + kenn: 1 + weap: 3 + hpad: 2 + afld: 2 + afld.ukraine: 2 + spen: 1 + syrd: 1 + pbox: 10 + gun: 10 + ftur: 10 + tsla: 7 + gap: 3 + fix: 1 + dome: 10 + agun: 5 + sam: 5 + atek: 1 + stek: 1 + mslo: 1 + BaseBuilderBotModule@naval: + RequiresCondition: enable-naval-ai + MinimumExcessPower: 60 + MaximumExcessPower: 200 + ExcessPowerIncrement: 40 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: fact + RefineryTypes: proc + PowerTypes: powr,apwr + BarracksTypes: barr,tent + VehiclesFactoryTypes: weap + ProductionTypes: barr,tent,weap,afld,hpad + NavalProductionTypes: spen,syrd + SiloTypes: silo + BuildingLimits: + proc: 4 + dome: 1 + barr: 1 + tent: 1 + spen: 1 + syrd: 1 + hpad: 8 + afld: 8 + afld.ukraine: 8 + weap: 1 + atek: 1 + stek: 1 + fix: 1 + BuildingFractions: + proc: 30 + dome: 1 + weap: 1 + hpad: 20 + afld: 20 + afld.ukraine: 20 + atek: 1 + stek: 1 + spen: 1 + syrd: 1 + fix: 1 + pbox: 12 + gun: 12 + ftur: 12 + tsla: 12 + agun: 5 + sam: 5 + mslo: 1 + BuildingRepairBotModule: + RequiresCondition: enable-rush-ai || enable-normal-ai || enable-turtle-ai || enable-naval-ai diff --git a/mods/ts/rules/ai.yaml b/mods/ts/rules/ai.yaml index b927ae536f..41fb50bbf5 100644 --- a/mods/ts/rules/ai.yaml +++ b/mods/ts/rules/ai.yaml @@ -2,10 +2,6 @@ Player: HackyAI@TestAI: Name: Test AI Type: test - MinimumExcessPower: 30 - ExcessPowerIncrement: 30 - ExcessPowerIncreaseThreshold: 4 - MaximumExcessPower: 200 BuildingCommonNames: ConstructionYard: gacnst Refinery: proc @@ -17,43 +13,6 @@ Player: UnitsCommonNames: Mcv: mcv ExcludeFromSquads: harv - BuildingLimits: - proc: 4 - gasilo: 2 - gapowr: 8 - napowr: 8 - gapile: 1 - nahand: 1 - gaweap: 1 - naweap: 1 - garadr: 1 - naradr: 1 - gatech: 1 - natech: 1 - nastlh: 1 - gavulc: 8 - garock: 2 - gacsam: 4 - naobel: 2 - nalasr: 8 - nasam: 4 - BuildingFractions: - proc: 30% - gapile: 1% - nahand: 1% - gaweap: 1% - naweap: 1% - garadr: 1% - naradr: 1% - gatech: 1% - natech: 1% - nastlh: 1% - nalasr: 10% - gavulc: 10% - garock: 3% - gacsam: 6% - nasam: 6% - naobel: 3% UnitsToBuild: e1: 80% e2: 25% @@ -82,3 +41,55 @@ Player: Bots: test HarvesterBotModule: RequiresCondition: enable-test-ai + BaseBuilderBotModule@test: + RequiresCondition: enable-test-ai + MinimumExcessPower: 30 + MaximumExcessPower: 200 + ExcessPowerIncrement: 30 + ExcessPowerIncreaseThreshold: 4 + ConstructionYardTypes: gacnst + RefineryTypes: proc + PowerTypes: gapowr, napowr, naapwr + BarracksTypes: gapile, nahand + VehiclesFactoryTypes: gaweap, naweap + ProductionTypes: gapile, nahand, gaweap, naweap + SiloTypes: gasilo + BuildingLimits: + proc: 4 + gasilo: 2 + gapowr: 8 + napowr: 8 + gapile: 1 + nahand: 1 + gaweap: 1 + naweap: 1 + garadr: 1 + naradr: 1 + gatech: 1 + natech: 1 + nastlh: 1 + gavulc: 8 + garock: 2 + gacsam: 4 + naobel: 2 + nalasr: 8 + nasam: 4 + BuildingFractions: + proc: 30 + gapile: 1 + nahand: 1 + gaweap: 1 + naweap: 1 + garadr: 1 + naradr: 1 + gatech: 1 + natech: 1 + nastlh: 1 + nalasr: 10 + gavulc: 10 + garock: 3 + gacsam: 6 + nasam: 6 + naobel: 3 + BuildingRepairBotModule: + RequiresCondition: enable-test-ai