Initial commit

This commit is contained in:
2026-02-28 14:00:45 -06:00
commit 16d3170787
1134 changed files with 589134 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" ?>
<Equations>
<Should_Build_EM_Field_Generator>
50.0
*
((Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Structure]}
+
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]})
+
(100.0 > Variable_Target.DistanceToNearestFriendly {Parameter_Type = "Empire_Mineral_Processor",
Parameter_Type = "Empire_Ground_Mining_Facility"}))
</Should_Build_EM_Field_Generator>
<Should_Build_Grenade_Mortar>
50.0
*
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Vehicle]}
*
Variable_Target.FriendlyForce
</Should_Build_Grenade_Mortar>
<Should_Build_Offensive_Sensor_Node>
40.0
*
((Variable_Target.DistanceToNearestFriendly > 300.0) * (Variable_Target.DistanceToNearestEnemy > 300.0)
+
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Infantry]}
*
Variable_Target.FriendlyForce)
</Should_Build_Offensive_Sensor_Node>
</Equations>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" ?>
<Equations>
<Should_Remove_Corruption>
50.0
*
Variable_Target.IsCorrupted
*
(Variable_Target.TimeSinceCorruptionChange > 180.0)
</Should_Remove_Corruption>
<Roaming_Empire_Fleet_Target>
Variable_Target.IsHumanControlled
*
Variable_Target.EnemyForce.SpaceTotal
</Roaming_Empire_Fleet_Target>
</Equations>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<Equations>
<Should_Garrison_Bunker>
20.0
*
(Variable_Target.GarrisonSlotsAvailable > 0)
*
(Variable_Self.IsDefender +
((Game.IsCampaignGame == 0)
*
Function_Is_Initial_Skirmish_State_Established.Evaluate
*
(Function_May_Lose_Land_Control_Game.Evaluate == 0.0)))
*
(Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Capturable"}
+
Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Rebel_Pad"<!--, Parameter_Type = "FCU_Garrison_Bunker_Rebel", Parameter_Type = "FCU_Garrison_Bunker_Rebel_Pad"-->} *
Variable_Self.IsFaction {Parameter_Faction = "REBEL"}
+
Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Empire_Pad"<!--, Parameter_Type = "FCU_Garrison_Bunker_Empire", Parameter_Type = "FCU_Garrison_Bunker_Empire_Pad"-->} *
Variable_Self.IsFaction {Parameter_Faction = "EMPIRE"}
+
Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Pirates_Pad"} *
Variable_Self.IsFaction {Parameter_Faction = "PIRATES"}
+
Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Underworld_Pad"<!--, Parameter_Type = "FCU_Garrison_Bunker_Underworld", Parameter_Type = "FCU_Garrison_Bunker_Underworld_Pad"-->} *
Variable_Self.IsFaction {Parameter_Faction = "UNDERWORLD"}
+
Variable_Target.Type.IsType {Parameter_Type = "Garrison_Bunker_Hutts_Pad"<!--, Parameter_Type = "FCU_Garrison_Bunker_Hutts", Parameter_Type = "FCU_Garrison_Bunker_Hutts_Pad"-->} *
Variable_Self.IsFaction {Parameter_Faction = "HUTTS"})
</Should_Garrison_Bunker>
<Should_Fire_Orbital_Bombardment>
100.0
*
Variable_Self.IsOrbitalBombardmentAvailable
*
Variable_Target.Location.EnemyForce
</Should_Fire_Orbital_Bombardment>
<Should_Deploy_Troop_Transports>
50.0
*
((1.0 - Game.Age / 180.0) + (Game.IsCampaignGame == 0.0))
*
(3 > Variable_Self.UnitSpaceAvailable)
*
(Variable_Target.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Infantry]} / 300)
</Should_Deploy_Troop_Transports>
<Should_Garrison_Transport>
50.0
*
((1.0 - Game.Age / 250.0) + (Game.IsCampaignGame == 0.0))
*
((Variable_Self.IsDefender == 0.0) + (Game.IsCampaignGame == 0))
*
Variable_Target.Type.IsType {Parameter_Type = "HAV_Juggernaut",
Parameter_Type = "F9TZ_Cloaking_Transport",
Parameter_Type = "Hutt_SailBarge",
Parameter_Type = "Gallofree_HTT_Transport"}
</Should_Garrison_Transport>
</Equations>

View File

@@ -0,0 +1,437 @@
<?xml version="1.0"?>
<Equations>
<!-- Desire to build generic units in tactical-only games
Is it not a campaign game
AND SCALE UP
Small base desire
We don't have enough of a force advantage
Randomly, half of the time we get extra desire to build units
UNUSED The Pop cap affecting reinforcement limits should take care of this
AND
Do we not have too many reinforcements
OR
Do we have fewer reinforcements than we have fielded units
*
(
((2000 > Variable_Self.ReinforcementsUnnormalized)
+
((Variable_Self.FriendlyForceUnnormalized - Variable_Self.ReinforcementsUnnormalized) > Variable_Self.ReinforcementsUnnormalized))
> 0
)
-->
<Tactical_Multiplayer_Should_Build_Generic>
(Game.IsCampaignGame == 0)
*
(
1.0
+
15.0 * (Variable_Enemy.Force >= (0.8 * Variable_Self.Force))
+
5.0 * (0#1>0.5)
)
</Tactical_Multiplayer_Should_Build_Generic>
<Is_Outpost_Pad>
Variable_Target.Type.IsType {Parameter_Type = "Skirmish_Outpost_Pad"}
</Is_Outpost_Pad>
<!-- Build units if
We're not saving for refineries
We don't need to upgrade tech level
We want units
-->
<Tactical_Multiplayer_Should_Build_Units_Generic_Land>
(1 - Function_Is_Saving_For_Refineries_Land.Evaluate)
*
(1 - Function_Skirmish_Upgrade_Tech.Evaluate)
*
Function_Is_Initial_Skirmish_State_Established.Evaluate
*
Function_Tactical_Multiplayer_Should_Build_Generic.Evaluate
*
(1.0 - Function_May_Lose_Land_Control_Game.Evaluate)
</Tactical_Multiplayer_Should_Build_Units_Generic_Land>
<!--
Generally want to build a base structure as long as there are no enemies around.
-->
<Tactical_Multiplayer_Should_Build_Structure_Generic_Land>
(1 - Function_Want_To_Retreat_From_Land.Evaluate)
*
(1 - Function_Is_Refinery_Pad.Evaluate)
*
(1 - Function_Is_Outpost_Pad.Evaluate)
*
(1 - Variable_Target.Type.IsType {Parameter_Type = "Skirmish_Build_Pad"
,Parameter_Type = "Rebel_Build_Pad"
,Parameter_Type = "Empire_Build_Pad"
,Parameter_Type = "Underworld_Build_Pad"
,Parameter_Type = "Hutt_Build_Pad"
,Parameter_Type = "Pirate_Build_Pad"})
*
(1 - Variable_Target.HasBuiltObject)
*
(
1
+
20
*
(Function_Num_Refineries.Evaluate > 0)
*
(Variable_Target.Type.IsType {Parameter_Type = "R_Ground_Power_Generator_Build_Pad"
,Parameter_Type = "E_Ground_Power_Generator_Build_Pad"
,Parameter_Type = "U_Ground_Power_Generator_Build_Pad"
,Parameter_Type = "P_Ground_Power_Generator_Build_Pad"
,Parameter_Type = "H_Ground_Power_Generator_Build_Pad"})
+
(1.0 - Function_Skirmish_Upgrade_Tech.Evaluate)
*
(30 * (Variable_Target.Location.EnemyForce == 0.0))
-
10 * (Variable_Target.Type.IsType {Parameter_Type = "R_Ground_Communications_Array_Build_Pad"
,Parameter_Type = "E_Ground_Communications_Array_Build_Pad"
,Parameter_Type = "H_Ground_Communications_Array_Build_Pad"
,Parameter_Type = "E_Ground_Research_Facility_Build_Pad"
,Parameter_Type = "H_Ground_Advanced_Technologies_Facility_Build_Pad"
,Parameter_Type = "R_Ground_Research_Facility_Build_Pad"})
)
*
(1.0 - Function_May_Lose_Land_Control_Game.Evaluate)
</Tactical_Multiplayer_Should_Build_Structure_Generic_Land>
<Tactical_Multiplayer_Should_Build_Basic_Structure>
Function_Tactical_Multiplayer_Should_Build_Structure_Generic_Land.Evaluate
*
(1 - Function_Is_Saving_For_Refineries_Land.Evaluate)
*
(1 - Variable_Target.Type.IsType {Parameter_Type = "E_Ground_Barracks_Build_Pad",
Parameter_Type = "R_Ground_Barracks_Build_Pad",
Parameter_Type = "U_Ground_Barracks_Build_Pad",
Parameter_Type = "H_Ground_Barracks_Build_Pad",
Parameter_Type = "Pirate_Outpost_Build_Pad",
Parameter_Type = "Imperial_Command_Center_Build_Pad",
Parameter_Type = "Rebel_Command_Center_Build_Pad",
Parameter_Type = "Underworld_Palace_Build_Pad",
Parameter_Type = "Hutts_Command_Center_Build_Pad",
Parameter_Type = "Pirate_Command_Center_Build_Pad"})
*
Function_Is_Initial_Skirmish_State_Established.Evaluate
</Tactical_Multiplayer_Should_Build_Basic_Structure>
<Tactical_Multiplayer_Should_Build_Barracks>
Function_Tactical_Multiplayer_Should_Build_Structure_Generic_Land.Evaluate
*
Variable_Target.Type.IsType {Parameter_Type = "E_Ground_Barracks_Build_Pad",
Parameter_Type = "R_Ground_Barracks_Build_Pad",
Parameter_Type = "Pirate_Outpost_Build_Pad",
Parameter_Type = "U_Ground_Barracks_Build_Pad",
Parameter_Type = "H_Ground_Barracks_Build_Pad"}
*
25.0
*
(1 + (Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Infantry | Hero]} == 0.0))
</Tactical_Multiplayer_Should_Build_Barracks>
<Tactical_Multiplayer_Should_Build_Command_Center>
50.0
*
Function_Tactical_Multiplayer_Should_Build_Structure_Generic_Land.Evaluate
*
Variable_Target.Type.IsType {Parameter_Type = "Imperial_Command_Center_Build_Pad",
Parameter_Type = "Rebel_Command_Center_Build_Pad",
Parameter_Type = "Pirate_Command_Center_Build_Pad",
Parameter_Type = "Hutts_Command_Center_Build_Pad",
Parameter_Type = "Underworld_Palace_Build_Pad"}
</Tactical_Multiplayer_Should_Build_Command_Center>
<!-- Build upgraded abilities if
We're not saving for refineries
We don't need to upgrade tech level
We want upgraded abilities
-->
<!-- SoaFE Removed
*
(15 > Variable_Self.UnitSpaceAvailable) -->
<Should_Purchase_Ability_Generic_Land>
25
*
(1 - Function_Is_Saving_For_Refineries_Land.Evaluate)
*
(1 - Function_Skirmish_Upgrade_Tech.Evaluate)
*
Function_Should_Purchase_Ability_Generic.Evaluate
*
(Function_Num_Refineries.Evaluate > 0)
</Should_Purchase_Ability_Generic_Land>
<!--
Do we have open build pads waiting to be built upon
AND
Do we have less than N refineries
OR
-Does the enemy have more refineries than we do
AND
Do we not have a surplus of cash-->
<Is_Saving_For_Refineries_Land>
(Function_Num_Open_Land_Econ_Structure_Build_Locations.Evaluate > 0)
*
(4 > Variable_Self.TacticalBuiltStructureCount{Parameter_Type = "Empire_Mineral_Processor"
,Parameter_Type = "Rebel_Mineral_Processor"
,Parameter_Type = "Underworld_Mineral_Processor"
,Parameter_Type = "Hutts_Mineral_Processor"
,Parameter_Type = "Pirate_Mineral_Processor"
,Parameter_Type = "Empire_Ground_Mining_Facility"
,Parameter_Type = "Rebel_Ground_Mining_Facility"
,Parameter_Type = "Underworld_Ground_Mining_Facility"
,Parameter_Type = "Hutts_Ground_Mining_Facility"
,Parameter_Type = "Pirate_Ground_Mining_Facility"})
*
(1500 > Variable_Self.CreditsUnnormalized)
*
Function_Want_More_Resource_Structures_Land.Evaluate
</Is_Saving_For_Refineries_Land>
<Num_Refineries>
Variable_Self.TacticalBuiltStructureCount{Parameter_Type = "Empire_Mineral_Processor"
,Parameter_Type = "Rebel_Mineral_Processor"
,Parameter_Type = "Underworld_Mineral_Processor"
,Parameter_Type = "Hutts_Mineral_Processor"
,Parameter_Type = "Pirate_Mineral_Processor"
,Parameter_Type = "Empire_Ground_Mining_Facility"
,Parameter_Type = "Rebel_Ground_Mining_Facility"
,Parameter_Type = "Underworld_Ground_Mining_Facility"
,Parameter_Type = "Hutts_Ground_Mining_Facility"
,Parameter_Type = "Pirate_Ground_Mining_Facility"}
</Num_Refineries>
<Is_Refinery_Pad>
(Variable_Target.Type.IsType {Parameter_Type = "Skirmish_Mineral_Processor_Pad"}
+
Variable_Target.Type.IsType {Parameter_Type = "N_Ground_Mining_Facility_Build_Pad"}) > 0
</Is_Refinery_Pad>
<Need_To_Build_Refinery_Land>
50.0
*
(Function_Is_Refinery_Pad.Evaluate + Function_Is_Outpost_Pad.Evaluate)
*
(
0.2 >
(
Variable_Target.Location.EnemyForce /
(Variable_Target.Location.EnemyForce + Variable_Target.Location.FriendlyForce )
)
)
*
(Variable_Target.DistanceToNearestEnemy{Parameter_Category = GameObjectCategoryType[Structure]} > 500)
</Need_To_Build_Refinery_Land>
<!-- Upgrade tech in skirmish if
We're not already maxed out
AND
Our base isn't under attack (because we'd prefer spending on turrets or units, plus we might lose the tech we just bought)
AND
We're finding the need to burn units
OR
We have enough units on the field
AND
We have more force than the enemy
OR
Are we past due for a tech two upgrade VERIFY THAT THIS WORKS
OR
Are we past due for a tech three upgrade
*
(1 - Script_AnyBaseStructuresThreatened.Evaluate)
-->
<Skirmish_Upgrade_Tech>
(1 - Function_Is_Skirmish_Tech_Maxed.Evaluate)
*
(
Function_Should_Burn_Units_Land.Evaluate
+
(Variable_Self.TacticalBuiltStructureCount {Parameter_Type = "Empire_Ground_Mining_Facility",
Parameter_Type = "Rebel_Ground_Mining_Facility",
Parameter_Type = "Underworld_Ground_Mining_Facility",
Parameter_Type = "Hutts_Ground_Mining_Facility",
Parameter_Type = "Pirate_Ground_Mining_Facility",
Parameter_Type = "Empire_Mineral_Processor",
Parameter_Type = "Rebel_Mineral_Processor",
Parameter_Type = "Underworld_Mineral_Processor",
Parameter_Type = "Hutts_Mineral_Processor",
Parameter_Type = "Pirate_Mineral_Processor"} >= 1)
*
(Variable_Self.FriendlyForceUnnormalized > 400)
*
(
(Variable_Self.FriendlyForce > (0.65 * Variable_Self.EnemyForce))
*
(1 - Variable_Self.HasUnit{Parameter_Type = "RC_Level_Two_Tech_Upgrade",
Parameter_Type = "EC_Level_Two_Tech_Upgrade",
Parameter_Type = "HC_Level_Two_Tech_Upgrade",
Parameter_Type = "PC_Level_Two_Tech_Upgrade",
Parameter_Type = "UC_Level_Two_Tech_Upgrade"})
+
(Variable_Self.FriendlyForce > 0.75 * Variable_Self.EnemyForce)
*
(Variable_Self.FriendlyForceUnnormalized > 3000)
*
(1 - Variable_Self.HasUnit{Parameter_Type = "RC_Level_Three_Tech_Upgrade",
Parameter_Type = "EC_Level_Three_Tech_Upgrade",
Parameter_Type = "HC_Level_Three_Tech_Upgrade",
Parameter_Type = "PC_Level_Three_Tech_Upgrade",
Parameter_Type = "UC_Level_Three_Tech_Upgrade"})
+
(Variable_Self.FriendlyForce > 0.75 * Variable_Self.EnemyForce)
*
(Variable_Self.FriendlyForceUnnormalized > 4000)
*
(1 - Variable_Self.HasUnit{Parameter_Type = "RC_Level_Four_Tech_Upgrade",
Parameter_Type = "EC_Level_Four_Tech_Upgrade",
Parameter_Type = "HC_Level_Four_Tech_Upgrade",
Parameter_Type = "PC_Level_Four_Tech_Upgrade",
Parameter_Type = "UC_Level_Four_Tech_Upgrade"})
)
)
*
(1.0 - Function_May_Lose_Land_Control_Game.Evaluate)
> 0
</Skirmish_Upgrade_Tech>
<Skirmish_Upgrade_Tech_With_Multiplier>
50.0 * Function_Skirmish_Upgrade_Tech.Evaluate
</Skirmish_Upgrade_Tech_With_Multiplier>
<Is_Skirmish_Tech_Maxed>
Variable_Self.HasUnit{Parameter_Type = "RC_Level_Four_Tech_Upgrade",
Parameter_Type = "EC_Level_Four_Tech_Upgrade",
Parameter_Type = "HC_Level_Four_Tech_Upgrade",
Parameter_Type = "PC_Level_Four_Tech_Upgrade",
Parameter_Type = "UC_Level_Four_Tech_Upgrade"}
</Is_Skirmish_Tech_Maxed>
<Need_Heroes_Landed>
50
*
(Game.IsCampaignGame == 0)
*
(Variable_Self.ReinforcementsUnnormalized {Parameter_Category = GameObjectCategoryType[LandHero]} > 0)
</Need_Heroes_Landed>
<May_Lose_Land_Control_Game>
(Variable_Self.HasUnit {Parameter_Type = "Reinforcement_Point"} == 0)
*
Game.IsLandControlGame
</May_Lose_Land_Control_Game>
<Should_Purchase_Early_Land_Upgrades>
Function_ReallyBig.Evaluate
*
Function_Is_Initial_Skirmish_State_Established.Evaluate
*
(1.0 - Function_May_Lose_Land_Control_Game.Evaluate)
</Should_Purchase_Early_Land_Upgrades>
<!-- Our initial comfort zone in skirmish requires...
We have a barracks (otherwise we can't build infantry to capture stuff)
AND
We have a source of income (either a command center or FCU command center)
AND
We have some units
OR
We've ever reached a point where we managed to upgrade tech (don't want to regress and build low level infantry late game when we have other options)
-->
<Is_Initial_Skirmish_State_Established>
Variable_Self.HasUnit {Parameter_Type = "E_Ground_Barracks",
Parameter_Type = "R_Ground_Barracks",
Parameter_Type = "H_Ground_Barracks",
Parameter_Type = "P_Ground_Outpost",
Parameter_Type = "U_Ground_Barracks"}
*
Variable_Self.HasUnit {Parameter_Type = "E_Ground_Command_Center",
Parameter_Type = "R_Ground_Command_Center",
Parameter_Type = "H_Ground_Command_Center",
Parameter_Type = "P_Ground_Command_Center",
Parameter_Type = "U_Ground_Palace"}
*
(Function_Num_Refineries.Evaluate > 0)
*
(Function_Non_Structure_Force_Unnormalized.Evaluate > 0.0)
+
Variable_Self.HasUnit{Parameter_Type = "RC_Level_Two_Tech_Upgrade",
Parameter_Type = "EC_Level_Two_Tech_Upgrade",
Parameter_Type = "UC_Level_Two_Tech_Upgrade",
Parameter_Type = "HC_Level_Two_Tech_Upgrade",
Parameter_Type = "PC_Level_Two_Tech_Upgrade",
Parameter_Type = "RC_Level_Three_Tech_Upgrade",
Parameter_Type = "EC_Level_Three_Tech_Upgrade",
Parameter_Type = "UC_Level_Three_Tech_Upgrade",
Parameter_Type = "HC_Level_Three_Tech_Upgrade",
Parameter_Type = "PC_Level_Three_Tech_Upgrade",
Parameter_Type = "RC_Level_Four_Tech_Upgrade",
Parameter_Type = "EC_Level_Four_Tech_Upgrade",
Parameter_Type = "UC_Level_Four_Tech_Upgrade",
Parameter_Type = "HC_Level_Four_Tech_Upgrade",
Parameter_Type = "PC_Level_Four_Tech_Upgrade"}
</Is_Initial_Skirmish_State_Established>
<Should_Build_Infantry_Emergency>
100.0
*
((200 > Function_Non_Structure_Force_Unnormalized.Evaluate)
*
(Function_Is_Initial_Skirmish_State_Established.Evaluate == 0)
+
Function_May_Lose_Land_Control_Game.Evaluate)
</Should_Build_Infantry_Emergency>
<Should_Secure_Victory_Control_Point>
Game.IsLandControlGame
*
Variable_Target.Type.IsType {Parameter_Type = "Reinforcement_Point"}
*
(30.0 + 30.0 * Function_May_Lose_Land_Control_Game.Evaluate)
</Should_Secure_Victory_Control_Point>
<Num_Open_Land_Econ_Structure_Build_Locations>
(Variable_Self.OpenBuildPadCount{Parameter_Type = "N_Ground_Mining_Facility_Build_Pad"
,Parameter_Type = "Skirmish_Mineral_Processor_Pad"
,Parameter_Type = "Skirmish_Outpost_Pad"})
</Num_Open_Land_Econ_Structure_Build_Locations>
<Should_Build_Bunker>
Variable_Target.Type.IsType {Parameter_Type = "Bunker_Pad"}
*
(1 - Variable_Target.HasBuiltObject)
*
Function_Is_Allowed_To_Build.Evaluate
*
15
*
(Game.Age > 60)
*
(1.0 + Variable_Self.Force {Parameter_Category = GameObjectCategoryType[Infantry]})
*
(Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Infantry]} > 800.0)
</Should_Build_Bunker>
<Skirmish_Needs_Magic_Cash_Drop_Land>
50.0
*
Variable_Self.HasUnit {Parameter_Type = "E_Ground_Command_Center",
Parameter_Type = "R_Ground_Command_Center",
Parameter_Type = "H_Ground_Command_Center",
Parameter_Type = "P_Ground_Command_Center",
Parameter_Type = "U_Ground_Palace"}
*
(3000.0 > Variable_Self.CreditsUnnormalized)
*
(Variable_Self.EnemyForceUnnormalized > Variable_Self.FriendlyForceUnnormalized)
*
(Game.Age > 180.0)
*
(Game.IsCampaignGame == 0.0)
</Skirmish_Needs_Magic_Cash_Drop_Land>
</Equations>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0"?>
<Equations>
<Should_Build_Obelisk_Tower>
50.0
*
((Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Structure]}
+
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]})
+
(100.0 > Variable_Target.DistanceToNearestFriendly {Parameter_Type = "Hutts_Mineral_Processor",
Parameter_Type = "Hutts_Ground_Mining_Facility"}))
</Should_Build_Obelisk_Tower>
<Should_Build_Guard_Tower>
50.0
*
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Vehicle]}
*
Variable_Target.FriendlyForce
</Should_Build_Guard_Tower>
<Should_Build_Landing_Pad>
50.0
*
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Air]}
</Should_Build_Landing_Pad>
<!-- FCU Landmode Items (Tried and failed. Kept basic stuff here in the event somebody figures this out...) -->
<!-- <Should_Build_FCU_H_Barracks>
100.0
</Should_Build_FCU_H_Barracks>
<Should_Build_FCU_H_Cantina>
100.0
</Should_Build_FCU_H_Cantina>
<Should_Build_FCU_H_Comm_Array>
100.0
</Should_Build_FCU_H_Comm_Array>
<Should_Build_FCU_H_Utility_Pad>
100.0
</Should_Build_FCU_H_Utility_Pad>
<Should_Build_FCU_H_Factory>
100.0
</Should_Build_FCU_H_Factory>
<Should_Build_FCU_H_Power_Gen>
100.0
</Should_Build_FCU_H_Power_Gen>
<Should_Build_FCU_H_Shield_Gen_370>
100.0
</Should_Build_FCU_H_Shield_Gen_370>
<Should_Build_FCU_H_Tech_Facility>
100.0
</Should_Build_FCU_H_Tech_Facility>
<Should_Build_FCU_H_Relay_Station>
100.0
</Should_Build_FCU_H_Relay_Station>
<Should_Build_FCU_H_Obelisk_Tower>
100.0
</Should_Build_FCU_H_Obelisk_Tower>
<Should_Build_FCU_H_Shield_Gen_740>
100.0
</Should_Build_FCU_H_Shield_Gen_740>
<Should_Build_FCU_H_Beam_Tower>
100.0
</Should_Build_FCU_H_Beam_Tower>-->
</Equations>

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" ?>
<Equations>
<Should_Build_MDU_Repair_Facility>
50.0
*
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]}
</Should_Build_MDU_Repair_Facility>
<Should_Build_Mobile_Shield_Generator>
50.0
*
(Variable_Target.FriendlyForce
+
(200.0 > Variable_Target.DistanceToNearestFriendly {Parameter_Type = "Rebel_Mineral_Processor",
Parameter_Type = "Rebel_Ground_Mining_Facility"}))
</Should_Build_Mobile_Shield_Generator>
<Should_Build_Rapid_Fire_Laser>
50.0
*
Variable_Target.EnemyForce
*
Variable_Target.FriendlyForce
</Should_Build_Rapid_Fire_Laser>
<!-- FCU Landmode Items (Tried and failed. Kept basic stuff here in the event somebody figures this out...) -->
<!-- <Should_Build_FCU_R_Barracks>
100.0
</Should_Build_FCU_R_Barracks>
<Should_Build_FCU_R_Cantina>
100.0
</Should_Build_FCU_R_Cantina>
<Should_Build_FCU_R_Comm_Array>
100.0
</Should_Build_FCU_R_Comm_Array>
<Should_Build_FCU_R_Utility_Pad>
100.0
</Should_Build_FCU_R_Utility_Pad>
<Should_Build_FCU_R_Lt_Factory>
100.0
</Should_Build_FCU_R_Lt_Factory>
<Should_Build_FCU_R_Power_Gen>
100.0
</Should_Build_FCU_R_Power_Gen>
<Should_Build_FCU_R_Shield_Gen_370>
100.0
</Should_Build_FCU_R_Shield_Gen_370>
<Should_Build_FCU_R_Research_Facility>
100.0
</Should_Build_FCU_R_Research_Facility>
<Should_Build_FCU_R_Hv_Factory>
100.0
</Should_Build_FCU_R_Hv_Factory>
<Should_Build_FCU_R_Relay_Station>
100.0
</Should_Build_FCU_R_Relay_Station>
<Should_Build_FCU_R_Training_Facility>
100.0
</Should_Build_FCU_R_Training_Facility>
<Should_Build_FCU_R_Refinery>
100.0
</Should_Build_FCU_R_Refinery>
<Should_Build_FCU_R_Hangar>
100.0
</Should_Build_FCU_R_Hangar>
<Should_Build_FCU_R_Shield_Gen_740>
100.0
</Should_Build_FCU_R_Shield_Gen_740>
<Should_Build_FCU_R_Turbo_Tower>
100.0
</Should_Build_FCU_R_Turbo_Tower>-->
</Equations>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" ?>
<Equations>
<Underworld_Offensive_Budget_Allocation>
5.0
+
(10.0 * clamp(Variable_Self.PlanetsControlled - Variable_Human.PlanetsControlled, 0.0, 1.0))
+
(6.0 * (1.0 - Function_Has_Enough_Space_Force_Globally.Evaluate))
+
(3.0 * Game.PlanetsCorrupted)
</Underworld_Offensive_Budget_Allocation>
<Underworld_Infrastructure_Budget_Allocation>
(4.0 - 3.0 * Game.PlanetsCorrupted)
*
(2.5 - Variable_Self.MaxedStarbases - Variable_Self.MaxedGroundbases)
*
(1.0 + Variable_Self.Maintenance)
+
10 * ((Variable_Self.HasStructure {Parameter_Type = "U_Ground_Droid_Works"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "U_Ground_Barracks"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "U_Ground_Vehicle_Factory"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "U_Ground_Palace"} == 0))
+
5.0 * (2 > Variable_Self.StructureCount {Parameter_Type = "U_Ground_Palace"})
+
3.0 * Function_Should_Save_For_Corruption.Evaluate
</Underworld_Infrastructure_Budget_Allocation>
</Equations>

