# ============================================================================
# DUNE LEGACY - QUANTBOT AI CONFIGURATION
# ============================================================================
#
# This file allows you to customize QuantBot AI behavior without recompiling.
# This file is located in the config subdirectory of your game installation:
#
# Config file location:
#   Windows: <game_install_dir>\config\QuantBot Config.ini
#   Linux:   <game_install_dir>/config/QuantBot Config.ini
#   macOS:   Dune Legacy.app/Contents/Resources/config/QuantBot Config.ini
#
# ============================================================================
# DIFFICULTY SETTINGS
# ============================================================================
#
# Each difficulty level has separate settings for CAMPAIGN vs CUSTOM games.
#
# === ATTACK BEHAVIOR ===
# AttackEnabled              - Can this difficulty attack at all? (0=no, 1=yes)
# OrnithopterAttackEnabled   - Can ornithopters attack? (0=defend only, 1=attack)
# OrnithopterAttackThreshold - Minimum ornithopters needed before attacking (Hard=1, Brutal=3)
#
# === CAMPAIGN MODE (Story Missions) ===
# These settings apply when playing the campaign/story mode.
#
# HarvesterLimitMultiplier   - Harvesters per refinery (e.g., 2 = 2 harvesters per refinery)
#                              The AI will build up to (multiplier * refinery_count) harvesters
#
# MilitaryValueMultiplier    - Multiplier for initial military strength
#                              The AI calculates its starting military value (sum of all unit prices)
#                              then multiplies by this to set its production limit
#                              Example: If AI starts with 2000 in units and multiplier is 2.0,
#                                       it will build units until it has 4000 worth of military
#
# === CUSTOM GAMES (Skirmish/Multiplayer) ===
# These settings apply to custom/skirmish games on different map sizes.
# Values are ABSOLUTE LIMITS, not multipliers.
#
# MilitaryValueLimitSmallMap  - Maximum military value for small maps (32x32 = 1024 tiles)
# MilitaryValueLimitMediumMap - Maximum military value for medium maps (64x64 = 4096 tiles)
# MilitaryValueLimitLargeMap  - Maximum military value for large maps (128x128 = 16384 tiles)
#
# HarvesterLimitSmallMap      - Maximum harvesters for small maps (32x32)
# HarvesterLimitMediumMap     - Maximum harvesters for medium maps (64x64)
# HarvesterLimitLargeMap      - Maximum harvesters for large maps (128x128)
#
# NOTE: "Military Value" = sum of unit prices (e.g., Tank=110, SiegeTank=300, etc.)

[Difficulty Settings]
# === DEFEND (Very Easy) - Never attacks ===
Defend_AttackEnabled=0
Defend_AttackThresholdPercent=0.90
Defend_OrnithopterAttackEnabled=0
Defend_OrnithopterAttackThreshold=999
Defend_AttackForceMilitaryValueRatio=0.0
# Campaign: 2 harvesters per refinery, 1.8x initial military value
Defend_HarvesterLimitMultiplier=2
Defend_MilitaryValueMultiplier=1.8
Defend_RefineryMinimum=0
# Custom games: Small, Medium, Large, Huge map limits
Defend_HarvesterLimitSmallMap=3
Defend_HarvesterLimitMediumMap=4
Defend_HarvesterLimitLargeMap=15
Defend_HarvesterLimitHugeMap=20
Defend_MilitaryValueLimitSmallMap=4000
Defend_MilitaryValueLimitMediumMap=10000
Defend_MilitaryValueLimitLargeMap=25000
Defend_MilitaryValueLimitHugeMap=30000
# Defense scramble: units to send when attacked
Defend_StructureDefenders=5
Defend_HarvesterDefenders=3

# === EASY - Ground units attack, ornithopters defend only ===
Easy_AttackEnabled=1
Easy_AttackThresholdPercent=0.50
Easy_OrnithopterAttackEnabled=0
Easy_OrnithopterAttackThreshold=999
Easy_AttackForceMilitaryValueRatio=0.25
# Campaign: 1 harvester per refinery, 2.0x initial military (minimum 2000 at mission 21+)
Easy_HarvesterLimitMultiplier=1
Easy_MilitaryValueMultiplier=2.0
Easy_RefineryMinimum=0
# Custom games: Small, Medium, Large, Huge map limits
Easy_HarvesterLimitSmallMap=2
Easy_HarvesterLimitMediumMap=2
Easy_HarvesterLimitLargeMap=8
Easy_HarvesterLimitHugeMap=15
Easy_MilitaryValueLimitSmallMap=3000
Easy_MilitaryValueLimitMediumMap=8000
Easy_MilitaryValueLimitLargeMap=20000
Easy_MilitaryValueLimitHugeMap=30000
# Defense scramble: units to send when attacked
Easy_StructureDefenders=10
Easy_HarvesterDefenders=5

