• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Wesen

Second Lieutenant
54 Badges
Dec 29, 2011
109
66
  • Sword of the Stars
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Magicka
  • For the Motherland
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Hearts of Iron III
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Imperator: Rome
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings III
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Imperator: Rome Sign Up
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Crusader Kings III: Royal Edition
  • 500k Club
  • Victoria 2
  • Europa Universalis 4: Emperor
Ran into this issue while running tests for an AI template mod.
Basically the AI manages to reach a target template perfectly if only those types actually used in the template are allowed, but as soon as even just additional support companies are allowed it messes up completely.

(Interesting part is in improved_infantry_nic, ignore infantry_nic. width_weight and all stat_weights set to 0.0 for testing.)

Here's the working as intended template file:
Code:
infantry_NIC = {
    target_width = 20.0
    width_weight = 0.1
    column_swap_factor = 0.5
   
    stat_weights = {
        0.00 #-- default_morale
        0.00 #-- defense
        1.00 #-- breakthrough
        0.00 #-- hardness
        4.00 #-- soft_attack
        0.00 #-- hard_attack
        0.00 #-- recon
        1.00 #-- entrenchment
        0.00 #-- initiative
        0.00 #-- casualty_trickleback
        0.00 #-- supply_consumption_factor
        0.00 #-- supply_consumption
        0.00 #-- suppression
        0.00 #-- suppression_factor
        0.00 #-- experience_loss_factor
        #-- Air Values
        0.00 #-- air_attack
        #-- Common Values
        0.60 #-- max_organisation
        0.40 #-- max_strength
        0.00 #-- build_cost_ic
        0.00 #-- maximum_speed
        0.00 #-- armor_value
        0.20 #-- ap_attack
        0.00 #-- reliability
        0.00 #-- reliability_factor
        0.00 #-- weight
    }
   
    target_template = {
        weight = 0.9
        match_value = 300.0
       
        support = {
            engineer = 1
            recon = 1
            field_hospital = 1
        }
       
        regiments = {
            infantry = 3
        }
    }
   
    allowed_types = {
        infantry       
        engineer
        recon
        signal_company
        field_hospital
        logistics_company
        anti_tank
        military_police
        artillery
#        anti_air
        rocket_artillery
        anti_tank_brigade
        artillery_brigade
        rocket_artillery_brigade
#        light_tank_destroyer_brigade 
#        medium_tank_destroyer_brigade 
    }

    replace_at_match = 0.4
    replace_with = better_infantry_NIC
    target_min_match = 0.2
}

better_infantry_NIC = {
    target_width = 20.0
    width_weight = 0.0
    column_swap_factor = 0.5
   
    stat_weights = {
        0.00 #-- default_morale
        0.00 #-- defense
        0.00 #-- breakthrough
        0.00 #-- hardness
        0.00 #-- soft_attack
        0.00 #-- hard_attack
        0.00 #-- recon
        0.00 #-- entrenchment
        0.00 #-- initiative
        0.00 #-- casualty_trickleback
        0.00 #-- supply_consumption_factor
        0.00 #-- supply_consumption
        0.00 #-- suppression
        0.00 #-- suppression_factor
        0.00 #-- experience_loss_factor
        #-- Air Values
        0.00 #-- air_attack
        #-- Common Values
        0.00 #-- max_organisation
        0.00 #-- max_strength
        0.00 #-- build_cost_ic
        0.00 #-- maximum_speed
        0.00 #-- armor_value
        0.00 #-- ap_attack
        0.00 #-- reliability
        0.00 #-- reliability_factor
        0.00 #-- weight
    }
   
    target_template = {
        weight = 1.0
        match_value = 300.0
       
        support = {
            engineer = 1
            recon = 1
            field_hospital = 1
        }
       
        regiments = {
            infantry = 10
            artillery_brigade = 4
        }
    }
   
    allowed_types = {
        infantry       
        engineer
        recon
        field_hospital
        artillery_brigade
    }
}
And we get this template:
template_working.jpg
Exactly as it should be, according to the target_template.