View File

@@ -0,0 +1,184 @@
<?xml version="1.0" ?>
<Equations>
<Can_Corrupt_Planet>
Variable_Target.RetainsResidualInfluence
*
(Variable_Target.IsCorrupted == 0.0)
*
(Variable_Target.IsCorruptionTransitionActive == 0.0)
*
((Variable_Target.IsConnectedToCorruption + (Game.Age > Variable_Target.TimeSinceCorruptionChange)) > 0)
</Can_Corrupt_Planet>
<Should_Corrupt_Planet>
Function_Can_Corrupt_Planet.Evaluate
*
(3.0
+
2.0 * Variable_Target.IsConnectedToCorruption
+
1.0 * Variable_Target.IncomeUnnormalized / 100)
</Should_Corrupt_Planet>
<Can_Make_Black_Market_Purchase>
Variable_Target.IsCorrupted
*
Variable_Target.BlackMarketAbilitiesAvailable {Parameter_Faction = "Underworld"}
</Can_Make_Black_Market_Purchase>
<Should_Make_Black_Market_Purchase>
Function_Can_Make_Black_Market_Purchase.Evaluate
*
(Variable_Self.CreditsUnnormalized > Variable_Target.BlackMarketMinimumAbilityPrice {Parameter_Faction = "Underworld"})
*
(10.0 - Variable_Target.BlackMarketPriceModifier / 300.0)
</Should_Make_Black_Market_Purchase>
<Should_Hack_Super_Weapon>
Variable_Target.IsCorrupted
*
(Variable_Target.EnemyForce.HasSpaceUnitsBitfield {Parameter_Type = "Death_Star_II"} > 0.0)
*
(0.1 * (0.5 > Variable_Self.PlanetsControlled) +
10.0 * (Variable_Target.EnemyForce.HasGroundUnitsBitfield {Parameter_Type = "Emperor_Palpatine_Team"} > 0.0) +
10.0 * (Variable_Target.EnemyForce.HasSpaceUnitsBitfield {Parameter_Type = "Emperor_Palpatine_Team"} > 0.0))
</Should_Hack_Super_Weapon>
<Can_Sabotage_Planet>
Variable_Target.IsCorrupted
*
(Variable_Target.GroundbaseLevelUnnormalized > 0)
</Can_Sabotage_Planet>
<Should_Sabotage_Planet>
Function_Can_Sabotage_Planet.Evaluate
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
*
(25.0
+
5.0 * Function_GenericPlanetValue.Evaluate
+
5.0 * Variable_Target.HasStructure {Parameter_Type = "E_Ground_Research_Facility",
Parameter_Type = "Ground_Empire_Hypervelocity_Gun",
Parameter_Type = "Ground_Ion_Cannon",
Parameter_Type = "E_Galactic_Turbolaser_Tower_Defenses",
Parameter_Type = "R_Galactic_Turbolaser_Tower_Defenses"})
</Should_Sabotage_Planet>
<Should_Build_Underworld_Barracks>
18
*
(1.0 - clamp((Variable_Self.StructureCount {Parameter_Type = "U_Ground_Barracks", Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.0, 0.5))
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(Variable_Target.StructureCount {Parameter_Type = "U_Ground_Barracks", Parameter_Only_Consider_Complete = 1.0})
+
(2.0 * (3.0 > Variable_Self.StructureCount {Parameter_Type = "U_Ground_Barracks", Parameter_Only_Consider_Complete = 1.0}))
)
*
(2 > Variable_Target.StructureCount {Parameter_Type = "U_Ground_Barracks", Parameter_Only_Consider_Complete = 1.0})
*
(Function_Should_Underworld_Save_For_Desirable_Structures.Evaluate == 0.0)
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
</Should_Build_Underworld_Barracks>
<Should_Build_Underworld_Palace>
23
*
(Variable_Target.StructureCount {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 1.0} == 0)
*
(1.0 - clamp((Variable_Self.StructureCount {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.0, 0.5))
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(4.0 * (3.0 > Variable_Self.StructureCount {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 1.0}))
)
*
(1.0 - Game.PlanetsCorrupted + Variable_Self.PlanetsControlled)
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
+
50.0
*
(Variable_Self.HasStructure {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 0.0} == 0.0)
+
50.0
*
(Variable_Self.HasStructure {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 1.0} == 0.0)
*
(Variable_Target.HasStructure {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 0.0})
</Should_Build_Underworld_Palace>
<Should_Build_Underworld_Vehicle_Factory>
18
*
(1.0 - clamp((Variable_Self.StructureCount {Parameter_Type = "U_Ground_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.0, 0.5))
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(Variable_Target.StructureCount {Parameter_Type = "U_Ground_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0})
+
(2.0 * (3.0 > Variable_Self.StructureCount {Parameter_Type = "U_Ground_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0}))
)
*
(3 > Variable_Target.StructureCount {Parameter_Type = "U_Ground_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0})
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
</Should_Build_Underworld_Vehicle_Factory>
<Should_Build_Underworld_Droid_Works>
18
*
(1.0 - clamp((Variable_Self.StructureCount {Parameter_Type = "U_Ground_Droid_Works", Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.0, 0.5))
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(Variable_Target.StructureCount {Parameter_Type = "U_Ground_Droid_Works", Parameter_Only_Consider_Complete = 1.0})
+
(3.0 * (3.0 > Variable_Self.StructureCount {Parameter_Type = "U_Ground_Droid_Works", Parameter_Only_Consider_Complete = 1.0}))
)
*
(2 > Variable_Target.StructureCount {Parameter_Type = "U_Ground_Droid_Works", Parameter_Only_Consider_Complete = 1.0})
*
(Function_Should_Underworld_Save_For_Desirable_Structures.Evaluate == 0.0)
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
</Should_Build_Underworld_Droid_Works>
<Should_Underworld_Save_For_Desirable_Structures>
(Variable_Target.GroundBaseLevelUnnormalized > 1.0)
*
(
(Function_Should_Build_Underworld_Vehicle_Factory.Evaluate > 15.0)
+
(Function_Should_Build_Underworld_Palace.Evaluate > 15.0)
)
</Should_Underworld_Save_For_Desirable_Structures>
<Should_Save_For_Corruption>
(Variable_Self.HasUnit {Parameter_Type = "Underworld_Saboteur"} == 0.0)
*
(0.67 > Game.PlanetsCorrupted)
*
(Variable_Self.StructureCount {Parameter_Type = "U_Ground_Palace", Parameter_Only_Consider_Complete = 1.0} > 1.0)
</Should_Save_For_Corruption>
<Should_Underworld_Build_Starbase>
(0.75 * Function_Needs_Starbase_Upgrade.Evaluate)
*
(Function_Should_Save_For_Corruption.Evaluate == 0.0)
</Should_Underworld_Build_Starbase>
</Equations>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0"?>
<Equations>
<Should_Mine_Structure>
(15.0
*
Variable_Target.Location.EnemyForce
+
8.0
*
Variable_Target.Location.IsFriendlyStartLocation
+
8.0
*
Variable_Self.IsDefender
+
8.0
*
Variable_Target.Force
+
15.0
*
Variable_Target.IsContestable)
*
0.33
*
(1 + 2 * Game.IsCampaignGame)
</Should_Mine_Structure>
<Should_Remote_Bomb_Friendly_Unit>
100.0
*
(0.4 > Variable_Target.Health)
*
Variable_Target.Location.EnemyForce
*
(1.0 - Variable_Target.Force)
</Should_Remote_Bomb_Friendly_Unit>
<Bribe_Target_Score>
500
*
(
clamp(Variable_Target.Force{Parameter_Attenuator = 1.0} - Variable_Target.Location.FriendlyForce, 0.01, 1.0)
-
Variable_Target.Force{Parameter_Category = GameObjectCategoryType[LandHero]}
-
Variable_Target.Force{Parameter_Category = GameObjectCategoryType[SpaceHero]}
)
</Bribe_Target_Score>
<Should_Build_Ysalamiri_Cage>
50.0
*
(Variable_Target.EnemyForce {Parameter_Type = "Emperor_Palpatine",
Parameter_Type = "Darth_Vader",
Parameter_Type = "Mara_Jade",
Parameter_Type = "Obi_Wan_Kenobi",
Parameter_Type = "Luke_Skywalker_Jedi",
Parameter_Type = "Yoda"} > 0.0)
*
Variable_Target.FriendlyForce
</Should_Build_Ysalamiri_Cage>
<!-- 50.0
*
(Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Structure]}
+
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]})-->
<Should_Build_Sensor_Scrambler>
40.0
*
(Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Structure]}
+
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]})
</Should_Build_Sensor_Scrambler>
<!-- 50.0
*
Variable_Target.EnemyForce
*
Variable_Target.FriendlyForce-->
<!--{Parameter_Category = GameObjectCategoryType[Air]}-->
<Should_Build_Rocket_Pod>
60.0
*
(Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Structure]}
+
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Vehicle]})
</Should_Build_Rocket_Pod>
<!-- FCU Landmode Items (Tried and failed. Kept basic stuff here in the event somebody figures this out...) -->
<!-- <Should_Build_FCU_U_Barracks>
100.0
</Should_Build_FCU_U_Barracks>
<Should_Build_FCU_U_Cantina>
100.0
</Should_Build_FCU_U_Cantina>
<Should_Build_FCU_U_Utility_Pad>
100.0
</Should_Build_FCU_U_Utility_Pad>
<Should_Build_FCU_U_Droid_Works>
100.0
</Should_Build_FCU_U_Droid_Works>
<Should_Build_FCU_U_Power_Gen>
100.0
</Should_Build_FCU_U_Power_Gen>
<Should_Build_FCU_U_Shield_Gen_370>
100.0
</Should_Build_FCU_U_Shield_Gen_370>
<Should_Build_FCU_U_Factory>
100.0
</Should_Build_FCU_U_Factory>
<Should_Build_FCU_U_Gravity_Gen>
100.0
</Should_Build_FCU_U_Gravity_Gen>
<Should_Build_FCU_U_Shield_Gen_740>
100.0
</Should_Build_FCU_U_Shield_Gen_740>
<Should_Build_FCU_U_Turbo_Tower>
100.0
</Should_Build_FCU_U_Turbo_Tower>-->
</Equations>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<Equations>
<Blast_Target_Score>
Variable_Target.Force {Parameter_Category = GameObjectCategoryType[Capital | Frigate]}
</Blast_Target_Score>
</Equations>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0"?>
<!--Equations that define perception functions-->
<Equations>
<!--Value planets based mostly on income and trade routes. Also consider structure and base capabilities-->
<GenericPlanetValue>
(15.0 * Variable_Target.BaseIncome +
1.0 * Variable_Target.MaxStructureSlots +
2.0 * Variable_Target.MaxGroundbaseLevel +
2.0 * Variable_Target.MaxStarbaseLevel +
10.0 * Variable_Target.TradeRoutes) / 30.0
</GenericPlanetValue>
<FriendlySpaceForceStrength>
Variable_Target.FriendlyForce.SpaceTotal
</FriendlySpaceForceStrength>
<FriendlyForceNearUnit>
Variable_Target.Location.FriendlyForce
</FriendlyForceNearUnit>
<Is_Home_Planet>
Variable_Target.Type.Token == Variable_Self.HomePlanet.Type.Token
</Is_Home_Planet>
<One>
1.0
</One>
<ReallySmall>
0.000000001
</ReallySmall>
<ReallyBig>
50.0
</ReallyBig>
<Medium>
25.0
</Medium>
<Medium_High>
35.0
</Medium_High>
<High>
40.0
</High>
<Zero>
0.0
</Zero>
<Is_Empire>
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
</Is_Empire>
<Is_Rebel>
Variable_Self.IsFaction {Parameter_Faction = "Rebel"}
</Is_Rebel>
<Is_Underworld>
Variable_Self.IsFaction {Parameter_Faction = "Underworld"}
</Is_Underworld>
<Is_Hutts>
Variable_Self.IsFaction {Parameter_Faction = "Hutts"}
</Is_Hutts>
<Is_Campaign>
Game.IsCampaignGame
</Is_Campaign>
</Equations>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,434 @@
<?xml version="1.0" ?>
<Equations>
<!--================== Budgeting for the Empire ==================-->
<!-- Fairly balanced with emphasis on offense -->
<!-- Information budget kept low since probe droids are cheap -->
<!-- Snowball budget - more money for offense as galactic domination comes closer -->
<BasicEmpireOffensiveBudgetAllocation>
5.0
+
(10.0 * Variable_Self.PlanetsControlled)
+
(6.0 * (1.0 - Function_Has_Enough_Space_Force_Globally.Evaluate))
</BasicEmpireOffensiveBudgetAllocation>
<!-- Defensive budget
We only care about land defenses if we have enough space forces
AND
SCALE if special structure defenses are needed
ADD baseline amount for tactical defense spending
-->
<BasicEmpireDefensiveBudgetAllocation>
Function_Has_Enough_Space_Force_Globally.Evaluate
*
(
8.0 * Function_Can_Build_Defensive_Structures.Evaluate * (1.0 - Function_Has_Enough_Defensive_Structures.Evaluate)
+
2.0
)
</BasicEmpireDefensiveBudgetAllocation>
<Can_Build_Defensive_Structures>
(
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
(Variable_Self.TechLevel >= 2) *
Variable_Self.HasGroundbaseOfLevel {Parameter_Level = 2, Parameter_Count = 1}
)
+
(
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Self.TechLevel >= 2) *
Variable_Self.HasGroundbaseOfLevel {Parameter_Level = 2, Parameter_Count = 1}
)
+
(
Variable_Self.IsFaction {Parameter_Faction = "Hutts"} *
(Variable_Self.TechLevel >= 2) *
Variable_Self.HasGroundbaseOfLevel {Parameter_Level = 2, Parameter_Count = 1}
)
>= 1
</Can_Build_Defensive_Structures>
<Defensive_Structure_Count>
Variable_Self.StructureCount { Parameter_Type = "E_Ground_Base_Shield_740"
,Parameter_Type = "R_Ground_Base_Shield_740"
,Parameter_Type = "H_Ground_Base_Shield_740"
,Parameter_Type = "E_Galactic_Turbolaser_Tower_Defenses"
,Parameter_Type = "R_Galactic_Turbolaser_Tower_Defenses"
,Parameter_Type = "H_Galactic_Turbolaser_Tower_Defenses"
,Parameter_Type = "Ground_Ion_Cannon"
,Parameter_Type = "Ground_Empire_Hypervelocity_Gun"
,Parameter_Type = "Ground_Hutts_Hypervelocity_Gun"
,Parameter_Type = "E_Ground_Magnepulse_Cannon"
,Parameter_Type = "Ground_Gravity_Generator"
}
</Defensive_Structure_Count>
<!-- Have we met the desired ratio of defensive structures to planets controlled?
-->
<Has_Enough_Defensive_Structures>
(0.3 - (Function_Defensive_Structure_Count.Evaluate / Variable_Self.PlanetsControlledUnnormalized ))
> 0.0
</Has_Enough_Defensive_Structures>
<!-- Increase with tech level: higher tech units mostly need high level bases.
Also increase with maintenance: bases prevent maintenance costs
Decrease as bases are maxed out.
Note that The Major Item funds are diverted to Infrastructure if we are unable to tech up but want to.
Infrastructure money should then be spent on upgrading the highest level starbase, lifting the dependency.
-->
<BasicEmpireInfrastructureBudgetAllocation>
1.1
*
(2 + 0.5 * (Variable_Self.TechLevel) - Variable_Self.MaxedStarbases - Variable_Self.MaxedGroundbases)
*
(1.0 + Variable_Self.Maintenance)
*
(1.0 + 2.0 * (0.5 > (Variable_Self.StructureCount {Parameter_Type = "Empire_Ground_Mining_Facility_GC", Parameter_Type = "Empire_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Empire_Mineral_Extractor_GC"} / Variable_Self.PlanetsControlledUnnormalized)))
+
6 * (1 - Function_Can_Build_Offensive_Space.Evaluate)
+
10 * Function_Need_Tech_Upgrade_Unblocked.Evaluate
+
10 * ((Variable_Self.HasStructure {Parameter_Type = "E_Ground_Light_Vehicle_Factory"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "E_Ground_Barracks"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Empire_Ground_Mining_Facility_GC"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Empire_Ground_Mining_Facility_GC_Unlim"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Empire_Mineral_Extractor_GC"} == 0))
</BasicEmpireInfrastructureBudgetAllocation>
<!-- Based on average age of scouted information -->
<BasicEmpireInformationBudgetAllocation>
0.5 * Function_Global_Scout_Need.Evaluate
</BasicEmpireInformationBudgetAllocation>
<!-- Receive a trickle of funds so that eventually, a major purchase is likely
Adjust this to control how soon the AI will spend on tech upgrades.
Scale this inversely with tech level and posession of the DeathStar (tech 6, in a sense)
This is needed because during middle and late game, we need more funds for special structures, etc.
Also, we don't want the AI to rush to max tech.
Shut off funds if we're trying to upgrade a base in order to tech
(the tech was already deemed affordable, and the reserve for it remains in the category)
Shut off funds if we're behind in the space race but not behind in the tech race
2.0 * Variable_Self.CanAdvanceTech
-->
<BasicEmpireMajorItemBudgetAllocation>
0.8
*
(7.0 - Variable_Self.TechLevel
- Variable_Self.HasUnit{Parameter_Type = "Death_Star_II"}
- Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Count = 1})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
clamp(Function_Has_Enough_Space_Force_Globally.Evaluate + (Game.Timeline > Variable_Self.TechLevel), 0.0, 1.0)
+
3.0 * (Variable_Self.TechLevel == 5) * (1 - Variable_Self.HasUnit{Parameter_Type = "Death_Star_II"})
</BasicEmpireMajorItemBudgetAllocation>
<!-- Tech Upgrade Purchasing Budgets -->
<!-- What fraction of the gross budget is required to support building the next tech item
without pause, plus a small pad to compansate for fluctuations in spending that
may occur before this perception can compensate.
add a buffer large enough to ensure that the upgrade can be afforded, despite cash spikes/drops
-->
<TechUpgradeBudgetRequirement>
(
(1 - Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Count = 1}) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "E_Ground_Research_Facility"}
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Count = 1} *
(Variable_Self.TechLevel == 1) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Primary_Hyperdrive"}
+
(Variable_Self.TechLevel == 2) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Shield_Gen"}
+
(Variable_Self.TechLevel == 3) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Superlaser_Core"}
+
(Variable_Self.TechLevel == 4) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Durasteel"}
+
(Variable_Self.TechLevel == 5) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "Death_Star_II"}
*
1.25
+
0.05
)
</TechUpgradeBudgetRequirement>
<!-- Tech Upgrade Template Budget -->
<EmpireTechUpgradeOffensiveAllocation>
0.01
+
(1.0 - Function_TechUpgradeBudgetRequirement.Evaluate)
*
0.3
</EmpireTechUpgradeOffensiveAllocation>
<EmpireTechUpgradeDefensiveAllocation>
(1.0 - Function_TechUpgradeBudgetRequirement.Evaluate)
*
0.3
*
Function_Can_Build_Defensive_Structures.Evaluate
</EmpireTechUpgradeDefensiveAllocation>
<!--
Variable_Self.CanAdvanceTech
*
-->
<EmpireTechUpgradeMajorItemAllocation>
Function_TechUpgradeBudgetRequirement.Evaluate
</EmpireTechUpgradeMajorItemAllocation>
<!--
(1.0 - Variable_Self.CanAdvanceTech) * Function_TechUpgradeBudgetRequirement.Evaluate
+
-->
<EmpireTechUpgradeInfrastructureAllocation>
(1.0 - Function_TechUpgradeBudgetRequirement.Evaluate)
*
0.2
</EmpireTechUpgradeInfrastructureAllocation>
<EmpireTechUpgradeInformationAllocation>
(1.0 - Function_TechUpgradeBudgetRequirement.Evaluate)
*
0.0
</EmpireTechUpgradeInformationAllocation>
<!--================== Budgeting for the Rebels ==================-->
<!-- Aggressive stance. Low defense and information -->
<!-- Snowball budget - more money for offense as galactic domination comes closer -->
<BasicRebelOffensiveBudgetAllocation>
7.2 + Variable_Self.PlanetsControlled
+
(6.0 * (1.0 - Function_Has_Enough_Space_Force_Globally.Evaluate))
</BasicRebelOffensiveBudgetAllocation>
<!-- Defensive budget increases with proportion of planets that are undefended -->
<BasicRebelDefensiveBudgetAllocation>
Function_Has_Enough_Space_Force_Globally.Evaluate
*
(
8.0 * Function_Can_Build_Defensive_Structures.Evaluate * (1.0 - Function_Has_Enough_Defensive_Structures.Evaluate)
+
2.0
)
</BasicRebelDefensiveBudgetAllocation>
<!-- Increase with tech level: higher tech units mostly need high level bases. -->
<!-- Also increase with low income -->
<!-- Decrease as bases are maxed out -->
<BasicRebelInfrastructureBudgetAllocation>
1.1
*
(2 + 0.5 * (Variable_Self.TechLevel) - Variable_Self.MaxedStarbases - Variable_Self.MaxedGroundbases)
*
(1.0 + Variable_Self.Maintenance)
*
(1.0 + 2.0 * (0.5 > (Variable_Self.StructureCount {Parameter_Type = "Rebel_Ground_Mining_Facility_GC", Parameter_Type = "Rebel_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Rebel_Mineral_Extractor_GC"} / Variable_Self.PlanetsControlledUnnormalized)))
+
10 * ((Variable_Self.HasStructure {Parameter_Type = "R_Ground_Light_Vehicle_Factory"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "R_Ground_Barracks"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Rebel_Ground_Mining_Facility_GC"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Rebel_Ground_Mining_Facility_GC_Unlim"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Rebel_Mineral_Extractor_GC"} == 0))
</BasicRebelInfrastructureBudgetAllocation>
<!-- Based on average age of scouted information -->
<BasicRebelInformationBudgetAllocation>
0.5 * Function_Global_Scout_Need.Evaluate
</BasicRebelInformationBudgetAllocation>
<!--================== Budgeting for the Hutt Cartel ==================-->
<!-- Fairly balanced with emphasis on offense -->
<!-- Information budget kept minimal -->
<!-- Snowball budget - more money for offense as galactic domination comes closer -->
<BasicHuttsOffensiveBudgetAllocation>
5.0
+
(10.0 * Variable_Self.PlanetsControlled)
+
(6.0 * (1.0 - Function_Has_Enough_Space_Force_Globally.Evaluate))
</BasicHuttsOffensiveBudgetAllocation>
<!-- Defensive budget
We only care about land defenses if we have enough space forces
AND
SCALE if special structure defenses are needed
ADD baseline amount for tactical defense spending
-->
<BasicHuttsDefensiveBudgetAllocation>
Function_Has_Enough_Space_Force_Globally.Evaluate
*
(
8.0 * Function_Can_Build_Defensive_Structures.Evaluate * (1.0 - Function_Has_Enough_Defensive_Structures.Evaluate)
+
3.0
)
</BasicHuttsDefensiveBudgetAllocation>
<!-- Increase with tech level: higher tech units mostly need high level bases.
Also increase with maintenance: bases prevent maintenance costs
Decrease as bases are maxed out.
Note that The Major Item funds are diverted to Infrastructure if we are unable to tech up but want to.
Infrastructure money should then be spent on upgrading the highest level starbase, lifting the dependency.
-->
<BasicHuttsInfrastructureBudgetAllocation>
1.1
*
(2 + 0.5 * (Variable_Self.TechLevel) - Variable_Self.MaxedStarbases - Variable_Self.MaxedGroundbases)
*
(1.0 + Variable_Self.Maintenance)
*
(1.0 + 2.0 * (0.5 > (Variable_Self.StructureCount {Parameter_Type = "Hutts_Ground_Mining_Facility_GC", Parameter_Type = "Hutts_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Hutts_Mineral_Extractor_GC"} / Variable_Self.PlanetsControlledUnnormalized)))
+
6 * (1 - Function_Can_Build_Offensive_Space.Evaluate)
+
10 * Function_Need_Tech_Upgrade_Unblocked.Evaluate
+
10 * ((Variable_Self.HasStructure {Parameter_Type = "H_Ground_Factory"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "H_Ground_Barracks"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Hutts_Ground_Mining_Facility_GC"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Hutts_Ground_Mining_Facility_GC_Unlim"} == 0) +
(Variable_Self.HasStructure {Parameter_Type = "Hutts_Mineral_Extractor_GC"} == 0))
</BasicHuttsInfrastructureBudgetAllocation>
<!-- Based on average age of scouted information -->
<BasicHuttsInformationBudgetAllocation>
0.3 * Function_Global_Scout_Need.Evaluate
</BasicHuttsInformationBudgetAllocation>
<!-- Receive a trickle of funds so that eventually, a major purchase is likely
Adjust this to control how soon the AI will spend on tech upgrades.
Scale this inversely with tech level and posession of the DeathStar (tech 6, in a sense)
This is needed because during middle and late game, we need more funds for special structures, etc.
Also, we don't want the AI to rush to max tech.
Shut off funds if we're trying to upgrade a base in order to tech
(the tech was already deemed affordable, and the reserve for it remains in the category)
Shut off funds if we're behind in the space race but not behind in the tech race
2.0 * Variable_Self.CanAdvanceTech
-->
<BasicHuttsMajorItemBudgetAllocation>
0.7
*
(7.0 - Variable_Self.TechLevel
- Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Count = 1})
*
clamp(Function_Has_Enough_Space_Force_Globally.Evaluate + (Game.Timeline > Variable_Self.TechLevel), 0.0, 1.0)
</BasicHuttsMajorItemBudgetAllocation>
<!-- Tech Upgrade Purchasing Budgets -->
<!-- What fraction of the gross budget is required to support building the next tech item
without pause, plus a small pad to compansate for fluctuations in spending that
may occur before this perception can compensate.
add a buffer large enough to ensure that the upgrade can be afforded, despite cash spikes/drops
-->
<HuttsTechUpgradeBudgetRequirement>
(
(1 - Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Count = 1}) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"}
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Count = 1} *
(Variable_Self.TechLevel == 1) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_2"}
+
(Variable_Self.TechLevel == 2) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_3"}
+
(Variable_Self.TechLevel == 3) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_4"}
+
(Variable_Self.TechLevel == 4) *
Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_5"}
*
1.25
+
0.05
)
</HuttsTechUpgradeBudgetRequirement>
<!-- Tech Upgrade Template Budget -->
<!-- Need to use static values for now. -->
<!-- HuttsTechUpgradeBudgetRequirement is not a valid perception token and will assert if used! -->
<HuttsTechUpgradeOffensiveAllocation>
0.4
</HuttsTechUpgradeOffensiveAllocation>
<!-- Zero is used instead -->
<HuttsTechUpgradeDefensiveAllocation>
0.3
</HuttsTechUpgradeDefensiveAllocation>
<HuttsTechUpgradeMajorItemAllocation>
0.25
</HuttsTechUpgradeMajorItemAllocation>
<HuttsTechUpgradeInfrastructureAllocation>
0.35
</HuttsTechUpgradeInfrastructureAllocation>
<!-- Zero is used instead -->
<HuttsTechUpgradeInformationAllocation>
0.1
</HuttsTechUpgradeInformationAllocation>
<GenericSpaceTargetedOffensiveBudgetAllocation>
Game.ForceVisibility
</GenericSpaceTargetedOffensiveBudgetAllocation>
<GenericSpaceDefensiveBudgetAllocation>
0.5
</GenericSpaceDefensiveBudgetAllocation>
<GenericSpaceUntargetedOffensiveBudgetAllocation>
1.0 - Game.ForceVisibility
</GenericSpaceUntargetedOffensiveBudgetAllocation>
<!-- Used to determine the funds to be spent from the galactic budget on a land tactical game.
We like to spend more on planets that are:
valuable
have a large ground force investment
have a large ground infrastructure investment
scale by a magic number
NOTE: we're not scaling by the number of open build pads, because if we can't build, the
over-allocated money simply wont be spent.
-->
<Land_Tactical_Budget>
(
1 * Function_GenericPlanetValue.Evaluate +
2 * Variable_Target.FriendlyForce.GroundTotal +
3 * Variable_Target.GroundbaseLevel
) / 5
* 2500
+
200
</Land_Tactical_Budget>
<Land_Tactical_Budget_Clamped>
clamp( Function_Land_Tactical_Budget.Evaluate,
0,
Variable_Self.CreditsUnnormalized / (Variable_Self.PlanetsControlled + 1)
)
</Land_Tactical_Budget_Clamped>
</Equations>