# === MEDIUM - Ground units attack, ornithopters defend only ===
Medium_AttackEnabled=1
Medium_AttackThresholdPercent=0.40
Medium_OrnithopterAttackEnabled=0
Medium_OrnithopterAttackThreshold=999
Medium_AttackForceMilitaryValueRatio=0.40
# Campaign: 2 harvesters per refinery, 2.5x initial military (minimum 4000 at mission 21+)
Medium_HarvesterLimitMultiplier=2
Medium_MilitaryValueMultiplier=2.5
Medium_RefineryMinimum=0
# Custom games: Small, Medium, Large, Huge map limits
Medium_HarvesterLimitSmallMap=3
Medium_HarvesterLimitMediumMap=4
Medium_HarvesterLimitLargeMap=15
Medium_HarvesterLimitHugeMap=25
Medium_MilitaryValueLimitSmallMap=5000
Medium_MilitaryValueLimitMediumMap=12000
Medium_MilitaryValueLimitLargeMap=35000
Medium_MilitaryValueLimitHugeMap=50000
# Defense scramble: units to send when attacked
Medium_StructureDefenders=15
Medium_HarvesterDefenders=10

# === HARD - Full aggression ===
Hard_AttackEnabled=1
Hard_AttackThresholdPercent=0.30
Hard_OrnithopterAttackEnabled=1
Hard_OrnithopterAttackThreshold=1
Hard_AttackForceMilitaryValueRatio=0.50
# Campaign: 2.5 harvesters per refinery, 3.0x initial military (fixed 10000 at mission 21+)
Hard_HarvesterLimitMultiplier=2.5
Hard_MilitaryValueMultiplier=3.0
Hard_RefineryMinimum=2
# Custom games: Small, Medium, Large, Huge map limits
Hard_HarvesterLimitSmallMap=4
Hard_HarvesterLimitMediumMap=7
Hard_HarvesterLimitLargeMap=40
Hard_HarvesterLimitHugeMap=40
Hard_MilitaryValueLimitSmallMap=8000
Hard_MilitaryValueLimitMediumMap=20000
Hard_MilitaryValueLimitLargeMap=50000
Hard_MilitaryValueLimitHugeMap=70000
# Defense scramble: units to send when attacked
Hard_StructureDefenders=25
Hard_HarvesterDefenders=15

# === BRUTAL - Maximum aggression ===
Brutal_AttackEnabled=1
Brutal_AttackThresholdPercent=0.30
Brutal_OrnithopterAttackEnabled=1
Brutal_OrnithopterAttackThreshold=3
Brutal_AttackForceMilitaryValueRatio=0.60
# Campaign: Uses Custom map-size limits (ignores multiplier), 3.5x initial military
Brutal_HarvesterLimitMultiplier=999
Brutal_MilitaryValueMultiplier=3.5
Brutal_RefineryMinimum=4
# Custom games: Small, Medium, Large, Huge map limits
Brutal_HarvesterLimitSmallMap=6
Brutal_HarvesterLimitMediumMap=10
Brutal_HarvesterLimitLargeMap=100
Brutal_HarvesterLimitHugeMap=50
Brutal_MilitaryValueLimitSmallMap=20000
Brutal_MilitaryValueLimitMediumMap=40000
Brutal_MilitaryValueLimitLargeMap=80000
Brutal_MilitaryValueLimitHugeMap=100000
# Defense scramble: units to send when attacked
Brutal_StructureDefenders=25
Brutal_HarvesterDefenders=25

# ============================================================================
# UNIT COMPOSITION RATIOS
# ============================================================================
#
# These ratios determine what units the AI builds when totalDamage < 3000.
# Values are percentages (0.0 to 1.0) and should sum to approximately 1.0.
# These ratios are used across ALL difficulty levels.
#
# Ornithopter spam is controlled by the OrnithopterAttackEnabled flag:
#   - Defend/Easy/Medium: OrnithopterAttackEnabled=0 (AI builds but won't attack)
#   - Hard/Brutal: OrnithopterAttackEnabled=1 (AI builds and attacks)
#
# Tank        - Regular combat tanks
# SiegeTank   - Siege tanks (heavy artillery)
# Launcher    - Rocket launchers
# Special     - House-specific special units (Sonic Tank, Devastator, Deviator)
# Ornithopter - Flying units
#
# NOTE: Harkonnen cannot build ornithopters (Builder=Invalid in ObjectData.ini)
#       Ordos cannot build launchers (Builder=Invalid in ObjectData.ini)