Now changing only the allowed_types for the improved_infantry_NIC template, to allow additional support companies:

Code:
infantry_NIC = {
    target_width = 20.0
    width_weight = 0.1
    column_swap_factor = 0.5
   
    stat_weights = {
        0.00 #-- default_morale
        0.00 #-- defense
        1.00 #-- breakthrough
        0.00 #-- hardness
        4.00 #-- soft_attack
        0.00 #-- hard_attack
        0.00 #-- recon
        1.00 #-- entrenchment
        0.00 #-- initiative
        0.00 #-- casualty_trickleback
        0.00 #-- supply_consumption_factor
        0.00 #-- supply_consumption
        0.00 #-- suppression
        0.00 #-- suppression_factor
        0.00 #-- experience_loss_factor
        #-- Air Values
        0.00 #-- air_attack
        #-- Common Values
        0.60 #-- max_organisation
        0.40 #-- max_strength
        0.00 #-- build_cost_ic
        0.00 #-- maximum_speed
        0.00 #-- armor_value
        0.20 #-- ap_attack
        0.00 #-- reliability
        0.00 #-- reliability_factor
        0.00 #-- weight
    }
   
    target_template = {
        weight = 0.9
        match_value = 300.0
       
        support = {
            engineer = 1
            recon = 1
            field_hospital = 1
        }
       
        regiments = {
            infantry = 3
        }
    }
   
    allowed_types = {
        infantry       
        engineer
        recon
        signal_company
        field_hospital
        logistics_company
        anti_tank
        military_police
#        artillery
#        anti_air
        rocket_artillery
        anti_tank_brigade
        artillery_brigade
        rocket_artillery_brigade
#        light_tank_destroyer_brigade 
#        medium_tank_destroyer_brigade 
    }

    replace_at_match = 0.4
    replace_with = better_infantry_NIC
    target_min_match = 0.2
}



better_infantry_PAN = {
    target_width = 20.0
    width_weight = 0.0
    column_swap_factor = 0.5
   
    stat_weights = {
        0.00 #-- default_morale
        0.00 #-- defense
        0.00 #-- breakthrough
        0.00 #-- hardness
        0.00 #-- soft_attack
        0.00 #-- hard_attack
        0.00 #-- recon
        0.00 #-- entrenchment
        0.00 #-- initiative
        0.00 #-- casualty_trickleback
        0.00 #-- supply_consumption_factor
        0.00 #-- supply_consumption
        0.00 #-- suppression
        0.00 #-- suppression_factor
        0.00 #-- experience_loss_factor
        #-- Air Values
        0.00 #-- air_attack
        #-- Common Values
        0.00 #-- max_organisation
        0.00 #-- max_strength
        0.00 #-- build_cost_ic
        0.00 #-- maximum_speed
        0.00 #-- armor_value
        0.00 #-- ap_attack
        0.00 #-- reliability
        0.00 #-- reliability_factor
        0.00 #-- weight
    }
   
    target_template = {
        weight = 1.0
        match_value = 300.0
       
        support = {
            engineer = 1
            recon = 1
            field_hospital = 1
        }
       
        regiments = {
            infantry = 10
            artillery_brigade = 4
        }
    }
   
    allowed_types = {
        infantry       
        engineer
        recon
        field_hospital
        logistics_company
        anti_tank
        military_police
        artillery
        artillery_brigade
    }
}
And we get something like this:
template_broken.jpg
The additional support company getting added to the template, even if it is not in the target_template I could put down to me not understanding how the system works / is supposed to work, but I can't imagine the AI freezing the template progression at roughly half the width of the target is working as intended.

To reproduce:
0. Save either the working or broken template file as templates_NIC.txt in /common/ai_templates/
1. Load the test_setup2 savegame
2. Use "tag nic", "human_ai", "ai_force_template"
3. Let the game run for ~2 months

DLC: -
Mods: Only as described in the post.
 

Attachments

  • savegames.zip
    1,8 MB · Views: 0
  • 2
Reactions:
Upvote 0