View File

@@ -0,0 +1,304 @@
<?xml version="1.0" ?>
<Equations>
<!-- High priority whenever a friendly planet has an enemy force in orbit
... consider how valuable this planet is
... and if we don't own much space, this is even more important
and don't use this coventional goal/plan on systems disconnected by one planet-->
<Needs_Blockade_Lifted>
(Variable_Target.EnemyForce.HasSpaceForce)
*
Function_First_Attack_Allowed.Evaluate
*
(Variable_Target.EnemyForce.SpaceTotalUnnormalized > 0)
*
(30 +
(10.0 * Function_GenericPlanetValue.Evaluate) +
(10.0 * Function_More_Planets_Needed.Evaluate))
*
((Function_Need_To_Reconnect_Islands.Evaluate == 0.0) +
Variable_Target.ConnectsLargestIslands)
*
(Variable_Target.TimeSinceSpaceConflict > Function_Blockade_Wait_Time.Evaluate)
</Needs_Blockade_Lifted>
<Blockade_Wait_Time>
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
* 90.0
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}
* 90.0
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}
* 20.0
</Blockade_Wait_Time>
<Has_Friendly_Ground_Force>
Variable_Target.FriendlyForce.HasGroundForce
</Has_Friendly_Ground_Force>
<!-- Is there space? -->
<!-- Are the groundbase and defensive force worth protecting? -->
<!-- Is the planet worth protecting -->
<Needs_Ground_Defensive_Structure>
5.0 *
Variable_Target.OpenStructureSlots *
Variable_Target.GroundbaseLevel *
Variable_Target.FriendlyForce.GroundTotalNBTD *
Function_DefensiveValue.Evaluate
</Needs_Ground_Defensive_Structure>
<!-- Is there space? -->
<!-- Are the starbase and defensive force worth protecting? -->
<!-- Is the planet worth protecting -->
<Needs_Space_Defensive_Structure>
5.0 *
Variable_Target.OpenStructureSlots *
Variable_Target.StarbaseLevel *
Variable_Target.FriendlyForce.SpaceTotalNBTD *
Function_DefensiveValue.Evaluate
</Needs_Space_Defensive_Structure>
<!-- Don't defend planets with enemy forces blockading (handled by Lift_Blockade) -->
<!-- How valuable is the planet? -->
<!-- How many trade routes do I also control the other end for? -->
<!-- How strong is the enemy around here? -->
<!-- Is this planet already well-defended -->
<DefensiveValue>
(1.0 - Variable_Target.EnemyForce.SpaceTotalNBTT) *
(Function_GenericPlanetValue.Evaluate +
Variable_Target.ActiveTradeRoutes +
Variable_Target.EnemyForce.NearbyGroundTotal + Variable_Target.EnemyForce.NearbySpaceTotal -
Variable_Target.FriendlyForce.GroundTotal - Variable_Target.FriendlyForce.SpaceTotal)
+
Variable_Target.Hints.Chokepoint
+
Variable_Target.Hints.PriorityTarget
</DefensiveValue>
<GroundDefensiveValue>
(Variable_Target.EnemyForce.HasSpaceForce == 0.0)
*
(1.1 - Variable_Target.FriendlyForce.GroundTotalNBTD)
*
(
5.0 * Variable_Target.Hints.Chokepoint
+
5.0 * Function_Is_Connected_To_Enemy.Evaluate
+
5.0 * (Variable_Target.FriendlyForce.HasGroundUnitsBitfield {Parameter_Type = "MON_MOTHMA", Parameter_Type = "Emperor_Palpatine"} > 0)
+
Function_Defense_Level.Evaluate
)
</GroundDefensiveValue>
<SpaceDefensiveValue>
(1.1 - Variable_Target.FriendlyForce.SpaceTotalNBTD)
*
(
5.0 * Variable_Target.Hints.Chokepoint
+
5.0 * Function_Is_Connected_To_Enemy.Evaluate
+
Function_Defense_Level.Evaluate
)
</SpaceDefensiveValue>
<Needs_Weapon>
2.0 * Variable_Target.StarbaseLevelUnnormalized
+
2.0 * Variable_Target.GroundbaseLevelUnnormalized
+
8.0 * Variable_Target.Hints.Chokepoint
+
2.0 * Function_DefensiveValue.Evaluate
+
8.0 * Function_Is_Connected_To_Enemy.Evaluate
+
Variable_Target.FriendlyForce.SpaceTotalUnnormalized / 5000.0
+
Variable_Target.FriendlyForce.GroundTotalUnnormalized / 2500.0
</Needs_Weapon>
<!-- Regular in base shield.
The desire to have a ground shield depends upon:
investment in ground base
bonus for defensive value (including chokepoint markup)
bonus for having force here
-->
<Needs_Base_Shield>
2.0 * Variable_Target.GroundbaseLevelUnnormalized
+
8.0 * Variable_Target.Hints.Chokepoint
+
2.0 * Function_DefensiveValue.Evaluate
+
8.0 * Function_Is_Connected_To_Enemy.Evaluate
+
Variable_Target.FriendlyForce.GroundTotalUnnormalized / 2500.0
</Needs_Base_Shield>
<!--
Just like the need for a shield, but add a flat modifier rather than a force dependent one
since turbolaser effectiveness isn't very dependent on other units being present.
-->
<Needs_Turbolasers>
2.0 * Variable_Target.GroundbaseLevelUnnormalized
+
8.0 * Variable_Target.Hints.Chokepoint
+
2.0 * Function_DefensiveValue.Evaluate
+
8.0 * Function_Is_Connected_To_Enemy.Evaluate
+
10.0
</Needs_Turbolasers>
<Needs_Jamming_Station>
Variable_Target.OpenStructureSlots
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(Function_Defense_Level.Evaluate > 5)
</Needs_Jamming_Station>
<Defense_Level>
Variable_Target.StarbaseLevelUnnormalized
+ Variable_Target.HasStructure {Parameter_Type = "E_Ground_Base_Shield_740", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "R_Ground_Base_Shield_740", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "H_Ground_Base_Shield_740", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "E_Galactic_Turbolaser_Tower_Defenses", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "R_Galactic_Turbolaser_Tower_Defenses", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "H_Galactic_Turbolaser_Tower_Defenses", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "Ground_Ion_Cannon", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "Ground_Empire_Hypervelocity_Gun", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "Ground_Hutts_Hypervelocity_Gun", Parameter_Count = 1}
+ Variable_Target.HasStructure {Parameter_Type = "E_Ground_Magnepulse_Cannon", Parameter_Count = 1}
</Defense_Level>
<Can_Park_Ground_Unit>
(Variable_Target.EnemyForce.HasSpaceForce == 0.0)
*
(Variable_Target.OpenGroundCompanySlots > 0)
*
Variable_Target.IsSurfaceAccessible
</Can_Park_Ground_Unit>
<Low_Ground_Defense_Score>
1.0 - Variable_Target.FriendlyForce.GroundTotalNBTD
</Low_Ground_Defense_Score>
<Low_Space_Defense_Score>
1.0 - Variable_Target.FriendlyForce.SpaceTotalNBTD
</Low_Space_Defense_Score>
<Ground_Priority_Defense_Score>
Variable_Target.Hints.Chokepoint
+
2.0 * Function_Is_Connected_To_Enemy.Evaluate
+
Variable_Target.HasStructure {Parameter_Type = "E_Ground_Base_Shield_740", Parameter_Type = "R_Ground_Base_Shield_740", Parameter_Type = "H_Ground_Base_Shield_740",
Parameter_Type = "E_Galactic_Turbolaser_Tower_Defenses", Parameter_Type = "R_Galactic_Turbolaser_Tower_Defenses", Parameter_Type = "H_Galactic_Turbolaser_Tower_Defenses",
Parameter_Type = "E_Ground_Magnepulse_Cannon", Parameter_Type = "Ground_Gravity_Generator"}
</Ground_Priority_Defense_Score>
<Space_Priority_Defense_Score>
Variable_Target.Hints.Chokepoint
+
2.0 * Function_Is_Connected_To_Enemy.Evaluate
+
Variable_Target.HasStructure {Parameter_Type = "Ground_Ion_Cannon", Parameter_Type = "Ground_Empire_Hypervelocity_Gun", Parameter_Type = "Ground_Hutts_Hypervelocity_Gun"}
</Space_Priority_Defense_Score>
<Friendly_Space_Unit_Raw_Total>
Variable_Target.FriendlyForce.SpaceTotalUnnormalized - Variable_Target.FriendlyForce.SpaceTotalUnnormalized {Parameter_Category = GameObjectCategoryType[SpaceHero]}
</Friendly_Space_Unit_Raw_Total>
<Friendly_Global_Space_Unit_Raw_Total>
Variable_Self.SpaceTotalUnnormalized - Variable_Self.SpaceTotalUnnormalized {Parameter_Category = GameObjectCategoryType[SpaceHero]}
</Friendly_Global_Space_Unit_Raw_Total>
<Friendly_Land_Unit_Raw_Total>
Variable_Target.FriendlyForce.GroundTotalUnnormalized - Variable_Target.FriendlyForce.GroundTotalUnnormalized {Parameter_Category = GameObjectCategoryType[LandHero]}
</Friendly_Land_Unit_Raw_Total>
<Friendly_Global_Land_Unit_Raw_Total>
Variable_Self.GroundTotalUnnormalized - Variable_Self.GroundTotalUnnormalized {Parameter_Category = GameObjectCategoryType[LandHero]}
</Friendly_Global_Land_Unit_Raw_Total>
<Enemy_Global_Space_Unit_Raw_Total>
Game.EnemyForce.SpaceTotalUnnormalized - Game.EnemyForce.SpaceTotalUnnormalized {Parameter_Category = GameObjectCategoryType[SpaceHero]}
</Enemy_Global_Space_Unit_Raw_Total>
<Enemy_Global_Land_Unit_Raw_Total>
Game.EnemyForce.GroundTotalUnnormalized - Game.EnemyForce.GroundTotalUnnormalized {Parameter_Category = GameObjectCategoryType[LandHero]}
</Enemy_Global_Land_Unit_Raw_Total>
<Needs_Magic_Ground_Defense>
(Variable_Target.OpenGroundCompanySlots > 6) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]} *
Variable_Target.IsSurfaceAccessible
</Needs_Magic_Ground_Defense>
<Needs_Magic_Space_Defense>
(3000 > Function_Friendly_Space_Unit_Raw_Total.Evaluate) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
(Variable_Target.EnemyForce.HasSpaceForce == 0.0) *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}
</Needs_Magic_Space_Defense>
<Needs_Magic_Ground_Defense_Easy>
(Variable_Target.OpenGroundCompanySlots > 7) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]} *
Variable_Target.IsSurfaceAccessible
</Needs_Magic_Ground_Defense_Easy>
<Needs_Magic_Space_Defense_Easy>
(2000 > Function_Friendly_Space_Unit_Raw_Total.Evaluate) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
(Variable_Target.EnemyForce.HasSpaceForce == 0.0) *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
</Needs_Magic_Space_Defense_Easy>
<Needs_Magic_Ground_Defense_Hard>
(Variable_Target.OpenGroundCompanySlots > 5) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]} *
Variable_Target.IsSurfaceAccessible
</Needs_Magic_Ground_Defense_Hard>
<Needs_Magic_Space_Defense_Hard>
(7000 > Function_Friendly_Space_Unit_Raw_Total.Evaluate) *
Function_Is_Connected_To_Enemy.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
(Variable_Target.EnemyForce.HasSpaceForce == 0.0) *
Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}
</Needs_Magic_Space_Defense_Hard>
<Needs_Magic_Ground_Structure>
Function_Is_Connected_To_Enemy.Evaluate *
(Variable_Target.OpenGroundCompanySlots > 0) *
(
(Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}) *
(Variable_Target.OpenStructureSlotsUnnormalized > 1) +
(Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}) *
(Variable_Target.OpenStructureSlotsUnnormalized > 2) +
(Variable_Self.IsDifficulty {Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}) *
(Variable_Target.OpenStructureSlotsUnnormalized > 3)
)
</Needs_Magic_Ground_Structure>
<Needs_Magic_Cash_Drop>
(Game.Age > 300)
*
(2000 > Variable_Self.CreditsUnnormalized)
*
(Function_Am_I_In_Winning_Position.Evaluate == 0.0)
</Needs_Magic_Cash_Drop>
</Equations>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" ?>
<Equations>
<!-- Any perception equations that are hero specific will go here -->
<!-- EMPIRE -->
<!-- When not in an active plan, Ackbar likes to sit on systems where he can add the most
defensive bonus or where he can apply his Calamari Cruiser Discount -->
<Park_Ackbar>
0.0
</Park_Ackbar>
<!-- When not in an active plan, Veers likes to sit on planets
which require high defense
bonus for being able to build walkers there
-->
<Park_Veers>
Function_GroundDefensiveValue.Evaluate
+
Variable_Target.GroundbaseLevelUnnormalized
</Park_Veers>
<!-- REBEL -->
</Equations>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" ?>
<Equations>
<!-- How good an invasion target is this planet? -->
<!-- Bonus for planets that divide my territory -->
<!-- Empire bonus for planets near Coruscant -->
<!-- Entire value modulated by how recently this planet was scouted -->
<Needs_Scouting>
(Function_Is_Good_Invasion_Target.Evaluate) *
Variable_Target.EnemyForce.GroundTotal.TimeLastSeen
</Needs_Scouting>
<!-- Non-pirate/neutral planets that need scouting -->
<Is_Good_Slice_Target>
(1.0 - Variable_Target.IsFaction {Parameter_Faction = "Pirates", Parameter_Faction = "Neutral"})
</Is_Good_Slice_Target>
<!-- Average age of scouting data -->
<Global_Scout_Need>
Variable_Self.AverageAgeOfSpaceIntelligence + Variable_Self.AverageAgeOfGroundIntelligence
</Global_Scout_Need>
<!-- Positive when average age of scouting data is above a fixed threshold -->
<Information_Is_Scarce>
Function_Global_Scout_Need.Evaluate > 1.0
</Information_Is_Scarce>
<!-- Don't delete me; I'm used in a story script.
-->
<Has_Mon_Mothma>
(
(Variable_Target.EnemyForce.HasSpaceUnitsBitfield {Parameter_Type = "Mon_Mothma"} != 0)
+
(Variable_Target.EnemyForce.HasGroundUnitsBitfield {Parameter_Type = "Mon_Mothma"} != 0)
)
> 0
</Has_Mon_Mothma>
</Equations>