[Unit Ratios]
# Atreides - Balanced army composition with launchers and sonic tanks
Atreides_Tank=0.05
Atreides_SiegeTank=0.10
Atreides_Launcher=0.35
Atreides_Special=0.35
Atreides_Ornithopter=0.15

# Harkonnen - Cannot build ornithopters, focuses on heavy firepower (capped launcher at 50%)
Harkonnen_Tank=0.17
Harkonnen_SiegeTank=0.17
Harkonnen_Launcher=0.50
Harkonnen_Special=0.16
Harkonnen_Ornithopter=0.0

# Ordos - Cannot build launchers, highest ornithopter ratio for air superiority
Ordos_Tank=0.25
Ordos_SiegeTank=0.25
Ordos_Launcher=0.0
Ordos_Special=0.25
Ordos_Ornithopter=0.25

# Fremen - Balanced with light ornithopter support (capped tank at 50%)
Fremen_Tank=0.50
Fremen_SiegeTank=0.10
Fremen_Launcher=0.27
Fremen_Special=0.0
Fremen_Ornithopter=0.13

# Sardaukar - Heavy firepower with light ornithopter support
Sardaukar_Tank=0.05
Sardaukar_SiegeTank=0.40
Sardaukar_Launcher=0.45
Sardaukar_Special=0.0
Sardaukar_Ornithopter=0.10

# Mercenary - Balanced across all unit types
Mercenary_Tank=0.30
Mercenary_SiegeTank=0.30
Mercenary_Launcher=0.30
Mercenary_Special=0.05
Mercenary_Ornithopter=0.10

# ============================================================================
# TARGET PRIORITIES
# ============================================================================
# These weights mirror the original game. Higher numbers make a target more attractive.
# Scores are computed as (Build + Target) / distance.
# This is being used for Ornithopter targeting initially and may be extended
# to ground force target selection as well, it could also be considered for
# building prioritisation

[Structure Priorities]
Slab1_Build=0
Slab1_Target=5
Slab4_Build=0
Slab4_Target=10
Palace_Build=0
Palace_Target=400
LightFactory_Build=0
LightFactory_Target=200
HeavyFactory_Build=0
HeavyFactory_Target=600
HighTechFactory_Build=0
HighTechFactory_Target=200
IX_Build=0
IX_Target=100
WOR_Build=0
WOR_Target=175
ConstructionYard_Build=0
ConstructionYard_Target=300
WindTrap_Build=0
WindTrap_Target=300
Barracks_Build=0
Barracks_Target=100
StarPort_Build=0
StarPort_Target=250
Refinery_Build=0
Refinery_Target=300
RepairYard_Build=0
RepairYard_Target=600
Wall_Build=0
Wall_Target=30
GunTurret_Build=75
GunTurret_Target=150
RocketTurret_Build=100
RocketTurret_Target=75
Silo_Build=0
Silo_Target=150
Radar_Build=0
Radar_Target=275

[Unit Priorities]
Carryall_Build=20
Carryall_Target=16
Devastator_Build=175
Devastator_Target=180
Deviator_Build=50
Deviator_Target=175
Frigate_Build=0
Frigate_Target=0
Harvester_Build=10
Harvester_Target=150
Soldier_Build=10
Soldier_Target=10
Launcher_Build=100
Launcher_Target=150
MCV_Build=10
MCV_Target=150
Ornithopter_Build=75
Ornithopter_Target=30
Quad_Build=60
Quad_Target=60
Saboteur_Build=0
Saboteur_Target=700
Sandworm_Build=0
Sandworm_Target=0
SiegeTank_Build=130
SiegeTank_Target=150
SonicTank_Build=80
SonicTank_Target=110
Tank_Build=80
Tank_Target=100
Trike_Build=50
Trike_Target=50
RaiderTrike_Build=55
RaiderTrike_Target=60
Trooper_Build=20
Trooper_Target=30
Special_Build=0
Special_Target=0
Infantry_Build=20
Infantry_Target=20
Troopers_Build=50
Troopers_Target=50

# ============================================================================
# GENERAL AI BEHAVIOR
# ============================================================================
#
# Global settings that affect all difficulty levels.
#
# AttackTimerMs          - Time between attack checks (milliseconds)
# AttackThresholdPercent - Don't attack until military reaches this % of limit (0.0-1.0)
# MinMoneyForProduction  - Minimum money needed to queue production

[General Behavior]
AttackTimerMs=90000
AttackThresholdPercent=0.40
MinMoneyForProduction=500