View File

@@ -0,0 +1,894 @@
<?xml version="1.0" ?>
<Equations>
<!--
Do we have some structure here already
AND
Are we not maxed out
SCALE UP BY
Chokepoint status
Income
Distance from max potential base level
Need to reduce maintaince tax
-->
<Needs_Groundbase_Upgrade>
(Variable_Target.GroundbaseLevel > 0.0)
*
(Variable_Target.MaxGroundbaseLevel != Variable_Target.GroundbaseLevel)
*
(
4.0 * (Variable_Target.Hints.Chokepoint)
+
2.0 * Variable_Target.BaseIncomeNBTP
+
1.0 * (Variable_Target.MaxGroundbaseLevel - Variable_Target.GroundbaseLevel)
+
4.0 * Function_Is_Connected_To_Enemy.Evaluate
)
/
7.0
</Needs_Groundbase_Upgrade>
<!--
Bring this into line with ground base component building (since they share the infrastructure category)
AND
Do we already have an initial base (handled by another goal)
AND
Zero out desire when defending the home planet (template change isn't enough)
AND
Are we not already maxed out
AND
Scale by relative economic worth
AND EITHER
lift a tech upgrade purchase dependency OR offensive space production dependency
if this is a location with a ground research facility
OR
If we're badly blocked on space production
OR
If we don't need a tech upgrade dependency lifted, scale desire by:
if this is a chokepoint planet
by likely purchase needs (high tech can only be bought at high level bases)
by how far we are from maxing out base upgrades
UNUSED:
Require the starbase upgrade boost for unblocking tech to be on the highest level system.
*
(Variable_Target.StarbaseLevelUnnormalized == Variable_Self.MaxStarbaseLevelUnnormalized)
-->
<Needs_Starbase_Upgrade>
(Variable_Target.StarbaseLevel > 0.0)
*
(Variable_Target.MaxStarbaseLevel != Variable_Target.StarbaseLevel)
*
((Variable_Target.GroundbaseLevel > Variable_Target.StarbaseLevel) + (Variable_Target.MaxStarbaseLevel >= Variable_Target.MaxGroundbaseLevel))
*
(
15.0 * (1 - Function_Can_Build_Offensive_Space.Evaluate)
+
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
+
(1.0 - Function_Hutts_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(
10.0 * (Variable_Target.Hints.Chokepoint + Variable_Target.Hints.PriorityTarget)
+
10.0 * (Variable_Target.MaxStarbaseLevel - Variable_Target.StarbaseLevel)
+
5.0 * Function_Is_Connected_To_Enemy.Evaluate
+
2.0 * Function_Needs_Better_Buying_Capability_Space.Evaluate
)
)
</Needs_Starbase_Upgrade>
<!-- This desire is used by things that can improve STARBASE LEVEL.
does the Empire want to upgrade tech (including the death star)
and we're not at tech 5 yet
but we're unable
-->
<Need_Tech_Upgrade_Unblocked>
Function_Empire_Should_Upgrade_Tech.Evaluate
*
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility"}
*
(5.0 > Variable_Self.TechLevel)
*
(1.0 - Variable_Self.CanAdvanceTech)
</Need_Tech_Upgrade_Unblocked>
<Hutts_Need_Tech_Upgrade_Unblocked>
Function_Hutts_Should_Upgrade_Tech.Evaluate
*
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"}
*
(5.0 > Variable_Self.TechLevel)
*
(1.0 - Variable_Self.CanAdvanceTech)
</Hutts_Need_Tech_Upgrade_Unblocked>
<!-- Determine if this target planet needs to better assist production.
If we prefer having a higher ratio of level X starbases to this many planets controlled,
AND
This planet is level X-1
OR
...
-->
<Needs_Better_Buying_Capability_Space>
12 * ((0.60 - (Variable_Self.NumStarbaseOfLevel {Parameter_Level = 2} / Variable_Self.PlanetsControlledUnnormalized)) > 0) *
(Variable_Target.StarbaseLevelUnnormalized == 1.0)
+
10 * ((0.50 - (Variable_Self.NumStarbaseOfLevel {Parameter_Level = 3} / Variable_Self.PlanetsControlledUnnormalized)) > 0) *
(Variable_Target.StarbaseLevelUnnormalized == 2.0)
+
8 * ((0.40 - (Variable_Self.NumStarbaseOfLevel {Parameter_Level = 4} / Variable_Self.PlanetsControlledUnnormalized)) > 0) *
(Variable_Target.StarbaseLevelUnnormalized == 3.0)
+
6 * ((0.30 - (Variable_Self.NumStarbaseOfLevel {Parameter_Level = 5} / Variable_Self.PlanetsControlledUnnormalized)) > 0) *
(Variable_Target.StarbaseLevelUnnormalized == 4.0)
</Needs_Better_Buying_Capability_Space>
<!-- Currently, the Empire has steep requirements before it can build a single
offensive space unit.
-->
<Can_Build_Offensive_Space>
(Variable_Self.IsFaction {Parameter_Faction = "Rebel"})
+
(Variable_Self.IsFaction {Parameter_Faction = "Hutts"})
+
(Variable_Self.IsFaction {Parameter_Faction = "Empire"})
*
(
(Variable_Self.HasStarbaseOfLevel {Parameter_Level = 3, Parameter_Count = 1}
+
Variable_Self.HasStarbaseOfLevel {Parameter_Level = 2, Parameter_Count = 1} *
(Variable_Self.TechLevel >= 2))
>= 1
)
</Can_Build_Offensive_Space>
<!-- SCALE DOWN as we improve to the desired ratio of structures per planet
PLUS
Boost if we need to upgrade the base
-->
<Need_Light_Vehicle_Factory>
20 * clamp(0.5 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Light_Vehicle_Factory",
Parameter_Type = "R_Ground_Light_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.1, 0.5)
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(3.0 * Variable_Target.StructureCount {Parameter_Type = "E_Ground_Light_Vehicle_Factory",
Parameter_Type = "R_Ground_Light_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0})
)
*
(3 > Variable_Target.StructureCount {Parameter_Type = "E_Ground_Light_Vehicle_Factory",
Parameter_Type = "R_Ground_Light_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Need_Light_Vehicle_Factory>
<!-- Same kind of deal as vehicle factory -->
<Need_Barracks>
20 * clamp(0.5 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Barracks",
Parameter_Type = "R_Ground_Barracks",
Parameter_Type = "H_Ground_Barracks",
Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.1, 0.5)
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(3.0 * Variable_Target.StructureCount {Parameter_Type = "E_Ground_Barracks",
Parameter_Type = "R_Ground_Barracks",
Parameter_Type = "H_Ground_Barracks",
Parameter_Only_Consider_Complete = 1.0})
)
*
(2 > Variable_Target.StructureCount {Parameter_Type = "E_Ground_Barracks",
Parameter_Type = "R_Ground_Barracks",
Parameter_Type = "H_Ground_Barracks",
Parameter_Only_Consider_Complete = 1.0})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Need_Barracks>
<!-- SCALE DOWN as we improve to the desired ratio of structures per planet
PLUS
Boost if we need to upgrade the base
PLUS
Bonus for stacking
-->
<Need_Heavy_Vehicle_Factory>
(
25 * clamp(0.4 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "R_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.1, 0.4)
+
3 * Function_Needs_Groundbase_Upgrade.Evaluate
+
(5.0 * Variable_Target.StructureCount {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "R_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0})
)
*
(3 > Variable_Target.StructureCount {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "R_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "H_Ground_Factory",
Parameter_Only_Consider_Complete = 1.0})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
</Need_Heavy_Vehicle_Factory>
<!-- Provided we're the Empire faction
SCALE DOWN as we improve to the desired ratio of structures per planet
PLUS
Boost if we need to upgrade the base
PLUS
Bonus for stacking
-->
<Need_Advanced_Vehicle_Factory>
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
*
(
25 * clamp(0.4 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Advanced_Vehicle_Factory",
Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.1, 0.4)
+
5 * Function_Needs_Groundbase_Upgrade.Evaluate
+
(5.0 * Variable_Target.StructureCount {Parameter_Type = "E_Ground_Advanced_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0})
)
*
(3 > Variable_Target.StructureCount {Parameter_Type = "E_Ground_Advanced_Vehicle_Factory", Parameter_Only_Consider_Complete = 1.0})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
</Need_Advanced_Vehicle_Factory>
<!-- The first research facility is built via the MajorItem template purchase scheme
If we don't yet have a research facility
Use the home planet, if it can max the starbase at a decent level
otherwise, choose a planet with decent defenses that can max the starbase at a decent level
-->
<Need_First_Research_Facility>
(Variable_Self.IsFaction {Parameter_Faction = "Empire"}
*
(1 - Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Count = 1})
*
(
1
+
Function_Defense_Level.Evaluate
+
(Function_Is_Connected_To_Enemy.Evaluate == 0)
+
Function_Is_Home_Planet.Evaluate
+
Variable_Target.FriendlyForce.SpaceTotal
+
Variable_Target.FriendlyForce.GroundTotal
)
)
+
(Variable_Self.IsFaction {Parameter_Faction = "Hutts"}
*
(1 - Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Count = 1})
*
(
1
+
Function_Defense_Level.Evaluate
+
(Function_Is_Connected_To_Enemy.Evaluate == 0)
+
Function_Is_Home_Planet.Evaluate
+
Variable_Target.FriendlyForce.SpaceTotal
+
Variable_Target.FriendlyForce.GroundTotal
)
)
</Need_First_Research_Facility>
<!-- Subsequent research facilities are built under the Infrastructure budget according to this formula:
Provided we're the Empire faction
AND
We have enough planets to care about tech
SCALE DOWN as we improve to the desired number of structures
BIG BOOST if we have a high tech desire and no research facilities
SCALE UP if this planet has good defense
PLUS Boost if we need to upgrade the base
-->
<Need_Research_Facility>
(
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
*
(1 - Variable_Target.HasStructure {Parameter_Type = "E_Ground_Research_Facility"})
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(Variable_Target.MaxStarbaseLevel == 5)
*
(
20 * (1 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1.0} / 2))
+
10 * Function_Empire_Should_Upgrade_Tech.Evaluate *
(1 - Variable_Self.HasStructure {Parameter_Type = "E_Ground_Research_Facility", Parameter_Count = 1})
+
3 * Function_Defense_Level.Evaluate
+
3 * Function_Needs_Groundbase_Upgrade.Evaluate
)
)
+
(
Variable_Self.IsFaction {Parameter_Faction = "Hutts"}
*
(1 - Variable_Target.HasStructure {Parameter_Type = "H_Ground_Advanced_Technologies_Facility"})
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(Variable_Target.MaxStarbaseLevel == 5)
*
(
20 * (1 - (Variable_Self.StructureCount {Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1.0} / 2))
+
10 * Function_Hutts_Should_Upgrade_Tech.Evaluate *
(1 - Variable_Self.HasStructure {Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Count = 1})
+
3 * Function_Defense_Level.Evaluate
+
3 * Function_Needs_Groundbase_Upgrade.Evaluate
)
)
</Need_Research_Facility>
<!-- Flat, low desire
Boost if we need to upgrade the base
-->
<Need_Comm_Array>
(1 - Variable_Target.HasStructure {Parameter_Type = "H_Ground_Communications_Array"})
*
(
2
+
5 * clamp(Function_Needs_Groundbase_Upgrade.Evaluate, 0.0, 1.0)
)
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Need_Comm_Array>
<!--
Provided we have enough planets to care about officers
SCALE DOWN
as we improve to the desired number of structures
PLUS
Boost if we need to upgrade the base
-->
<Need_Officer_Academy>
40 * clamp(0.25 - (Variable_Self.StructureCount {Parameter_Type = "E_Ground_Officer_Academy",
Parameter_Type = "R_Ground_Officer_Academy",
Parameter_Only_Consider_Complete = 1.0} /
Variable_Self.PlanetsControlledUnnormalized), 0.05, 0.25)
*
(Variable_Self.PlanetsControlledUnnormalized > 4)
*
(
Function_Needs_Groundbase_Upgrade.Evaluate
+
(3 * Variable_Target.StructureCount {Parameter_Type = "E_Ground_Officer_Academy",
Parameter_Type = "R_Ground_Officer_Academy",
Parameter_Only_Consider_Complete = 1.0})
)
*
(2.0 > Variable_Target.StructureCount {Parameter_Type = "E_Ground_Officer_Academy",
Parameter_Type = "R_Ground_Officer_Academy",
Parameter_Only_Consider_Complete = 1.0})
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Need_Officer_Academy>
<!-- Determines whether the player owns a level 5 starbase
Only kicks in once planet ownership is above a threshold
*
(Variable_Self.PlanetsControlled >= 0.25)
-->
<No_Level_5_Starbase>
(Variable_Self.HasStarbaseOfLevel {Parameter_Level = 5, Parameter_Count = 1} == 0.0)
</No_Level_5_Starbase>
<!-- Does this planet have a starbase already? -->
<Needs_Initial_Starbase>
50.0 *
(1.0 - clamp(Variable_Self.PlanetsControlled - 0.33, 0.0, 1.0)) *
(Variable_Target.StarbaseLevel == 0.0) *
(Variable_Target.MaxStarbaseLevel > 0.0) *
(Variable_Target.EnemyForce.HasSpaceForce == 0)
</Needs_Initial_Starbase>
<!-- Does this planet have a groundbase already? This now builds a barracks.
High base desire
AND
Only needed if we don't yet have a groundbase
AND
Only needed if we can build a groundbase
AND
Wait until the starbase has been built, if one can be
-->
<Needs_Initial_Groundbase>
50.0
*
(1.0 - clamp(Variable_Self.PlanetsControlled - 0.33, 0.0, 1.0))
*
(Variable_Target.GroundbaseLevel == 0.0)
*
(Variable_Target.MaxGroundbaseLevel > 0)
*
((Variable_Target.StarbaseLevel > 0) + (Variable_Target.MaxStarbaseLevel == 0.0))
</Needs_Initial_Groundbase>
<!--
Build a cantina wherever we can provided we don't have tech constraints
Max 1 cantina per cantina supporting planet
-->
<Needs_Cantina>
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
(Variable_Target.StructureCount {Parameter_Type = "Ground_Cantina_E",
Parameter_Type = "Ground_Cantina_R",
Parameter_Only_Consider_Complete = 1.0} == 1.0)
*
50.0
</Needs_Cantina>
<!-- Desire to build a mine.
desirability is like arenas
PLUS
bonus for stacking mining facilities (effects are cumulative)
AND
Maximum four per planet
AND
Must have basic build facilities first
SoaFE: Removed
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
Otherwise AI doesn't like to build more than 1 Mining Facility per planet.
-->
<Needs_Mining_Facility>
(
(
30.0
*
(1.0 + Variable_Target.IncomeUnnormalized * Variable_Target.IncomeUnnormalized / 250000.0)
+
10 * (0.5 > (Variable_Self.StructureCount {Parameter_Type = "Empire_Ground_Mining_Facility_GC", Parameter_Type = "Empire_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Empire_Mineral_Extractor_GC", Parameter_Type = "Rebel_Ground_Mining_Facility_GC", Parameter_Type = "Rebel_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Rebel_Mineral_Extractor_GC", Parameter_Type = "Hutts_Ground_Mining_Facility_GC", Parameter_Type = "Hutts_Ground_Mining_Facility_GC_Unlim", Parameter_Type = "Hutt_Mineral_Extractor_GC", Parameter_Only_Consider_Complete = 1.0} / Variable_Self.PlanetsControlledUnnormalized))
)
*
clamp(Function_Defense_Level.Evaluate - 1, 0.0, 2.0)
*
((Variable_Target.MaxStructureSlotsUnnormalized / 2.0) > Variable_Target.StructureCount {Parameter_Type = "Empire_Ground_Mining_Facility_GC",
Parameter_Type = "Empire_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Empire_Mineral_Extractor_GC",
Parameter_Type = "Rebel_Ground_Mining_Facility_GC",
Parameter_Type = "Rebel_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Rebel_Mineral_Extractor_GC",
Parameter_Type = "Hutts_Ground_Mining_Facility_GC",
Parameter_Type = "Hutts_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Hutt_Mineral_Extractor_GC",
Parameter_Only_Consider_Complete = 1.0})
+
50.0
*
(Variable_Self.HasStructure {Parameter_Type = "Empire_Ground_Mining_Facility_GC",
Parameter_Type = "Empire_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Empire_Mineral_Extractor_GC",
Parameter_Type = "Rebel_Ground_Mining_Facility_GC",
Parameter_Type = "Rebel_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Rebel_Mineral_Extractor_GC",
Parameter_Type = "Hutts_Ground_Mining_Facility_GC",
Parameter_Type = "Hutts_Ground_Mining_Facility_GC_Unlim",
Parameter_Type = "Hutt_Mineral_Extractor_GC",
Parameter_Only_Consider_Complete = 1.0} == 0.0)
)
*
(0.33 + 0.67 * (Function_Is_Connected_To_Enemy.Evaluate == 0))
</Needs_Mining_Facility>
<!--
Is this a chokepoint planet
AND
Do we need info
AND
Do we have enough slots to afford one for a scanner
AND
Have we already addressed production bottleneck issues
-->
<Needs_Scanner>
Variable_Target.OpenStructureSlots
*
(Function_Defense_Level.Evaluate > 5)
*
(Variable_Target.Hints.Chokepoint != 0)
*
Function_Global_Scout_Need.Evaluate
*
(Variable_Target.MaxStructureSlotsUnnormalized >=2)
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(0 >= Function_Needs_Better_Buying_Capability_Space.Evaluate)
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Needs_Scanner>
<!--
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
-->
<Needs_Hutt_Palace>
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(1.0 - Function_Need_Tech_Upgrade_Unblocked.Evaluate)
*
50.0
</Needs_Hutt_Palace>
<!--
are we Rebels?
AND
Is the system reasonably defended
AND
make sure it's not a chokepoint system (would waste a slot there)
AND
scale by how many open slots we have
AND
We can't really use more than 2 total of this structure
AND
Have we already addressed production bottleneck issues
AND
Big Bonus if we have no structure of this type yet
-->
<Needs_Ground_Infiltrator_Facility>
(
5.0
*
(Variable_Self.IsFaction {Parameter_Faction = "Rebel"})
*
Function_Defense_Level.Evaluate
*
Function_Has_Enough_Bases_For_Tech.Evaluate
+
5.0 * Variable_Target.HasStructure {Parameter_Type = "Ground_Infiltrator_Facility"}
)
*
(2.0 > Variable_Target.StructureCount {Parameter_Type = "Ground_Infiltrator_Facility", Parameter_Only_Consider_Complete = 1.0})
*
(Function_Should_Save_For_Desirable_Structures.Evaluate == 0)
</Needs_Ground_Infiltrator_Facility>
<!--
Require at least a certain number of bases, so that unit production
won't be severly interrupted during tech production.
Edited to scale better with different galaxy sizes. Used to require a fixed number of bases.
More than one planet controlled
AND
More than 10% of the galaxy controlled
AND
More than 75% of owned planets have a level 1 starbase
AND
More than 75% of owned planets have a level 1 groundbase
AND
At least one level 3 starbase
-->
<Has_Enough_Bases_For_Tech>
(Variable_Self.PlanetsControlledUnnormalized > 1)
*
(Variable_Self.NumStarbaseOfLevel {Parameter_Level = 1} >= (0.75 * Variable_Self.PlanetsControlledUnnormalized))
*
(Variable_Self.NumGroundbaseOfLevel {Parameter_Level = 1} >= (0.25 * Variable_Self.PlanetsControlledUnnormalized))
</Has_Enough_Bases_For_Tech>
<!--
Are we the Empire
AND
We're not sure to win anyway
AND
Do we not yet have the Death Star
AND
Do we have enough bases to afford keeping a base tied up for a lengthy tech upgrade
AND
Is it possible to immediately purchase the next tech item without pause using only X% of the gross income
Or
Is it mostly already paid for by the MajorItem slush fund
UNUSED:
Scale with income relative to max possible income
Variable_Self.GrossIncomeNBTF
We haven't been attacked in a while OR
The enemy is ahead in tech OR -WAITING ON Enemy.TechLevel
We have enough systems that it couldn't hurt to have one tied up in tech OR
We're so far ahead in space forces that it can't hurt
Game.FriendlyForce.SpaceTotalUnnormalized - Game.EnemyForce.SpaceTotalUnnormalized
-->
<Empire_Should_Upgrade_Tech>
(Variable_Self.IsFaction {Parameter_Faction = "Empire"})
*
(1.0 - Variable_Self.HasUnit{Parameter_Type = "Death_Star_II", Parameter_Count = 1, Parameter_Only_Consider_Complete = 1.0})
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(
clamp(Function_Has_Enough_Space_Force_Globally.Evaluate +
(Game.Timeline > Variable_Self.TechLevel) * (Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility"}) ,
0.0, 1.0)
*
(
(1 - Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility"}) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "E_Ground_Research_Facility"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "E_Ground_Research_Facility", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility"} *
(Variable_Self.TechLevel == 1) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Primary_Hyperdrive"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Primary_Hyperdrive", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 2) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Shield_Gen"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Shield_Gen", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 3) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Superlaser_Core"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Superlaser_Core", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 4) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Durasteel"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Durasteel", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
)
+
(Variable_Self.TechLevel == 5) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Death_Star_II"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Death_Star_II", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
)
</Empire_Should_Upgrade_Tech>
<!-- Do we want to switch to the "tech up" template?
If we want to upgrade tech
AND
We need a research facility
OR
We're able to advance the tech level
OR
we're tech 5 and we want to buy the death star
-->
<Empire_Tech_Trigger>
Function_Empire_Should_Upgrade_Tech.Evaluate
*
(
(
(1 - Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility"})
+
Variable_Self.CanAdvanceTech
+
(Variable_Self.TechLevel == 5) * (1.0 - Variable_Self.HasUnit{Parameter_Type = "Death_Star_II"})
)
>= 1.0
)
</Empire_Tech_Trigger>
<!-- an untrigger for the tech template at a higher budgetFractionToBuild threshold,
because the template is having trouble sticking.
Untrigger if:
We're less than level 5 AND we already have a research facility AND we can't advance tech level
OR
We really can no longer afford to both pay for this item and maintain other activities
OR
We already have the Death Star
-->
<Empire_Tech_Untrigger>
(5 > Variable_Self.TechLevel) *
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(1.0 - Variable_Self.CanAdvanceTech)
+
(
(1 - Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1}) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "E_Ground_Research_Facility"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 1) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Primary_Hyperdrive"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 2) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Shield_Gen"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 3) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Superlaser_Core"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 4) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "DS_Durasteel"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "E_Ground_Research_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 5) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "Death_Star_II"} >= 0.80)
)
+
Variable_Self.HasUnit{Parameter_Type = "Death_Star_II", Parameter_Only_Consider_Complete = 1}
</Empire_Tech_Untrigger>
<!-- SoaFE Test -->
<Hutts_Should_Upgrade_Tech>
(Variable_Self.IsFaction {Parameter_Faction = "Hutts"})
*
Function_Has_Enough_Bases_For_Tech.Evaluate
*
(
clamp(Function_Has_Enough_Space_Force_Globally.Evaluate +
(Game.Timeline > Variable_Self.TechLevel) * (Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"}) ,
0.0, 1.0)
*
(
(1 - Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"}) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"} *
(Variable_Self.TechLevel == 1) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_2"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_2", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 2) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_3"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_3", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 3) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_4"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_4", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
+
(Variable_Self.TechLevel == 4) *
((0.7 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_5"}) +
(0.9 >= Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_5", Parameter_Category = AIGoalCategoryType[MajorItem]}) >= 1.0)
)
)
</Hutts_Should_Upgrade_Tech>
<!-- Do we want to switch to the "tech up" template?
If we want to upgrade tech
AND
We need a research facility
OR
We're able to advance the tech level -->
<Hutts_Tech_Trigger>
Function_Hutts_Should_Upgrade_Tech.Evaluate
*
(
(
(1 - Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"})
+
Variable_Self.CanAdvanceTech
)
>= 1.0
)
</Hutts_Tech_Trigger>
<!-- An untrigger for the tech template at a higher budgetFractionToBuild threshold,
because the template is having trouble sticking.
Untrigger if:
We're less than level 5 AND we already have a research facility AND we can't advance tech level
OR
We really can no longer afford to both pay for this item and maintain other activities-->
<Hutts_Tech_Untrigger>
(5 > Variable_Self.TechLevel) *
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1} *
(1.0 - Variable_Self.CanAdvanceTech)
+
(
(1 - Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1}) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "H_Ground_Advanced_Technologies_Facility"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 1) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_2"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 2) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_3"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 3) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_4"} >= 0.8)
+
Variable_Self.HasStructure{Parameter_Type = "H_Ground_Advanced_Technologies_Facility", Parameter_Only_Consider_Complete = 1} *
(Variable_Self.TechLevel == 4) *
(Variable_Self.BudgetFractionToBuild{Parameter_Type = "Hutt_Tech_5"} >= 0.8)
)
</Hutts_Tech_Untrigger>
<Can_Reclaim_Excess_MajorItem_Budget>
(Variable_Self.ActiveGoals {Parameter_Category = AIGoalCategoryType[MajorItem]} > 0)
</Can_Reclaim_Excess_MajorItem_Budget>
<Can_Afford_Steal_Tech>
(Variable_Self.CreditsUnnormalized > 1000)
*
((Variable_Self.NetIncomeUnnormalized > 500) + (Variable_Self.CreditsUnnormalized > 2500))
</Can_Afford_Steal_Tech>
<Should_Save_For_Desirable_Structures>
(Variable_Target.GroundBaseLevelUnnormalized > 1.0)
*
(
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory", Parameter_Type = "R_Ground_Heavy_Vehicle_Factory", Parameter_Type = "H_Ground_Factory"})
*
(Function_Need_Heavy_Vehicle_Factory.Evaluate > 10.0)
+
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Ground_Advanced_Vehicle_Factory"})
*
(Function_Need_Advanced_Vehicle_Factory.Evaluate > 10.0)
+
(Variable_Self.HasTechToProduce {Parameter_Type = "Ground_Empire_Hypervelocity_Gun", Parameter_Type = "Ground_Hutts_Hypervelocity_Gun", Parameter_Type = "Ground_Ion_Cannon"})
*
(Function_Needs_Weapon.Evaluate > 15.0)
+
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Ground_Base_Shield_740", Parameter_Type = "E_Ground_Base_Shield_740", Parameter_Type = "H_Ground_Base_Shield_740"})
*
(Function_Needs_Base_Shield.Evaluate > 15.0)
+
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Galactic_Turbolaser_Tower_Defenses", Parameter_Type = "R_Galactic_Turbolaser_Tower_Defenses", Parameter_Type = "H_Galactic_Turbolaser_Tower_Defenses"})
*
(Function_Needs_Turbolasers.Evaluate > 15.0)
)
</Should_Save_For_Desirable_Structures>
<Num_Planets_Controlled>
Variable_Self.PlanetsControlledUnnormalized
</Num_Planets_Controlled>
<Num_Enemy_Space_Territories>
Variable_Human.SpaceDefendedPlanets * Variable_Human.PlanetsControlledUnnormalized
</Num_Enemy_Space_Territories>
<Num_Enemy_Land_Territories>
Variable_Human.GroundDefendedPlanets * Variable_Human.PlanetsControlledUnnormalized
</Num_Enemy_Land_Territories>
<Enemy_Planets_Controlled>
Variable_Human.PlanetsControlledUnnormalized
</Enemy_Planets_Controlled>
</Equations>

View File

@@ -0,0 +1,386 @@
<?xml version="1.0" ?>
<Equations>
<Minor_Intervention_Value>
(0 # 1) *
(3 > Game.ActiveStoryGoalCount) *
Function_Are_Interventions_Allowed.Evaluate
</Minor_Intervention_Value>
<Major_Intervention_Value>
(1 # 10) *
Function_Are_Interventions_Allowed.Evaluate
</Major_Intervention_Value>
<Are_Interventions_Allowed>
(Game.Age > 99.0) *
(Game.TimeSinceStoryPopup > 120.0)
</Are_Interventions_Allowed>
<Are_Interventions_Disabled>
Game.InterventionsEnabled == 0.0
</Are_Interventions_Disabled>
<Is_Act_One>
Variable_Self.StoryTrigger {Parameter_Name = "ACT_ONE_BEGIN_NOTIFICATION"}
</Is_Act_One>
<Is_Act_Three>
Variable_Self.StoryTrigger {Parameter_Name = "ACT_THREE_BEGIN_NOTIFICATION"}
</Is_Act_Three>
<!--*********************************************************************************************************************-->
<Intervention_Trigger_Upgrade_Space_Station>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
clamp(Function_Intervention_Helper_Low_Tech_Space_Stations.Evaluate +
Function_Intervention_Helper_Space_Station_Shortage.Evaluate, 0.0, 1.0)
</Intervention_Trigger_Upgrade_Space_Station>
<Intervention_Trigger_Build_Space_Units>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.CreditsUnnormalized > (1.33 * Variable_Enemy.CreditsUnnormalized)) *
(Variable_Enemy.SpaceTotalUnnormalized > (1.33 * Variable_Self.SpaceTotalUnnormalized))
</Intervention_Trigger_Build_Space_Units>
<Intervention_Trigger_Build_Land_Units>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.CreditsUnnormalized > (1.33 * Variable_Enemy.CreditsUnnormalized)) *
(Variable_Enemy.GroundTotalUnnormalized > (1.33 * Variable_Self.GroundTotalUnnormalized))
</Intervention_Trigger_Build_Land_Units>
<Intervention_Trigger_Build_Light_Vehicle_Factories>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Ground_Light_Vehicle_Factory", Parameter_Type = "R_Ground_Light_Vehicle_Factory"}) *
(Variable_Self.SpaceTotalUnnormalized > (2.0 * Variable_Self.GroundTotalUnnormalized)) *
(Variable_Self.PlanetsControlledUnnormalized > (3.0 * Variable_Self.StructureCount {Parameter_Type = "E_Ground_Light_Vehicle_Factory", Parameter_Type = "R_Ground_Light_Vehicle_Factory"}))
</Intervention_Trigger_Build_Light_Vehicle_Factories>
<Intervention_Trigger_Build_Heavy_Vehicle_Factories>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.HasTechToProduce {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory", Parameter_Type = "R_Ground_Heavy_Vehicle_Factory"}) *
(Variable_Self.SpaceTotalUnnormalized > (2.0 * Variable_Self.GroundTotalUnnormalized)) *
(Variable_Self.PlanetsControlledUnnormalized > (4.0 * Variable_Self.StructureCount {Parameter_Type = "E_Ground_Heavy_Vehicle_Factory", Parameter_Type = "R_Ground_Heavy_Vehicle_Factory"}))
</Intervention_Trigger_Build_Heavy_Vehicle_Factories>
<Intervention_Trigger_Build_Ion_Cannons>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.PlanetsControlled > 0.25) *
(Variable_Self.HasTechToProduce {Parameter_Type = "Ground_Ion_Cannon"}) *
(Variable_Self.PlanetsControlledUnnormalized > (3 * Variable_Self.StructureCount {Parameter_Type = "Ground_Ion_Cannon"}))
</Intervention_Trigger_Build_Ion_Cannons>
<Intervention_Trigger_Accumulate_Credits>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(5000 > Variable_Self.CreditsUnnormalized) *
Script_PersistentNegativeIncome.Evaluate {Parameter_Script_Number = 100.0}
</Intervention_Trigger_Accumulate_Credits>
<Intervention_Trigger_Conquer_Pirate_Planet>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Pirates"}
</Intervention_Trigger_Conquer_Pirate_Planet>
<Intervention_Trigger_Scout>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
(Variable_Self.HasUnit {Parameter_Type = "Droids_Team"} + Variable_Self.IsFaction {Parameter_Faction = "Empire"}) *
Function_Intervention_Helper_Good_Scout_Target.Evaluate *
(Variable_Self.PlanetsControlledUnnormalized > 5) *
(Variable_Target.TimeSinceSpaceConflict > 60.0)
</Intervention_Trigger_Scout>
<Intervention_Trigger_Conquer_Enemy_Planet>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Function_Is_Connected_To_Me.Evaluate *
(Variable_Target.IsFaction {Parameter_Faction = "Pirates"} == 0.0) *
Function_GenericPlanetValue.Evaluate *
Function_Intervention_Helper_Am_I_In_Healthy_Position.Evaluate
</Intervention_Trigger_Conquer_Enemy_Planet>
<Intervention_Trigger_Credit_Windfall>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Major_Intervention_Value.Evaluate *
Function_Intervention_Helper_Am_I_In_Weak_Position.Evaluate *
((1000 * Variable_Self.TechLevel) > Variable_Self.CreditsUnnormalized)
</Intervention_Trigger_Credit_Windfall>
<Intervention_Trigger_Space_Unit_Windfall>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Major_Intervention_Value.Evaluate *
Function_Intervention_Helper_Am_I_In_Weak_Position.Evaluate *
(0.25 > Variable_Self.MaxedStarbases)
</Intervention_Trigger_Space_Unit_Windfall>
<Intervention_Trigger_Land_Unit_Windfall>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Major_Intervention_Value.Evaluate *
Function_Intervention_Helper_Am_I_In_Weak_Position.Evaluate *
(5 > Variable_Self.StructureCount {Parameter_Type = "R_Ground_Light_Vehicle_Factory",
Parameter_Type = "E_Ground_Light_Vehicle_Factory",
Parameter_Type = "R_Ground_Heavy_Vehicle_Factory",
Parameter_Type = "E_Ground_Heavy_Vehicle_Factory"})
</Intervention_Trigger_Land_Unit_Windfall>
<Intervention_Trigger_Planet_Windfall>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Major_Intervention_Value.Evaluate *
Function_Intervention_Helper_Am_I_In_Weak_Position.Evaluate *
(0.33 > Variable_Self.PlanetsControlled) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Planet_Windfall>
<Intervention_Trigger_Tech_Windfall>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Major_Intervention_Value.Evaluate *
(Variable_Enemy.TechLevel - Variable_Self.TechLevel - 1)
</Intervention_Trigger_Tech_Windfall>
<Intervention_Trigger_Indigenous_Revolt>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
Variable_Target.HasIndigenousUnits {Parameter_Type = "Ewok_Hunter",
Parameter_Type = "Gungan_Warrior",
Parameter_Type = "Wookie_Warrior",
Parameter_Type = "Jawa_Scout",
Parameter_Type = "Urban_Civilian_A"} *
(7000 > Variable_Target.EnemyForce.GroundTotalUnnormalized) *
(Variable_Target.EnemyForce.GroundTotalUnnormalized > 0)
</Intervention_Trigger_Indigenous_Revolt>
<Intervention_Trigger_Hunt_Capital_Ships>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team", Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Enemy.HasUnit {Parameter_Type = "Calamari_Cruiser", Parameter_Type = "Star_Destroyer", Parameter_Count = 5}
</Intervention_Trigger_Hunt_Capital_Ships>
<Intervention_Trigger_Rebel_Smuggler>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
Variable_Target.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.HasUnit {Parameter_Type = "Han_Solo_Team"} == 0) *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Rebel_Smuggler>
<Intervention_Trigger_Pirate_Ambush>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
</Intervention_Trigger_Pirate_Ambush>
<Intervention_Trigger_Vader_Favor>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
(Variable_Self.HasUnit {Parameter_Type = "Darth_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
Variable_Target.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Vader_Favor>
<Intervention_Trigger_Imperial_Traitor>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "DANTOOINE", Parameter_Type = "HOTH"}) *
Variable_Target.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Imperial_Traitor>
<Intervention_Trigger_Rebel_Sabotage>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
Variable_Target.IsFaction {Parameter_Faction = "Rebel"} *
Variable_Self.HasUnit {Parameter_Type = "Boba_Fett_Team"}
</Intervention_Trigger_Rebel_Sabotage>
<!-- Cutting missions that flip player planets -->
<!--<Intervention_Trigger_Rebel_Revolt>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
(Variable_Self.PlanetsControlledUnnormalized > 4) *
(Variable_Target.FriendlyForce.HasGroundUnitsBitfield {Parameter_Category = GameObjectCategoryType[Hero]} == 0) *
(Variable_Target.FriendlyForce.HasSpaceUnitsBitfield {Parameter_Category = GameObjectCategoryType[Hero]} == 0)
</Intervention_Trigger_Rebel_Revolt> -->
<Intervention_Trigger_Rebel_Revolt>
0.0
</Intervention_Trigger_Rebel_Revolt>
<!-- Cutting missions that flip player planets -->
<!--<Intervention_Trigger_Pirate_Defection>
(Variable_Self.HasUnit {Parameter_Type = "Grand_Moff_Tarkin_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Empire"} *
(Variable_Self.TechLevel >= 2)
</Intervention_Trigger_Pirate_Defection>-->
<Intervention_Trigger_Pirate_Defection>
0.0
</Intervention_Trigger_Pirate_Defection>
<!-- More cuts! We don't like this mission -->
<!--<Intervention_Trigger_Refugee_Escort>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Self.HasUnit {Parameter_Type = "Han_Solo_Team", Parameter_Type = "Droids_Team"})
</Intervention_Trigger_Refugee_Escort>-->
<Intervention_Trigger_Refugee_Escort>
0.0
</Intervention_Trigger_Refugee_Escort>
<Intervention_Trigger_Confront_Boba>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(Variable_Enemy.HasUnit {Parameter_Type = "Boba_Fett_Team"} == 0) *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Confront_Boba>
<Intervention_Trigger_Pirate_Rescue>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Pirate_Rescue>
<Intervention_Trigger_Pirate_Enlightenment>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Target.FriendlyForce.HasSpaceForce == 0)
</Intervention_Trigger_Pirate_Enlightenment>
<Intervention_Trigger_Pirate_Enlightenment_b>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Target.FriendlyForce.HasSpaceForce == 0)
</Intervention_Trigger_Pirate_Enlightenment_b>
<!-- Disabling this mission, since I can't come up with a way to make it bugfree -->
<!-- <Intervention_Trigger_Show_of_Strength>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.PlanetsControlledUnnormalized > 1)
</Intervention_Trigger_Show_of_Strength> -->
<Intervention_Trigger_Show_Of_Strength>
0.0
</Intervention_Trigger_Show_Of_Strength>
<Intervention_Trigger_Fleet_Rescue>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"} *
(Variable_Enemy.PlanetsControlledUnnormalized > 2) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Trigger_Fleet_Rescue>
<Intervention_Trigger_Empire_Oppression>
(Variable_Self.HasUnit {Parameter_Type = "Mon_Mothma_Team"}) *
Function_Minor_Intervention_Value.Evaluate *
Variable_Target.IsFaction {Parameter_Faction = "Empire"} *
(125.0 > Variable_Target.TimeSinceConversion) *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"}
</Intervention_Trigger_Empire_Oppression>
<!--*********************************************************************************************************************-->
<Intervention_Helper_Ion_Cannons_To_Build>
(1 # clamp((Variable_Self.PlanetsControlledUnnormalized - Variable_Self.StructureCount {Parameter_Type = "Ground_Ion_Cannon"}), 1.0, 4.0))
</Intervention_Helper_Ion_Cannons_To_Build>
<Intervention_Helper_Has_Ion_Cannon>
Variable_Target.HasStructure {Parameter_Type = "Ground_Ion_Cannon"}
</Intervention_Helper_Has_Ion_Cannon>
<Intervention_Helper_Light_Vehicle_Factories_To_Build>
(1 # clamp((Variable_Self.PlanetsControlledUnnormalized - Variable_Self.StructureCount {Parameter_Type = "R_Ground_Light_Vehicle_Factory", Parameter_Type = "E_Ground_Light_Vehicle_Factory"}), 1.0, 3.0))
</Intervention_Helper_Light_Vehicle_Factories_To_Build>
<Intervention_Helper_Has_Light_Vehicle_Factory>
Variable_Target.HasStructure {Parameter_Type = "R_Ground_Light_Vehicle_Factory", Parameter_Type = "E_Ground_Light_Vehicle_Factory"}
</Intervention_Helper_Has_Light_Vehicle_Factory>
<Intervention_Helper_Heavy_Vehicle_Factories_To_Build>
(1 # clamp((Variable_Self.PlanetsControlledUnnormalized - Variable_Self.StructureCount {Parameter_Type = "R_Ground_Heavy_Vehicle_Factory", Parameter_Type = "E_Ground_Heavy_Vehicle_Factory"}), 1.0, 2.0))
</Intervention_Helper_Heavy_Vehicle_Factories_To_Build>
<Intervention_Helper_Has_Heavy_Vehicle_Factory>
Variable_Target.HasStructure {Parameter_Type = "R_Ground_Heavy_Vehicle_Factory", Parameter_Type = "E_Ground_Heavy_Vehicle_Factory"}
</Intervention_Helper_Has_Heavy_Vehicle_Factory>
<Intervention_Helper_Low_Tech_Space_Stations>
(Variable_Self.PlanetsControlled > 0.33) *
(0.33 > Variable_Self.MaxedStarbases) *
(Variable_Self.CreditsUnnormalized > 10000) *
(Variable_Target.MaxStarbaseLevel > Variable_Target.StarbaseLevel)
</Intervention_Helper_Low_Tech_Space_Stations>
<Intervention_Helper_Space_Station_Shortage>
(Variable_Self.PlanetsControlledUnnormalized > (2.5 * Variable_Self.NumStarbaseOfLevel {Parameter_Level = 1})) *
(Variable_Target.StarbaseLevel == 0) *
(Variable_Target.MaxStarbaseLevel > 0)
</Intervention_Helper_Space_Station_Shortage>
<Intervention_Helper_Good_Scout_Target>
(Variable_Target.FriendlyForce.HasSpaceForce == 0.0) *
(Variable_Target.FriendlyForce.HasGroundForce == 0.0) *
Function_Is_Connected_To_Me.Evaluate
</Intervention_Helper_Good_Scout_Target>
<Intervention_Helper_Am_I_In_Healthy_Position>
(Variable_Self.PlanetsControlled > 0.33) *
(Variable_Self.SpaceTotalUnnormalized > (0.75 * Variable_Enemy.SpaceTotalUnnormalized)) *
(Variable_Self.GroundTotalUnnormalized > (0.75 * Variable_Enemy.GroundTotalUnnormalized)) *
(Variable_Self.CreditsUnnormalized > 10000)
</Intervention_Helper_Am_I_In_Healthy_Position>
<Intervention_Helper_Am_I_In_Weak_Position>
0.5 *
(Variable_Enemy.PlanetsControlled > 0.5) *
((Variable_Enemy.SpaceTotalUnnormalized > Variable_Self.SpaceTotalUnnormalized) +
(Variable_Enemy.GroundTotalUnnormalized > Variable_Self.GroundTotalUnnormalized))
</Intervention_Helper_Am_I_In_Weak_Position>
<Intervention_Helper_Weakly_Defended_Space>
1.0 - Variable_Target.FriendlyForce.SpaceTotal
</Intervention_Helper_Weakly_Defended_Space>
</Equations>

View File

@@ -0,0 +1,532 @@
<?xml version="1.0" ?>
<Equations>
<!-- See if the target system is connected to a system owned by whatever faction I am.
-->
<Is_Connected_To_Me>
Variable_Target.IsConnectedTo {Parameter_Faction = "Empire", Parameter_Attenuator = 0.0} *
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
+
Variable_Target.IsConnectedTo {Parameter_Faction = "Rebel", Parameter_Attenuator = 0.0} *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"}
+
Variable_Target.IsConnectedTo {Parameter_Faction = "Underworld", Parameter_Attenuator = 0.0} *
Variable_Self.IsFaction {Parameter_Faction = "Underworld"}
+
Variable_Target.IsConnectedTo {Parameter_Faction = "Hutts", Parameter_Attenuator = 0.0} *
Variable_Self.IsFaction {Parameter_Faction = "Hutts"}
</Is_Connected_To_Me>
<!-- See if the target system is connected to a system owned by the AI faction's enemy
-->
<Is_Connected_To_Enemy>
((Variable_Target.IsConnectedTo {Parameter_Faction = "Rebel", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Hutts", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Underworld", Parameter_Attenuator = 0.0}) *
Variable_Self.IsFaction {Parameter_Faction = "Empire"}
+
(Variable_Target.IsConnectedTo {Parameter_Faction = "Empire", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Hutts", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Underworld", Parameter_Attenuator = 0.0}) *
Variable_Self.IsFaction {Parameter_Faction = "Rebel"}
+
(Variable_Target.IsConnectedTo {Parameter_Faction = "Empire", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Rebel", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Underworld", Parameter_Attenuator = 0.0}) *
Variable_Self.IsFaction {Parameter_Faction = "Hutts"}
+
(Variable_Target.IsConnectedTo {Parameter_Faction = "Rebel", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Hutts", Parameter_Attenuator = 0.0} +
Variable_Target.IsConnectedTo {Parameter_Faction = "Empire", Parameter_Attenuator = 0.0}) *
Variable_Self.IsFaction {Parameter_Faction = "Underworld"}) > 0.0
</Is_Connected_To_Enemy>
<!-- Normalizing time since forces were seen relative to 60 seconds
returning 1.0 means we just got recon, 0.0 means recon is older than 60 seconds (and probably useless)
OLD NORMALIZED BY TOTAL TIME OF UNIVERSE VERSION:
0.5 * (1.0 - Variable_Target.EnemyForce.SpaceTotal.TimeLastSeen + 1.0 - Variable_Target.EnemyForce.GroundTotal.TimeLastSeen)
-->
<System_Recon_Relevance>
0.5 * (1.0 - (Variable_Target.EnemyForce.SpaceTotal.TimeLastSeenUnnormalized > 60.0)) * (60.0 - Variable_Target.EnemyForce.SpaceTotal.TimeLastSeenUnnormalized) / 60.0
+
0.5 * (1.0 - (Variable_Target.EnemyForce.GroundTotal.TimeLastSeenUnnormalized > 60.0)) * (60.0 - Variable_Target.EnemyForce.GroundTotal.TimeLastSeenUnnormalized) / 60.0
</System_Recon_Relevance>
<Recent_Conversion>
(1.0 - (Variable_Target.TimeSinceConversion > 60.0)) * (60.0 - Variable_Target.TimeSinceConversion) / 60.0
</Recent_Conversion>
<Recent_Conflict_Space>
(1.0 - (Variable_Target.TimeSinceGroundConflict > 60.0)) * (60.0 - Variable_Target.TimeSinceGroundConflict) / 60.0
</Recent_Conflict_Space>
<Recent_Conflict_Ground>
(1.0 - (Variable_Target.TimeSinceConversion > 60.0)) * (60.0 - Variable_Target.TimeSinceConversion) / 60.0
</Recent_Conflict_Ground>
<!-- This perception seeks to detect situations where our non-pirate opponent has neglected to reinforce a system.
Use this to respond to the enemy amassing all of their forces in one or few systems.
-->
<Is_Neglected_By_My_Opponent_Space>
Variable_Target.IsHumanControlled
*
((Variable_Target.EnemyForce.HasSpaceForce + Variable_Target.EnemyForce.HasGroundForce) > 0)
*
(1.0 - Variable_Target.EnemyForce.SpaceTotalNBPTM)
</Is_Neglected_By_My_Opponent_Space>
<Is_Neglected_By_My_Opponent_Ground>
Variable_Target.IsHumanControlled
*
(((Variable_Target.EnemyForce.HasSpaceForce {Parameter_Faction = "Rebel", Parameter_Faction = "Empire", Parameter_Faction = "Underworld", Parameter_Faction = "Hutts"})
+ (Variable_Target.EnemyForce.HasGroundForce {Parameter_Faction = "Rebel", Parameter_Faction = "Empire", Parameter_Faction = "Underworld", Parameter_Faction = "Hutts"})) > 0)
*
(1.0 - Variable_Target.EnemyForce.GroundTotalNBPTM)
</Is_Neglected_By_My_Opponent_Ground>
<!-- the AI just always wants to be building offensive units if it can afford it. Just tune
this number so that high desirability conquer plans will win and cause production, but low desirability conquer plans
will eventually get the forces they need, via build_forces.
(1.0 - (Function_Need_Tech_Upgrade_Unblocked.Evaluate * Function_Has_Enough_Space_Force_Globally.Evaluate))
-->
<Global_Offensive_Need_Space>
(1.0 - Function_Has_Enough_Space_Force_Globally.Evaluate)
*
3.0
</Global_Offensive_Need_Space>
<Allow_Blind_Ground_Production>
(
0.5
*
(Variable_Self.CreditsUnnormalized >= 2000)
+
0.5
*
(Function_Enemy_Global_Land_Unit_Raw_Total.Evaluate > (1.33 * Function_Friendly_Global_Land_Unit_Raw_Total.Evaluate))
+
0.5
*
(Function_Enemy_Global_Land_Unit_Raw_Total.Evaluate > (0.9 * Function_Friendly_Global_Land_Unit_Raw_Total.Evaluate))
)
*
(3.0 > Function_Allow_Blind_Space_Production.Evaluate)
*
(Script_AnyFreeLandSlots.Evaluate)
</Allow_Blind_Ground_Production>
<Allow_Blind_Space_Production>
1.0
*
(Variable_Self.CreditsUnnormalized >= 2000)
+
(Function_Enemy_Global_Space_Unit_Raw_Total.Evaluate > (1.33 * Function_Friendly_Global_Space_Unit_Raw_Total.Evaluate))
+
(Function_Enemy_Global_Space_Unit_Raw_Total.Evaluate > (0.9 * Function_Friendly_Global_Space_Unit_Raw_Total.Evaluate))
</Allow_Blind_Space_Production>
<!-- Determine if we'd like to invade this system.
Choose unoccupied systems first (weighed by how current our info is)
factor in systems that my non-pirate opponent has neglected to defended
factor in connected systems (the enemy_destination reachability already considers this, but this equation is also used for scouting needs)
factor in planets which would connect islands of ownership (all targets are 0 if there is only one island of ownership)
and add weight for having trade routes
factor in systems with high offensive value
bonus for chokepoint hints
bonus for targets which have been marked up by script (as on the path to a juicy target) if the player has started to attack us
dislike pirate systems under some circumstances (don't zero out desire entirely, because we want to expand through pirates toward the player)
-->
<Is_Good_Invasion_Target>
15.0 * (Variable_Target.EnemyForce.HasGroundForce == 0.0) * (Variable_Target.EnemyForce.HasSpaceForce == 0.0) * (Function_System_Recon_Relevance.Evaluate)
+
5.0 * Function_Is_Neglected_By_My_Opponent_Space.Evaluate
+
8.0 * Function_GenericPlanetValue.Evaluate
+
5.0 * Variable_Target.Hints.Chokepoint
+
2.0 * Variable_Target.ConnectsIsolatedPlanetsByForce
+
3.0 * Variable_Target.TradeRoutes
+
Variable_Target.Markup
+
Variable_Target.Hints.PriorityTarget
-
5.0 * (Function_Is_AI_And_Should_Be_Ignored.Evaluate)
-
(5.0 + 5.0 * Variable_Self.AnyCurrentThreats) * Function_Opens_New_Front.Evaluate
+
(10.0 * Variable_Self.IsFaction {Parameter_Faction = "UNDERWORLD"} * (Variable_Target.IsConnectedToCorruption *
(Function_Is_Connected_To_Me.Evaluate == 0.0) -
Variable_Target.IsCorrupted))
</Is_Good_Invasion_Target>
<!-- We don't want to waste effort on AI systems under some circumstances.
Is this an AI system
AND
Do we not have have enough Space forces to spare spending some on AI
AND
Do we have any current threats (by being adjacent to systems with a human player presence)
OR
Would attacking this system put us adjacent to the human player
-->
<Is_AI_And_Should_Be_Ignored>
(Variable_Target.IsHumanControlled == 0.0)
*
(Function_Space_Contrast.Evaluate > (Game.FriendlyForce.SpaceTotalUnnormalized / 1.5))
*
Function_Needs_More_Space_Force_Globally.Evaluate
*
Variable_Self.AnyCurrentThreats
</Is_AI_And_Should_Be_Ignored>
<!-- Does the system have a human presence
AND
Is it connected to a system owned by the AI
-->
<Is_Target_A_Current_Threat>
Variable_Target.IsHumanControlled
*
Variable_Target.EnemyForce.HasSpaceForce
*
Function_Is_Connected_To_Me.Evaluate
</Is_Target_A_Current_Threat>
<!-- This perception will cause directed force buildup, so that plans where we can't meet minimum contrast,
given the goal definition, will eventually become feasable.
If this target's total space contrast is more than X% our total (non-base) space contrast
OR
If this target's total ground contrast is more than X% our total (non-base) ground contrast
... then we should be building forces that can apply to that target's forces
-->
<Needs_Targetted_Build_Forces>
(Function_Space_Contrast.Evaluate > (Game.FriendlyForce.SpaceTotalUnnormalized / 4.0))
+
(Function_Ground_Contrast.Evaluate > (Game.FriendlyForce.GroundTotalUnnormalized / 4.0))
>=
1.0
</Needs_Targetted_Build_Forces>
<!-- This perception is used to determine if we can no longer afford to trickle money into the MajorItem budget
If we don't have at least X% the space force of all of our enemies (including pirates)
-->
<Needs_More_Space_Force_Globally>
(Variable_Human.SpaceTotalUnnormalized > (Variable_Self.SpaceTotalUnnormalized * 1.0))
</Needs_More_Space_Force_Globally>
<!-- Don't trickle to Major Item fund if:
we Need better Space Offense forces
OR
we've already bought the death star
-->
<Need_To_Flush_MajorItem_Budget>
Function_Needs_More_Space_Force_Globally.Evaluate
+
Variable_Self.HasUnit{Parameter_Type = "Death_Star_II", Parameter_Count = 1}
</Need_To_Flush_MajorItem_Budget>
<!-- The AI can afford to spend on tech if it has X% space force over the human player
8/16/05 - reduced the amount by which AI has to be winning
-->
<Has_Enough_Space_Force_Globally>
(0.9 * Function_Friendly_Global_Space_Unit_Raw_Total.Evaluate) > Function_Enemy_Global_Space_Unit_Raw_Total.Evaluate
</Has_Enough_Space_Force_Globally>
<!-- How valuable is the planet? -->
<!-- Bonus for planets we haven't visited recently -->
<!-- Bonus for planets that don't have a smuggler already attached -->
<!-- Bonus for planets with high political control -->
<!-- Can't weaken neutral/pirate planets -->
<!-- Don't bother if my income is high (might as well just conquer)
*
(1.0 - (Variable_Self.GrossIncomeNBPTM > 0.33))
-->
<Is_Good_Weaken_Target>
0.5 *
(Function_GenericPlanetValue.Evaluate +
Variable_Target.EnemyForce.SpaceTotal.TimeLastSeen +
(1.0 - Variable_Target.HasCreditSiphon) +
Variable_Target.TargetPoliticalControl) *
Variable_Target.IsHumanControlled
</Is_Good_Weaken_Target>
<!-- Can't have multiple smugglers on a target -->
<!-- Don't steal when I might get caught -->
<Suitable_Smuggler_Target>
(1.0 - Variable_Target.HasCreditSiphon) *
(1.0 - Variable_Target.EnemyForce.AntiStealthEffectiveness)
</Suitable_Smuggler_Target>
<Needs_Smuggler_Removed>
Variable_Target.HasCreditSiphon
</Needs_Smuggler_Removed>
<!-- Desire to perform a basic blind space assault
Make sure there is a space force (otherwise a simple Ground Grab will take care of it)
AND SCALE BY
base invasion worth PLUS bonus to prevent this from going negative
bonus for having no ground force (should be a quick win for Fast Expansion)
-->
<Is_Good_Space_Sweep_Target>
Variable_Target.EnemyForce.HasSpaceForce
*
(
Function_Is_Good_Invasion_Target.Evaluate + 30.0
+
5.0 * (Variable_Target.EnemyForce.HasGroundForce == 0.0)
)
</Is_Good_Space_Sweep_Target>
<!-- Desire to perform a basic ground assult
Make sure there's no starbase
AND
no space force
AND SCALE BY
base invasion worth PLUS bonus to prevent this from going negative
bonus for having no ground force (should be a quick win for Fast Expansion)
-->
<Is_Good_Ground_Grab_Target>
(Variable_Target.StarbaseLevel == 0.0)
*
(1.0 - Variable_Target.EnemyForce.HasSpaceForce)
*
(
Function_Is_Good_Invasion_Target.Evaluate + 30.0
+
5.0 * (Variable_Target.EnemyForce.HasGroundForce == 0.0)
)
</Is_Good_Ground_Grab_Target>
<More_Planets_Needed>
(1.0 - (Variable_Self.PlanetsControlled >= 0.20))
</More_Planets_Needed>
<Self_Present>
(Variable_Target.TargetPoliticalControl +
Variable_Target.FriendlyForce.HasSpaceForce +
Variable_Target.FriendlyForce.HasGroundForce)
</Self_Present>
<Enemy_Present>
Variable_Target.IsHumanControlled
*
((Variable_Target.EnemyForce.HasSpaceForce + Variable_Target.EnemyForce.HasGroundForce) > 0.0)
</Enemy_Present>
<!-- Do I have enough planets to start thinking about going after my true opponent? -->
<!-- Is the planet valuable? -->
<!-- Favor weak planets -->
<!-- Exclude pirate/neutral planets -->
<Is_Good_Harry_Target>
1.75 *
Function_Is_Good_Invasion_Target.Evaluate *
Variable_Target.IsHumanControlled
</Is_Good_Harry_Target>
<Almost_Won>
Variable_Self.PlanetsControlled >= 0.66
</Almost_Won>
<!-- Of the two largest blocks of controlled planets that are not connected to each other,
does the smaller have at least X% of the number of planets the larger has? I.e, are a significant chunk of the AI's
planets stranded from the main force?
-->
<Forces_Are_Significantly_Divided>
Variable_Self.WorstIslandFractionOfLargest >= 0.2
</Forces_Are_Significantly_Divided>
<!--
Does this planet represent the connecting node between two islands of forces?
AND
Add X to the baseline invasion desire, so that we choose this custom goal over the standard
AND
Scale desirability by how many planets are stranded from the largest island so that
we'll add up to another X points of desire if we're split in half (less for smaller fragments)
UNUSED
bonus if this is a chokepoint planet
*
(1.0 + Variable_Target.Hints.Chokepoint)
-->
<Need_To_Reconnect_Islands>
Variable_Target.ConnectsLargestIslands
*
Function_First_Attack_Allowed.Evaluate
*
(
5.0
+
clamp(Function_Is_Good_Invasion_Target.Evaluate, 0.0, 5.0)
+
5.0 * Variable_Target.ConnectsIsolatedPlanetsByForce
+
(10.0 * Variable_Self.WorstIslandFractionOfLargest)
)
</Need_To_Reconnect_Islands>
<Space_Contrast>
Variable_Target.EnemyForce.SpaceTotalUnnormalized + Variable_Target.EnemyForce.StarbaseTotalUnnormalized
</Space_Contrast>
<Ground_Contrast>
Variable_Target.EnemyForce.GroundTotalUnnormalized + Variable_Target.EnemyForce.GroundbaseTotalUnnormalized
</Ground_Contrast>
<Am_I_In_Winning_Position>
(Game.Age > 300.0)
*
(Variable_Self.PlanetsControlledUnnormalized > (2.0 * Variable_Human.PlanetsControlled))
*
(Variable_Self.SpaceTotalUnnormalized > (3.0 * Variable_Human.SpaceTotalUnnormalized))
*
(Variable_Self.GroundTotalUnnormalized > (3.0 * Variable_Human.GroundTotalUnnormalized))
</Am_I_In_Winning_Position>
<!-- Same basic concept as whether I should conquer a planet
Factor so that in general normal conquest takes precedence over raid (since it has higher expected success rate)
HOWEVER if the planet is close to empty then raid should be the preferred conquest mechanic
Must be raid capable faction
Target must have accessible surface
-->
<Is_Good_Raid_Target>
(0.5 + (1000 >= Variable_Target.EnemyForce.GroundTotalUnnormalized))
*
Variable_Self.IsFaction {Parameter_Faction = "REBEL"} *
Function_Is_Good_Invasion_Target.Evaluate *
Variable_Target.IsSurfaceAccessible *
Variable_Target.IsHumanControlled *
Function_First_Attack_Allowed.Evaluate
</Is_Good_Raid_Target>
<Opens_New_Front>
(Variable_Target.IsHumanControlled == 0.0) *
Function_Is_Connected_To_Enemy.Evaluate
</Opens_New_Front>
<Should_Conquer_Pirate_Planet>
Function_Is_Good_Invasion_Target.Evaluate
*
(Variable_Target.IsHumanControlled == 0.0)
</Should_Conquer_Pirate_Planet>
<Should_Conquer_Opponent_Planet>
(
1.25
*
Function_Is_Good_Invasion_Target.Evaluate
*
Variable_Target.IsHumanControlled
*
((Variable_Self.HasUnit {Parameter_Type = "DEATH_STAR_II"} == 0.0)
+
(Function_Want_To_Fire_DS.Evaluate == 0.0))
)
*
Function_First_Attack_Allowed.Evaluate
*
(1.0 - Function_Should_Perform_Unrestricted_Grab_Space.Evaluate)
</Should_Conquer_Opponent_Planet>
<!-- fire the DS on any system unless taking it over is a cake walk -->
<Want_To_Fire_DS>
50.0
*
Function_First_Attack_Allowed.Evaluate
*
(Variable_Target.EnemyForce.GroundTotalUnnormalized > 1500)
*
Variable_Target.IsHumanControlled
</Want_To_Fire_DS>
<First_Attack_Allowed>
Game.Age > Function_Initial_Grace_Period.Evaluate
</First_Attack_Allowed>
<Initial_Grace_Period>
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
* (300.0 + (10.0 * Variable_Self.PlanetsControlledUnnormalized))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}
* (200.0 + (7.0 * Variable_Self.PlanetsControlledUnnormalized))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}
* (50.0 + (2.0 * Variable_Self.PlanetsControlledUnnormalized))
</Initial_Grace_Period>
<Should_Perform_Unrestricted_Grab_Space>
50.0
*
Function_First_Attack_Allowed.Evaluate
*
(Function_Space_Force_Limit_For_Unrestricted_Grab.Evaluate >= Variable_Target.EnemyForce.SpaceTotalUnnormalized)
*
(3 > Variable_Target.StarbaseLevelUnnormalized)
*
Function_Is_Connected_To_Me.Evaluate
*
(1.0 - Variable_Target.FriendlyForce.HasSpaceForce)
*
Variable_Target.IsHumanControlled
</Should_Perform_Unrestricted_Grab_Space>
<Should_Perform_Unrestricted_Grab_Land>
50.0
*
Function_First_Attack_Allowed.Evaluate
*
(Function_Ground_Force_Limit_For_Unrestricted_Grab.Evaluate >= Variable_Target.EnemyForce.GroundTotalUnnormalized)
*
Function_Is_Connected_To_Me.Evaluate
*
Variable_Target.IsSurfaceAccessible
*
(Variable_Target.StarbaseLevel == 0.0)
*
(1.0 - Variable_Target.EnemyForce.HasSpaceForce)
*
Variable_Target.IsHumanControlled
</Should_Perform_Unrestricted_Grab_Land>
<Space_Force_Limit_For_Unrestricted_Grab>
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
* (2000.0 + (100.0 * Variable_Human.TechLevel))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}
* (2500.0 + (250.0 * Variable_Human.TechLevel))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}
* (5000.0 + (1000.0 * Variable_Human.TechLevel))
</Space_Force_Limit_For_Unrestricted_Grab>
<Ground_Force_Limit_For_Unrestricted_Grab>
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
* (200.0 + (20.0 * Variable_Human.TechLevel))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Normal]}
* (400.0 + (40.0 * Variable_Human.TechLevel))
+
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Hard]}
* (800.0 + (80.0 * Variable_Human.TechLevel))
</Ground_Force_Limit_For_Unrestricted_Grab>
<Should_Shutdown_Offense_For_Story_Campaign>
Game.IsStoryCampaign
*
Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]}
*
(5 > Variable_Human.PlanetsControlledUnnormalized)
</Should_Shutdown_Offense_For_Story_Campaign>
</Equations>

View File

@@ -0,0 +1,907 @@
<?xml version="1.0" ?>
<Equations>
<!-- Have to do it this way because Starbases are category mask "Capital" and not structure.
Finding Capitol, will get Destroyers as well, which are not a base.-->
<Distance_To_Nearest_Friendly_Starbase>
Variable_Target.DistanceToNearestFriendly {
Parameter_Type = "Rebel_Star_Base_1", Parameter_Type = "Rebel_Star_Base_2", Parameter_Type = "Rebel_Star_Base_3", Parameter_Type = "Rebel_Star_Base_4", Parameter_Type = "Rebel_Star_Base_5",
Parameter_Type = "Empire_Star_Base_1", Parameter_Type = "Empire_Star_Base_2", Parameter_Type = "Empire_Star_Base_3", Parameter_Type = "Empire_Star_Base_4", Parameter_Type = "Empire_Star_Base_5",
Parameter_Type = "Underworld_Star_Base_1", Parameter_Type = "Underworld_Star_Base_2", Parameter_Type = "Underworld_Star_Base_3", Parameter_Type = "Underworld_Star_Base_4", Parameter_Type = "Underworld_Star_Base_5",
Parameter_Type = "Hutt_Asteroid_Base_1", Parameter_Type = "Hutt_Asteroid_Base_2", Parameter_Type = "Hutt_Asteroid_Base_3", Parameter_Type = "Hutt_Asteroid_Base_4", Parameter_Type = "Hutt_Asteroid_Base_5",
Parameter_Type = "Skirmish_Rebel_Star_Base_1", Parameter_Type = "Skirmish_Rebel_Star_Base_2", Parameter_Type = "Skirmish_Rebel_Star_Base_3", Parameter_Type = "Skirmish_Rebel_Star_Base_4", Parameter_Type = "Skirmish_Rebel_Star_Base_5",
Parameter_Type = "Skirmish_Empire_Star_Base_1", Parameter_Type = "Skirmish_Empire_Star_Base_2", Parameter_Type = "Skirmish_Empire_Star_Base_3", Parameter_Type = "Skirmish_Empire_Star_Base_4", Parameter_Type = "Skirmish_Empire_Star_Base_5", Parameter_Type = "Skirmish_Empire_Star_Base_5_Beam",
Parameter_Type = "Skirmish_Underworld_Star_Base_1", Parameter_Type = "Skirmish_Underworld_Star_Base_2", Parameter_Type = "Skirmish_Underworld_Star_Base_3", Parameter_Type = "Skirmish_Underworld_Star_Base_4", Parameter_Type = "Skirmish_Underworld_Star_Base_5",
Parameter_Type = "Skirmish_Hutt_Base_1", Parameter_Type = "Skirmish_Hutt_Base_2", Parameter_Type = "Skirmish_Hutt_Base_3", Parameter_Type = "Skirmish_Hutt_Base_4", Parameter_Type = "Skirmish_Hutt_Base_5",
Parameter_Type = "Tournament_Rebel_Star_Base_1", Parameter_Type = "Tournament_Rebel_Star_Base_2", Parameter_Type = "Tournament_Rebel_Star_Base_3", Parameter_Type = "Tournament_Rebel_Star_Base_4", Parameter_Type = "Tournament_Rebel_Star_Base_5",
Parameter_Type = "Tournament_Empire_Star_Base_1", Parameter_Type = "Tournament_Empire_Star_Base_2", Parameter_Type = "Tournament_Empire_Star_Base_3", Parameter_Type = "Tournament_Empire_Star_Base_4", Parameter_Type = "Tournament_Empire_Star_Base_5", Parameter_Type = "Tournament_Empire_Star_Base_5_Beam",
Parameter_Type = "Tournament_Underworld_Star_Base_1", Parameter_Type = "Tournament_Underworld_Star_Base_2", Parameter_Type = "Tournament_Underworld_Star_Base_3", Parameter_Type = "Tournament_Underworld_Star_Base_4", Parameter_Type = "Tournament_Underworld_Star_Base_5",
Parameter_Type = "Tournament_Hutt_Base_1", Parameter_Type = "Tournament_Hutt_Base_2", Parameter_Type = "Tournament_Hutt_Base_3", Parameter_Type = "Tournament_Hutt_Base_4", Parameter_Type = "Tournament_Hutt_Base_5",
Parameter_Type = "Hutt_Asteroid_Base", Parameter_Type = "Pirate_Asteroid_Base"
}
</Distance_To_Nearest_Friendly_Starbase>
<Distance_To_Nearest_Enemy_Starbase>
Variable_Target.DistanceToNearestEnemy {
Parameter_Type = "Rebel_Star_Base_1", Parameter_Type = "Rebel_Star_Base_2", Parameter_Type = "Rebel_Star_Base_3", Parameter_Type = "Rebel_Star_Base_4", Parameter_Type = "Rebel_Star_Base_5",
Parameter_Type = "Empire_Star_Base_1", Parameter_Type = "Empire_Star_Base_2", Parameter_Type = "Empire_Star_Base_3", Parameter_Type = "Empire_Star_Base_4", Parameter_Type = "Empire_Star_Base_5",
Parameter_Type = "Underworld_Star_Base_1", Parameter_Type = "Underworld_Star_Base_2", Parameter_Type = "Underworld_Star_Base_3", Parameter_Type = "Underworld_Star_Base_4", Parameter_Type = "Underworld_Star_Base_5",
Parameter_Type = "Hutt_Asteroid_Base_1", Parameter_Type = "Hutt_Asteroid_Base_2", Parameter_Type = "Hutt_Asteroid_Base_3", Parameter_Type = "Hutt_Asteroid_Base_4", Parameter_Type = "Hutt_Asteroid_Base_5",
Parameter_Type = "Skirmish_Rebel_Star_Base_1", Parameter_Type = "Skirmish_Rebel_Star_Base_2", Parameter_Type = "Skirmish_Rebel_Star_Base_3", Parameter_Type = "Skirmish_Rebel_Star_Base_4", Parameter_Type = "Skirmish_Rebel_Star_Base_5",
Parameter_Type = "Skirmish_Empire_Star_Base_1", Parameter_Type = "Skirmish_Empire_Star_Base_2", Parameter_Type = "Skirmish_Empire_Star_Base_3", Parameter_Type = "Skirmish_Empire_Star_Base_4", Parameter_Type = "Skirmish_Empire_Star_Base_5", Parameter_Type = "Skirmish_Empire_Star_Base_5_Beam",
Parameter_Type = "Skirmish_Underworld_Star_Base_1", Parameter_Type = "Skirmish_Underworld_Star_Base_2", Parameter_Type = "Skirmish_Underworld_Star_Base_3", Parameter_Type = "Skirmish_Underworld_Star_Base_4", Parameter_Type = "Skirmish_Underworld_Star_Base_5",
Parameter_Type = "Skirmish_Hutt_Base_1", Parameter_Type = "Skirmish_Hutt_Base_2", Parameter_Type = "Skirmish_Hutt_Base_3", Parameter_Type = "Skirmish_Hutt_Base_4", Parameter_Type = "Skirmish_Hutt_Base_5",
Parameter_Type = "Tournament_Rebel_Star_Base_1", Parameter_Type = "Tournament_Rebel_Star_Base_2", Parameter_Type = "Tournament_Rebel_Star_Base_3", Parameter_Type = "Tournament_Rebel_Star_Base_4", Parameter_Type = "Tournament_Rebel_Star_Base_5",
Parameter_Type = "Tournament_Empire_Star_Base_1", Parameter_Type = "Tournament_Empire_Star_Base_2", Parameter_Type = "Tournament_Empire_Star_Base_3", Parameter_Type = "Tournament_Empire_Star_Base_4", Parameter_Type = "Tournament_Empire_Star_Base_5", Parameter_Type = "Tournament_Empire_Star_Base_5_Beam",
Parameter_Type = "Tournament_Underworld_Star_Base_1", Parameter_Type = "Tournament_Underworld_Star_Base_2", Parameter_Type = "Tournament_Underworld_Star_Base_3", Parameter_Type = "Tournament_Underworld_Star_Base_4", Parameter_Type = "Tournament_Underworld_Star_Base_5",
Parameter_Type = "Tournament_Hutt_Base_1", Parameter_Type = "Tournament_Hutt_Base_2", Parameter_Type = "Tournament_Hutt_Base_3", Parameter_Type = "Tournament_Hutt_Base_4", Parameter_Type = "Tournament_Hutt_Base_5",
Parameter_Type = "Hutt_Asteroid_Base", Parameter_Type = "Pirate_Asteroid_Base"
}
</Distance_To_Nearest_Enemy_Starbase>
<Is_Starbase>
Variable_Target.Type.IsType {
Parameter_Type = "Rebel_Star_Base_1", Parameter_Type = "Rebel_Star_Base_2", Parameter_Type = "Rebel_Star_Base_3", Parameter_Type = "Rebel_Star_Base_4", Parameter_Type = "Rebel_Star_Base_5",
Parameter_Type = "Empire_Star_Base_1", Parameter_Type = "Empire_Star_Base_2", Parameter_Type = "Empire_Star_Base_3", Parameter_Type = "Empire_Star_Base_4", Parameter_Type = "Empire_Star_Base_5",
Parameter_Type = "Underworld_Star_Base_1", Parameter_Type = "Underworld_Star_Base_2", Parameter_Type = "Underworld_Star_Base_3", Parameter_Type = "Underworld_Star_Base_4", Parameter_Type = "Underworld_Star_Base_5",
Parameter_Type = "Hutt_Asteroid_Base_1", Parameter_Type = "Hutt_Asteroid_Base_2", Parameter_Type = "Hutt_Asteroid_Base_3", Parameter_Type = "Hutt_Asteroid_Base_4", Parameter_Type = "Hutt_Asteroid_Base_5",
Parameter_Type = "Skirmish_Rebel_Star_Base_1", Parameter_Type = "Skirmish_Rebel_Star_Base_2", Parameter_Type = "Skirmish_Rebel_Star_Base_3", Parameter_Type = "Skirmish_Rebel_Star_Base_4", Parameter_Type = "Skirmish_Rebel_Star_Base_5",
Parameter_Type = "Skirmish_Empire_Star_Base_1", Parameter_Type = "Skirmish_Empire_Star_Base_2", Parameter_Type = "Skirmish_Empire_Star_Base_3", Parameter_Type = "Skirmish_Empire_Star_Base_4", Parameter_Type = "Skirmish_Empire_Star_Base_5", Parameter_Type = "Skirmish_Empire_Star_Base_5_Beam",
Parameter_Type = "Skirmish_Underworld_Star_Base_1", Parameter_Type = "Skirmish_Underworld_Star_Base_2", Parameter_Type = "Skirmish_Underworld_Star_Base_3", Parameter_Type = "Skirmish_Underworld_Star_Base_4", Parameter_Type = "Skirmish_Underworld_Star_Base_5",
Parameter_Type = "Skirmish_Hutt_Base_1", Parameter_Type = "Skirmish_Hutt_Base_2", Parameter_Type = "Skirmish_Hutt_Base_3", Parameter_Type = "Skirmish_Hutt_Base_4", Parameter_Type = "Skirmish_Hutt_Base_5",
Parameter_Type = "Tournament_Rebel_Star_Base_1", Parameter_Type = "Tournament_Rebel_Star_Base_2", Parameter_Type = "Tournament_Rebel_Star_Base_3", Parameter_Type = "Tournament_Rebel_Star_Base_4", Parameter_Type = "Tournament_Rebel_Star_Base_5",
Parameter_Type = "Tournament_Empire_Star_Base_1", Parameter_Type = "Tournament_Empire_Star_Base_2", Parameter_Type = "Tournament_Empire_Star_Base_3", Parameter_Type = "Tournament_Empire_Star_Base_4", Parameter_Type = "Tournament_Empire_Star_Base_5", Parameter_Type = "Tournament_Empire_Star_Base_5_Beam",
Parameter_Type = "Tournament_Underworld_Star_Base_1", Parameter_Type = "Tournament_Underworld_Star_Base_2", Parameter_Type = "Tournament_Underworld_Star_Base_3", Parameter_Type = "Tournament_Underworld_Star_Base_4", Parameter_Type = "Tournament_Underworld_Star_Base_5",
Parameter_Type = "Tournament_Hutt_Base_1", Parameter_Type = "Tournament_Hutt_Base_2", Parameter_Type = "Tournament_Hutt_Base_3", Parameter_Type = "Tournament_Hutt_Base_4", Parameter_Type = "Tournament_Hutt_Base_5",
Parameter_Type = "Hutt_Asteroid_Base", Parameter_Type = "Pirate_Asteroid_Base"
}
</Is_Starbase>
<!-- Certain plans are disallowed as a defender. These plans are allowed if
It's a skirmish game
OR
It's a campaign game
AND
Offense time delay is over
AND
We're the attacker
OR
We're the defender without a space station
OR
We're the defender with a space station
AND
We have units to spare
OR the target is close enough to the starbase (Capital is the base itself, Structure is any other friendly structures)
UNUSED PARTS
*
(Script_EvaluateInGalacticContext.Evaluate{Parameter_Script_String = "Offense_Delay_Space_Expired"})
-->
<Allowed_As_Defender_Space>
(Game.IsCampaignGame == 0)
+
(Game.IsCampaignGame == 1)
*
(
(1 - Variable_Self.IsDefender)
+
(Variable_Self.IsDefender) * (Variable_Self.BaseLevel == 0)
+
(Variable_Self.IsDefender) * (Variable_Self.BaseLevel > 0) *
(
(
(Variable_Self.FriendlyForce {Parameter_Category = GameObjectCategoryType[Fighter | Bomber | Corvette]}
>= (3.0 * Variable_Self.EnemyForce))
+
(1800 > Function_Distance_To_Nearest_Friendly_Starbase.Evaluate)
)
> 0
)
> 0
)
</Allowed_As_Defender_Space>
<!-- unused and doesn't work
<Offense_Delay_Space_Expired>
Game.Age > Variable_Target.Hints.OffenseDelaySpace
</Offense_Delay_Space_Expired>
-->
<!-- Defending units generally like to be in uncrowded areas near their starbase
UNUSED
(Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Capital]} > 0)
-->
<Is_Empty_Zone_Near_Base>
Variable_Self.IsDefender
*
(2000 > Function_Distance_To_Nearest_Friendly_Starbase.Evaluate)
*
(1 - Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Fighter | Bomber | Corvette]})
</Is_Empty_Zone_Near_Base>
<Should_Return_To_Base>
Game.IsCampaignGame * Function_Is_Empty_Zone_Near_Base.Evaluate
</Should_Return_To_Base>
<!--
Certain contestable structures can't easily be filtered out by a goal's AIGoalApplicationFlags
because they're structures.
-->
<Is_Space_Structure_Indestructable>
Variable_Target.Type.IsType { Parameter_Type = "N_Orbital_Construction_Pod" }
+
(Variable_Target.Type.IsType { Parameter_Type = "Skirmish_Merchant_Dock" }
*
Variable_Target.Owner.IsFaction {Parameter_Faction = "Neutral"})
+
(Variable_Target.Type.IsType { Parameter_Type = "Skirmish_Hutt_Asteroid_Base" }
*
Variable_Target.Owner.IsFaction {Parameter_Faction = "Neutral"})
</Is_Space_Structure_Indestructable>
<!--
Zero if it's disallowed
The notion is that when ever enemy weaknesses are presented, we capitolize upon them. Therefore,
Targets are prioritized for destruction first by
nearness to greater friendly forces than enemies then by
isolation from allies then by
whether their shields are in poor shape then by
how relatively weakened the target is then by
big boost for being nearly dead
how relatively weak to the rest of the enemy units it is.
Add a constant at the end to make sure that we always have at least some desire to destroy everything.
-->
<Unit_Needs_To_Be_Destroyed>
Function_Allowed_As_Defender_Space.Evaluate
*
(1 - Function_Is_Space_Structure_Indestructable.Evaluate)
*
(
4.0 * ((Variable_Target.Location.FriendlyForce - Variable_Target.Location.EnemyForce) > 0.0)
+
3.0 * (1.0 - Variable_Target.Location.EnemyForce)
+
2.0 * (1.0 - (Variable_Target.Shield > 0.66))
+
2.0 * (1.0 - Variable_Target.Health)
+
5.0 * (1.0 - Variable_Target.Health > 0.8)
+
(1.0 - Variable_Target.ForceNBTD)
+
2.0 * Variable_Target.ContainsHero
+
1.0
)
</Unit_Needs_To_Be_Destroyed>
<!-- This is a fallback version, so that there is usually some minimal desire to attack.
-->
<Unit_Needs_To_Be_Destroyed_Low_Desire>
0.01
*
(Function_Unit_Needs_To_Be_Destroyed.Evaluate > 3)
</Unit_Needs_To_Be_Destroyed_Low_Desire>
<!-- This is used for Bombing Runs (which can penetrate shields). Prioritize by:
nearness to greater friendly forces than enemies
isolation from allies
do they have a shield generator intact
is the shield up (if so, we're the only thing that can directly damage the hard point)
how powerful is the unit relative to its allies
how much health does it have left
-->
<Unit_Needs_To_Be_Disabled>
Function_Allowed_As_Defender_Space.Evaluate
*
(1 - Function_Is_Space_Structure_Indestructable.Evaluate)
*
(
4.0 * ((Variable_Target.Location.FriendlyForce - Variable_Target.Location.EnemyForce) > 0.0)
+
3.0 * (1.0 - Variable_Target.Location.EnemyForce)
+
3.0 * (Variable_Target.HardPointHealth {Parameter_Hard_Point_Type = HardPointType[Shield_Generator]} > 0.0)
+
2.0 * (Variable_Target.Shield > 0.66)
+
2.0 * Variable_Target.ForceNBTD
+
1.0 * Variable_Target.Health
)
</Unit_Needs_To_Be_Disabled>
<!--
Has enough time passed
AND
Is our target a starbase and is this a skirmish
OR
Does this unit generally need to be disabled
AND
Scale up by:
Give the fragile bombers some time for other units to occupy our enemies
Make sure there is a friendly non-bomber that is close enough to draw fire
Make sure there are enough friendlies in the area to give the bombers a chance
Avoid targets in areas with corvettes
Note: this function must coordinate with Desire_To_Hide_At_Location .
-->
<Unit_Needs_To_Be_Bombed>
(Game.Age > (20 # 40))
*
(
((Game.IsCampaignGame == 0) * Function_Is_Starbase.Evaluate)
+
Function_Unit_Needs_To_Be_Disabled.Evaluate
)
*
(
1.0
+
1.0 * (Variable_Target.Location.EnemyForce {Parameter_Category = GameObjectCategoryType[Corvette]} == 0)
+
2.0 * ((Variable_Target.Location.FriendlyForce {Parameter_Category = GameObjectCategoryType[Fighter|Corvette|Frigate|Capital]} * 1) > Variable_Target.Location.EnemyForce)
+
0.5 * (1000 > Variable_Target.DistanceToNearestFriendly {Parameter_Category = GameObjectCategoryType[Fighter|Corvette|Frigate|Capital]})
)
</Unit_Needs_To_Be_Bombed>
<Unit_Needs_Escort>
30.0
*
Variable_Target.Force
</Unit_Needs_Escort>
<!-- Sweeps are primarily designed to find pockets of transports, fighters
and bombers, because they don't show up as a Variable_Target when units
are specified (they are found by location threat)
Add a very small amount of desire for any unit presence, so we always have a desired goal
that can make contrast.
This desirability should be relatively low since it functions as a failsafe.
-->
<Area_Needs_Sweeping>
(1 - Function_Should_Burn_Units_Space.Evaluate)
*
(
(1 - ((Variable_Self.IsDefender) * (Variable_Self.BaseLevel > 0)))
+
(Game.IsCampaignGame == 0)
> 0
)
*
(
Variable_Target.EnemyForceNBTD {Parameter_Category = GameObjectCategoryType[Fighter | Bomber | Transport]}
+
0.001 * Variable_Target.EnemyForce
)
</Area_Needs_Sweeping>
<!-- Desire to uncover the fog of war in a zone depends on:
Not being pinned to the base
AND
Scout near the base if we haven't seen it in a while or it's early game
Scout away from the base and the enemy base if we haven't seen it in a while or it's early to mid game
Scout near the enemy base or start location if it's a campaign game or it's not early game or it hasn't been seen in a while
-->
<Space_Area_Needs_Scouting>
(1 - Function_Should_Burn_Units_Space.Evaluate)
*
Function_Allowed_As_Defender_Space.Evaluate
*
(
15 * (2000 > Function_Distance_To_Nearest_Friendly_Starbase.Evaluate)
* (((Variable_Target.TimeLastSeenUnnormalized > 120) + (20 > Game.Age)) > 0)
+
10 * (Function_Distance_To_Nearest_Friendly_Starbase.Evaluate > 2000)
* (Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 2000)
* (((Variable_Target.TimeLastSeenUnnormalized > 200) + (200 > Game.Age)) > 0)
* Variable_Target.TimeLastSeen
+
5 * (Variable_Target.IsEnemyStartLocation + (2000 > Function_Distance_To_Nearest_Enemy_Starbase.Evaluate))
* (((Variable_Target.TimeLastSeenUnnormalized > 400) + (Game.Age > 400) + (Game.IsCampaignGame)) > 0)
* Variable_Target.TimeLastSeen
)
</Space_Area_Needs_Scouting>
<Space_Area_Is_Friendly>
(1.0 - 3.0 * Variable_Target.EnemyForce) *
(1.0 + Variable_Target.FriendlyForce)
</Space_Area_Is_Friendly>
<Need_To_Hide_Units>
5 * Function_Space_Area_Is_Hidden.Evaluate
</Need_To_Hide_Units>
<Space_Area_Is_Empty>
(1 - Variable_Target.EnemyForce)
*
(1 - Variable_Target.FriendlyForce)
*
(Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "ASTEROID"} > 1000)
*
(Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "NEBULA"} > 1000)
</Space_Area_Is_Empty>
<!-- Hiding equation for surprise units.
We must not be trying to burn units
There must be no enemies where we want to hide
SCALE UP
randomly prefer asteroids sometimes
randomly prefer nebulae sometimes
This drops in desirability after a while (Rebels hold off longer because their Y-wings are not as disposable)
only hide for a short duration; pirates never hide
-->
<Desire_To_Hide_At_Location>
(1 - Function_Should_Burn_Units_Space.Evaluate)
*
(Variable_Target.EnemyForce == 0.0)
*
(1 - Variable_Target.FriendlyForce)
*
(
1.0
+
(0#1>0.5) * 5 * (1000 > Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "ASTEROID"})
+
(0#1>0.5) * 5 * (1000 > Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "NEBULA"})
)
*
(
Function_Is_Rebel.Evaluate
*
(60 > Game.Age)
+
Function_Is_Empire.Evaluate
*
(40 > Game.Age)
+
Function_Is_Underworld.Evaluate
*
(60 > Game.Age)
)
</Desire_To_Hide_At_Location>
<!-- Hiding equation for transports
-->
<Space_Area_Is_Hidden>
0.001
+
1 * (Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 1000)
+
1 * (Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 2000)
+
2 * (Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 4000)
+
2 * (Variable_Target.EnemyForce == 0.0) * (1.0 - Variable_Target.FriendlyForce)
</Space_Area_Is_Hidden>
<!-- artillery want:
wait a random amount of time until other units have likely had a chance to engage
require areas within range of an enemy
require areas that are not too close to an enemy
SCALE BY
enough to be higher than hide_units
friendliness
areas with asteroids
areas with nebulae
-->
<Good_Space_Artillery_Area>
(Game.Age > (60 # 120))
*
(4000 > Variable_Target.DistanceToNearestEnemy)
*
(Variable_Target.DistanceToNearestEnemy > 2000)
*
(
30.0
+
2.0 * Function_Space_Area_Is_Friendly.Evaluate
+
5.0 * (2000 > Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "ASTEROID"})
+
5.0 * (2000 > Script_GetDistanceToNearestSpaceField.Evaluate{Parameter_Script_String = "NEBULA"})
)
</Good_Space_Artillery_Area>
<!--
Big factor to make sure this comes top
Has enough time passed (different for attacker and defender so that we don't attack and then instantly retreat)
AND
Are we attackers AND greatly outnumbered
OR
Are we defenders AND without a space station AND greatly outnumbered
OR
Have we been caught with only shuttles
OR
Are we outnumbered with little real force and many transports
OR
Are we the defender and have enough transports that it's worth abandoning space control to save them
Removed over attenuation - it could send force to zero (or negative) which could lead to retreating/not retreating in unexpected
circumstances
-->
<Want_To_Retreat_From_Space>
50.0
*
(Variable_Self.IsDefender * (Game.Age > 20) +
(1 - Variable_Self.IsDefender) * (Game.Age > 120))
*
(
(
Game.IsCampaignGame
*
(
(1.0 - Variable_Self.IsDefender) *
(Variable_Enemy.FriendlyForceUnnormalized{Parameter_Attenuator = 1.0} >= (4.0 * Variable_Self.FriendlyForceUnnormalized{Parameter_Attenuator = 1.0}))
+
(Variable_Self.IsDefender *
(Variable_Self.BaseLevel == 0) *
(Variable_Enemy.FriendlyForceUnnormalized{Parameter_Attenuator = 1.0} >= (4.0 * Variable_Self.FriendlyForceUnnormalized{Parameter_Attenuator = 1.0})))
+
((3.0 * Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Transport]}) >= Variable_Self.FriendlyForceUnnormalized)
+
(Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Transport]} >= 50) *
(1000 >= Variable_Self.FriendlyForceUnnormalized) *
(Variable_Enemy.FriendlyForceUnnormalized > Variable_Self.FriendlyForceUnnormalized)
+
(Variable_Self.IsDefender) *
(Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Transport]} >= 150)
)
+
(1 - Game.IsCampaignGame)
*
(Variable_Self.BaseLevel == 0)
)
> 0
)
</Want_To_Retreat_From_Space>
<!--
Is this a campaign game (the AI doesn't retreat in skirmish)
AND
Are we capable of retreat
AND
Are we not pirates
-->
<Allowed_To_Retreat_From_Space>
Game.IsCampaignGame
*
Variable_Self.CanRetreat
*
(1.0 - Variable_Self.IsFaction {Parameter_Faction = "Pirates"})
</Allowed_To_Retreat_From_Space>
<Should_Retreat_From_Space>
Function_Want_To_Retreat_From_Space.Evaluate
*
Function_Allowed_To_Retreat_From_Space.Evaluate
</Should_Retreat_From_Space>
<Has_Space_Station>
(Variable_Target.StarbaseLevel > 0)
</Has_Space_Station>
<!-- Generally shoot at the greatest relative force, but prefer units over starbases
don't bother with Corvettes, they're nearly impossible to hit-->
<Needs_Hypervelocity_Shot>
(1 - Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]})
*
(1 - (Variable_Target.Force{Parameter_Category = GameObjectCategoryType[Corvette]} > 0))
*
Variable_Target.ForceNBTD
*
(
1 * Function_Is_Starbase.Evaluate
+
20 * (1 - Function_Is_Starbase.Evaluate)
)
</Needs_Hypervelocity_Shot>
<!-- Is this something we'd like to fire an Ion Cannon at? If we just shot it,
we may prefer firing on a weaker unit with full shields or energy.
don't bother with Corvettes, they're nearly impossible to hit
the unit's relative force
the % of shield remaining
their engines aren't currently disabled
prefer units over starbases
UNUSED
the % of energy remaining (used for engines, shields, and weapons)
+
Variable_Target.Energy
-->
<Needs_Ion_Shot>
(1 - Variable_Self.IsDifficulty{Parameter_Difficulty_Level_Type = DifficultyLevelType[Easy]})
*
(1 - (Variable_Target.Force{Parameter_Category = GameObjectCategoryType[Corvette]} > 0))
*
(
2.5 * Variable_Target.ForceNBTD
+
Variable_Target.Shield
+
Variable_Target.AreEnginesOnline
)
*
(
1 * Function_Is_Starbase.Evaluate
+
20 * (1 - Function_Is_Starbase.Evaluate)
)
</Needs_Ion_Shot>
<!-- These are fleeting opportunities, so go about these with high desire
Does the area have relatively isolated weak units. Magic number should result in this being the highest priority.
ADD DESIRE
Do we have some weak units that need assistance (dogfight conditions, for example)
ADD DESIRE
Is this near our starbase
-->
<Good_Turbo_Attack_Location_Opportunity>
(
20 * (Function_Fighter_Location_Isolated.Evaluate > 0.2) * Function_Fighter_Location_Isolated.Evaluate
)
+
(
15 * (Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]} > 0)
*
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]} /
(Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]} +
Variable_Target.FriendlyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]})
)
+
(
15 * (Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]} > 0)
*(2000 > Function_Distance_To_Nearest_Friendly_Starbase.Evaluate)
)
</Good_Turbo_Attack_Location_Opportunity>
<!-- normalized threat isolation for weak units by location-->
<Fighter_Location_Isolated>
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]}
/
(
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Transport]}
+
Variable_Target.EnemyForce {Parameter_Category = GameObjectCategoryType[Corvette|Frigate|Capital|Structure]}
)
</Fighter_Location_Isolated>
<!-- These are fleeting opportunities, so go about these with high desire
Basically, we're looking for isolated weak units that we can quickly deal with.
Does the unit have shields down or nearly down
Is relativly isolated from allies, with a cutoff
OR
Is this an artillery piece
SCALE BY
Unit health-->
<Good_Turbo_Attack_Unit_Opportunity>
(
(0.2 > Variable_Target.Shield)
*
30.0 * (Function_Unit_Isolation.Evaluate - 0.2)
+
3.0 * (Variable_Target.Type.IsType {Parameter_Type = "Marauder_Missile_Cruiser", Parameter_Type = "Broadside_Class_Cruiser", Parameter_Type = "Ultor_Beam_Cruiser"} )
)
*
10.0 * (1 - Variable_Target.Health)
</Good_Turbo_Attack_Unit_Opportunity>
<!-- normalized threat isolation for a unit
-->
<Unit_Isolation>
Variable_Target.Force / (Variable_Target.Location.EnemyForce + Variable_Target.Force)
</Unit_Isolation>
<Need_To_Secure_Contestable>
Variable_Target.IsContestable
*
(
5 * (Variable_Target.Location.EnemyForce == 0)
+
5 * (1 - Variable_Target.Location.EnemyForce)
+
20 * clamp( (10000 / (Variable_Target.DistanceToNearestFriendly {Parameter_Category = GameObjectCategoryType[Capital]} + 1)), 0, 2)
-
5.0 * Variable_Target.HasBuiltObject
+
1
)
</Need_To_Secure_Contestable>
<!--
Disallow securing distant contestables if this is an easy AI and it already has N resource plots.
For skirmish games, sink desire on non refinery build pads if we don't have any yet.
Note: space station reveal range is about 2000
-->
<Need_To_Secure_Contestable_Space>
(1 - Function_Should_Firesale_Space.Evaluate)
*
Function_Allowed_As_Defender_Space.Evaluate
*
Function_Need_To_Secure_Contestable.Evaluate
*
(Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 2500)
*
(
Game.IsCampaignGame
+
(Game.IsCampaignGame == 0.0)
*
(
Function_Is_Refinery_Pad_Space.Evaluate
+
(1 - Function_Is_Refinery_Pad_Space.Evaluate)
*
(Function_Number_Resource_Structures_Space.Evaluate)
)
)
</Need_To_Secure_Contestable_Space>
<Number_Resource_Structures_Space>
Variable_Self.TacticalBuiltStructureCount{Parameter_Type = "Empire_Mineral_Extractor"
,Parameter_Type = "Rebel_Mineral_Extractor"
,Parameter_Type = "Rebel_Mineral_Extractor_Armored"
,Parameter_Type = "Rebel_Mineral_Extractor_Defense"
,Parameter_Type = "Hutt_Mineral_Extractor"
,Parameter_Type = "Underworld_Mineral_Extractor"}
</Number_Resource_Structures_Space>
<!-- Really high desire if there are not many enemies around relative to our presence
*
(1 - Variable_Target.HasBuiltObject)
-->
<Need_To_Build_Structure_Space>
10.0
*
(1 - Function_Is_Saving_For_Refineries_Space.Evaluate)
*
(1 - Function_Skirmish_Needs_New_Space_Station.Evaluate)
*
(
0.2 >
(
Variable_Target.Location.EnemyForce /
(Variable_Target.Location.EnemyForce + Variable_Target.Location.FriendlyForce )
)
)
</Need_To_Build_Structure_Space>
<!--
*
(1 - Variable_Target.HasBuiltObject)
Note: space station reveal range is about 2000-->
<Need_To_Build_Refinery_Space>
50.0
*
(
0.2 >
(
Variable_Target.Location.EnemyForce /
(Variable_Target.Location.EnemyForce + Variable_Target.Location.FriendlyForce )
)
)
*
(Function_Distance_To_Nearest_Enemy_Starbase.Evaluate > 2500)
</Need_To_Build_Refinery_Space>
<!-- Save cash
If we have a refinery build pad without a refinery
AND
We don't have a surplus of cash
-->
<Is_Saving_For_Refineries_Space>
(Variable_Self.OpenBuildPadCount{Parameter_Type = "Mineral_Extractor_Pad"} > 0)
*
(1500 > Variable_Self.CreditsUnnormalized)
</Is_Saving_For_Refineries_Space>
<Is_Refinery_Pad_Space>
Variable_Target.Type.IsType {Parameter_Type = "Mineral_Extractor_Pad"}
</Is_Refinery_Pad_Space>
<Tactical_Multiplayer_Should_Build_Generic_Space>
(1 - Function_Is_Saving_For_Refineries_Space.Evaluate)
*
(1 - Function_Skirmish_Needs_New_Space_Station.Evaluate)
*
Function_Tactical_Multiplayer_Should_Build_Generic.Evaluate
</Tactical_Multiplayer_Should_Build_Generic_Space>
<Should_Purchase_Ability_Generic_Space>
(Game.Age > 120)
*
(Variable_Self.FriendlyForce > (0.5 * Variable_Self.EnemyForce))
*
(
(Game.IsCampaignGame == 0)
*
(1 - Function_Is_Saving_For_Refineries_Space.Evaluate)
*
(1 - Function_Skirmish_Needs_New_Space_Station.Evaluate)
*
(
(
(Function_Number_Resource_Structures_Space.Evaluate > 0)
*
(40 > Variable_Self.UnitSpaceAvailable)
)
+
(
(Function_Number_Resource_Structures_Space.Evaluate > 1)
*
(50 > Variable_Self.UnitSpaceAvailable)
)
)
*
(
1.0
+
10.0 * (Variable_Self.FriendlyForceUnnormalized{Parameter_Attenuator = 1.0} >= (0.8 * Variable_Enemy.ForceUnnormalized{Parameter_Attenuator = 1.0}))
+
(5.0 * (0#1>0.5))
)
+
(Game.IsCampaignGame)
)
</Should_Purchase_Ability_Generic_Space>
<!--
High desire
Do we want to retreat
AND
We're not allowed
OR
It's a skirmish game
AND
If we're near the unit cap
AND
We've got better stuff in the reinforcement pool
OR
We've got some stuff in the reinforcement pool
OR
We've got more than the enemy has in reinforcements
OR
The enemy has no forces except capital (space station)-->
<Should_Burn_Units_Space>
50
*
(
Function_Want_To_Retreat_From_Space.Evaluate
*
(1 - Function_Allowed_To_Retreat_From_Space.Evaluate)
)
+
(
(Game.IsCampaignGame == 0)
*
(3 > Variable_Self.UnitSpaceAvailable)
*
(
(Variable_Self.ReinforcementsUnnormalized > Variable_Self.FriendlyForceUnnormalized{Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Corvette|Frigate]})
+
(Variable_Self.ReinforcementsUnnormalized > (Variable_Self.FriendlyForceUnnormalized{Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Corvette|Frigate]} * 0.25))
+
(Variable_Self.ReinforcementsUnnormalized > Variable_Self.EnemyForceUnnormalized{Parameter_Category = GameObjectCategoryType[Fighter|Bomber|Corvette|Frigate]})
)
+
(Game.Age > 180.0)
*
(500.0 > Variable_Self.EnemyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Fighter | Bomber | Corvette | Frigate]})
+
(Game.Age > 500.0)
*
(Variable_Self.FriendlyForceUnnormalized > (1.5 * Variable_Self.EnemyForceUnnormalized))
*
((Function_Number_Resource_Structures_Space.Evaluate > 1) + Game.IsCampaignGame)
)
</Should_Burn_Units_Space>
<Should_Firesale_Space>
Function_Want_To_Retreat_From_Space.Evaluate
*
(1 - Function_Allowed_To_Retreat_From_Space.Evaluate)
</Should_Firesale_Space>
<Enemy_Retreating>
Variable_Enemy.IsRetreating
</Enemy_Retreating>
<Self_Retreating>
Variable_Self.IsRetreating
</Self_Retreating>
<Need_To_Patrol_Space>
(1 - Function_Should_Burn_Units_Space.Evaluate)
*
clamp( Variable_Self.IsDefender
*
(1 - Variable_Target.Location.FriendlyForce)
*
( Variable_Target.DistanceToNearestFriendly / 10 )
,0
,3
)
</Need_To_Patrol_Space>
<Is_Skirmish_Mode>
Game.IsCampaignGame == 0
</Is_Skirmish_Mode>
<!-- Need a source of cash, a reasonable force in play (exclude capital since the station itself probably covers that
Base upgrades on time, or else any time the unit power race is way out of balance -->
<Skirmish_Needs_New_Space_Station>
(Game.IsCampaignGame == 0.0)
*
(Function_Number_Resource_Structures_Space.Evaluate >= 1.0)
*
(Variable_Self.FriendlyForceUnnormalized {Parameter_Category = GameObjectCategoryType[Fighter | Bomber | Corvette | Frigate]} > 3000.0)
*
((Game.Age > 60.0) * (Variable_Self.BaseLevel == 1.0)
+
(Game.Age > 180.0) * (Variable_Self.BaseLevel == 2.0)
+
(Game.Age > 600.0) * (Variable_Self.BaseLevel == 3.0)
+
(Game.Age > 1200.0) * (Variable_Self.BaseLevel == 4.0)
+
(5.0 > Variable_Self.BaseLevel) * (Variable_Self.FriendlyForce > (2.0 * Variable_Self.EnemyForce))
+
(5.0 > Variable_Self.BaseLevel) * (Variable_Self.EnemyForce > (2.0 * Variable_Self.FriendlyForce)))
</Skirmish_Needs_New_Space_Station>
<Skirmish_Needs_New_Space_Station_With_Multiplier>
40.0 * Function_Skirmish_Needs_New_Space_Station.Evaluate
</Skirmish_Needs_New_Space_Station_With_Multiplier>
<Skirmish_Needs_Magic_Cash_Drop_Space>
50.0
*
(Variable_Self.BaseLevel > 0.0)
*
(3000.0 > Variable_Self.CreditsUnnormalized)
*
(Variable_Self.EnemyForceUnnormalized > Variable_Self.FriendlyForceUnnormalized)
*
(Game.Age > 180.0)
*
(Game.IsCampaignGame == 0.0)
</Skirmish_Needs_Magic_Cash_Drop_Space>
<Need_To_Defend_Space_Station>
50.0
*
(Function_Should_Burn_Units_Space.Evaluate == 0.0)
*
((Game.IsCampaignGame == 0) + Variable_Self.IsDefender)
*
Function_Is_Starbase.Evaluate
*
(2500 > Variable_Target.DistanceToNearestEnemy {Parameter_Category = GameObjectCategoryType[Frigate | Capital]})
</Need_To_Defend_Space_Station>
</Equations>

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" ?>
<Equations>
<Is_Sandbox_Event_Allowed>
(Game.Age > 111.0) *
(Game.TimeSinceStoryPopup > 133.0) *
(4 > Game.ActiveStoryGoalCount)
</Is_Sandbox_Event_Allowed>
<!-- Disable this mission - people don't like it -->
<!--<Trigger_Contrived_Attack>
Function_Is_Sandbox_Event_Allowed.Evaluate *
(Variable_Self.PlanetsControlledUnnormalized > 3) *
(Variable_Enemy.PlanetsControlledUnnormalized > 1) *
(Variable_Target.IsFaction {Parameter_Faction = "Rebel", Parameter_Faction = "Empire"}) *
(Variable_Target.EnemyForce.SpaceTotalUnnormalized > 10000) *
(Function_Is_Connected_To_Me.Evaluate) *
(Game.Age > 300.0)
</Trigger_Contrived_Attack>-->
<Trigger_Contrived_Attack>0.0</Trigger_Contrived_Attack>
<Trigger_Trap_Galactic>
Function_Is_Sandbox_Event_Allowed.Evaluate *
Function_Is_Connected_To_Enemy.Evaluate *
(750 > Variable_Target.FriendlyForce.GroundTotalUnnormalized) *
(1500 > Variable_Target.FriendlyForce.SpaceTotalUnnormalized) *
Variable_Target.IsSurfaceAccessible
</Trigger_Trap_Galactic>
<Trigger_Trap_Land>
Script_EvaluateInGalacticContext.Evaluate{Parameter_Script_String = "Helper_Trap_Land_Check_Galactic_Flags"}
</Trigger_Trap_Land>
<Helper_Trap_Land_Check_Galactic_Flags>
Variable_Target.StoryTrigger {Parameter_Name = "TRAP_GALACTIC_NOTIFICATION_01"}
</Helper_Trap_Land_Check_Galactic_Flags>
<!-- Cutting missions that flip player planets -->
<!--<Trigger_Planet_Ownership_Flip>
Function_Is_Sandbox_Event_Allowed.Evaluate *
(7000 > Variable_Target.EnemyForce.GroundTotalUnnormalized) *
(25000 > Variable_Target.EnemyForce.SpaceTotalUnnormalized) *
(1.0 - Variable_Target.HasIndigenousUnits {Parameter_Type = "Ewok_Hunter",
Parameter_Type = "Gungan_Warrior",
Parameter_Type = "Wookie_Warrior",
Parameter_Type = "Jawa_Scout"}) *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
(Variable_Target.IsFaction {Parameter_Faction = "Rebel", Parameter_Faction = "Empire"}) *
(Variable_Enemy.PlanetsControlled >= 3)
</Trigger_Planet_Ownership_Flip>-->
<Trigger_Planet_Ownership_Flip>0.0</Trigger_Planet_Ownership_Flip>
<Trigger_Fleet_Rampage>
Function_Is_Sandbox_Event_Allowed.Evaluate *
(Variable_Target.EnemyForce.SpaceTotalUnnormalized > 0) *
(Variable_Target.IsFaction {Parameter_Faction = "Rebel", Parameter_Faction = "Empire"}) *
(Function_Has_Accuser.Evaluate + Function_Has_Home_One.Evaluate) *
(Variable_Enemy.PlanetsControlled >= 5)
</Trigger_Fleet_Rampage>
<Has_Accuser>
Variable_Self.HasUnit {Parameter_Type = "Accuser_Star_Destroyer"}
</Has_Accuser>
<Has_Home_One>
Variable_Self.HasUnit {Parameter_Type = "Home_One"}
</Has_Home_One>
<Trigger_Hero_Gathering>
Function_Is_Sandbox_Event_Allowed.Evaluate *
(1.0 - Variable_Target.Type.IsType {Parameter_Type = "CORUSCANT"}) *
(Variable_Target.GroundbaseLevelUnnormalized >= 3) *
(Variable_Target.FriendlyForce.GroundTotalUnnormalized >= 20000) *
Function_Has_Heroes_For_Gathering.Evaluate
</Trigger_Hero_Gathering>
<Has_Heroes_For_Gathering>
(Variable_Self.HasUnit {Parameter_Type = "Darth_Team"} *
Variable_Self.HasUnit {Parameter_Type = "General_Veers_Team"} *
Variable_Self.HasUnit {Parameter_Type = "Boba_Fett_Team"}) +
(Variable_Self.HasUnit {Parameter_Type = "Obi_Wan_Team"} *
Variable_Self.HasUnit {Parameter_Type = "Han_Solo_Team"})
</Has_Heroes_For_Gathering>
</Equations>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<Equations>
<Story_Empire_Trigger_Magic_Spawn_Pirates>
(Variable_Self.StoryTrigger {Parameter_Name = "ACT_2"} * (Variable_Self.StoryTrigger {Parameter_Name = "ACT_2_PIRATE_SPAWN_DISABLED"} == 0.0) +
Variable_Self.StoryTrigger {Parameter_Name = "ACT_3"} * (Variable_Self.StoryTrigger {Parameter_Name = "ACT_3_PIRATE_SPAWN_DISABLED"} == 0.0) +
Variable_Self.StoryTrigger {Parameter_Name = "ACT_4"} * (Variable_Self.StoryTrigger {Parameter_Name = "ACT_4_PIRATE_SPAWN_DISABLED"} == 0.0)) *
(Variable_Target.EnemyForce.HasSpaceForce == 0.0) *
(10000 > Variable_Target.FriendlyForce.SpaceTotalUnnormalized)
</Story_Empire_Trigger_Magic_Spawn_Pirates>
<Story_Empire_Is_Suitable_Falast_Spawn>
Function_Space_Contrast.Evaluate == 0
</Story_Empire_Is_Suitable_Falast_Spawn>
<!--This is the backup case for not finding a space without Empire units.
Falast will just prefer to go to any Empire system with an interdictor and cut to the chase.
In the worst case, any system will be chosen.-->
<Story_Empire_Is_Suitable_Falast_Backup_Spawn>
(Variable_Target.EnemyForce.HasSpaceUnitsBitfield {Parameter_Type = "Interdictor_Cruiser"} != 0)
+
1
</Story_Empire_Is_Suitable_Falast_Backup_Spawn>
</Equations>