Defines

本页面适用于最新的版本(2.0)。


Defines are variables that affect many parts of the game that are otherwise often hardcoded (i.e. cannot be changed with a script).

Configuration

Defines are set in game/common/defines/

A mod doesn't need to replace the whole defines file. We can include only the changes we need and name the file something different, e.g. end_date_defines.txt with this code that extends the end date:

NGame = {
    END_DATE = "900.1.1"
}

It is not possible to set new defines. Many of the vanilla defines lack documentation and have to be tested to find out their purpose.

Changes to defines can be reloaded without restarting the game, if you start in debug_mode.

List of defines

00_defines.txt:

Define Notes/description
NGame
START_DATE = "450.10.1"
END_DATE = "727.2.17"
GAME_SPEED_TICKS = { 1 0.75 0.5 0.25 0.0 } how many seconds should a day take in every game speed
COMBAT_TICK_LIMIT = 1
HOTJOIN_TICK_LIMIT = 2
IMPERIAL_GLORY_RANK = 10
SCORE_START_MAX = 500
SCORE_START_BASE = 50
SCORE_START_POP_WEIGHT = 0.45
MIN_MERCENARIES_PER_REGION = 3
MERCENARIES_CITY_THRESHOLD = 50
MERCENARIES_PER_CITY = 0.1
MERCENARY_BASE_AMOUNT = 2
MERCENARY_PER_POP_SCALE = 0.075
MERCENARY_AMOUNT_DEVIATION = 0.15
PIRATE_BASE_AMOUNT = 8
PIRATE_PER_POP_SCALE = 0.05
PIRATE_SIZE_MAX = 18
PIRATE_COOLDOWN_MONTHS = 24
PIRATE_RAIDING_MONTHS = 6
PIRATE_RAID_CHANCE = 0.05
PIRATE_PORTS_TO_RAID = 5
PIRATE_PLUNDER_DURATION = 730
EVENT_TIMEOUT_DAYS = 90
AUTOPEACE_DAYS_SINCE_LAST_BATTLE = 1080 No automatic whitepeace if there's been a battle in the war within this defined amount
STARTING_COHORTS_PER_MANPOWER = 0.2
STARTING_SHIPS_PER_PORT_POPULATION = 0.06
NCountry
MINIMUM_POLITICAL_INFLUENCE = -100
MAXIMUM_POLITICAL_INFLUENCE = 500
STARTING_POLITICAL_INFLUENCE = 100
MAXIMUM_MILITARY_EXPERIENCE = 200
STARTING_MILITARY_EXPERIENCE = 0
MINIMUM_GOLD = -99999
MAXIMUM_GOLD = 99999
NAVAL_BASE_PROXIMITY_THRESHOLD = 500
PIG_STAB_DURATION = 1825
DEVOTIO_DURATION = 1825
STABILITY_BLOCK_THRESHOLD = 20
INTEGRATE_MIN_COST = 10
INTEGRATE_COST_PER_POP = 0.75
MINIMUM_COLONISATION_POP = 8
MAX_COLONISATION_BARB_IN_TARGET = 2
FORT_MAINTENANCE = 0.4
BASE_FORT_LIMIT_PER_STATE = 5
FIRST_FORT_COST_IN_POINTS = 3 Is measured against BASE_FORT_LIMIT_PER_STATE. This applies for the first fort in every province - every other fort in the same province is 1 point towards this limit
LAND_MAINTENANCE_FACTOR = 0.25
NAVAL_MAINTENANCE_FACTOR = 0.2
MERCENARY_MAINTENANCE = 1.5
RETINUE_MAINTENANCE = 0.0
DISBAND_PAYOFF_FACTOR = 0.15
MERCENARY_DEBT_THRESHOLD = 1.0
INNOVATIONS_PER_TECHLEVEL = 1.00
SLAVE_DISTRO_MIN_NUM_OF_STATES = 3 Slaves captured will be distributed to these number of states near the capital plus capital unless there are less states
MAX_RETINUE_MAN_POWER_ALLOCATION = 0.33 How much percentage of max manpower of a country is allocated to retinues
HIGH_AGRESSIVE_THRESHOLD = 50
MAX_INVENTIONS_SAME_TYPE = 3
STATE_LOYALTY_CONQUEST_MODIFIER = 10
MOVE_POP_TO_EMPTY_MONTHS_COOLDOWN = 12
RANK_MIGRANT_HORDE = 0
RANK_CITY_STATE = 1
RANK_LOCAL_POWER = 25
RANK_REGIONAL_POWER = 100
RANK_MAJOR_POWER = 500
LOYAL_TROOPS_MAINTENANCE_FACTOR = 0.66
DISLOYAL_COMMANDER_MAINTENANCE_FACTOR = 0.0
CALL_FOR_PEACE_THRESHOLD_MONTHS = 60
CALL_FOR_PEACE_WARSCORE_LIMIT = 67
MAX_MANPOWER_YEARS = 11
TECH_ENTRY_YEARS = 16
UNREST_MONTHLY_REDUCTION = -0.1
POPS_PER_BUILDING = 10
ALERT_HIGH_WAR_EXHAUSTION = 8
TECH_AHEAD_OF_TIME = -0.12
TECH_BEHIND_OF_TIME = -0.12
OMEN_DURATION = 1825
BASE_CONTROL_RANGE = 650
CIVIL_WAR_STATES_THRESHOLD = 1
CIVIL_WAR_CITIES_THRESHOLD = 2
CIVIL_WAR_MONTHLY_TICK = 5
REVOLT_MONTHLY_TICK = 2.5
LOYALTY_INCREASE_AT_CIVIL_WAR_OR_REBELLION = 50
COUNTRY_PRIMARY_COLOR_LIST = "standard_colors_list"
COUNTRY_SECONDARY_COLOR_LIST = "metal_colors_list"
COUNTRY_TERTIARY_COLOR_LIST = "standard_colors_list"
COUNTRY_COLOR_MIN_SATURATION = 0.35
COUNTRY_COLOR_MAX_SATURATION = 1.0
COUNTRY_COLOR_MIN_VALUE = 0.7
COUNTRY_COLOR_MAX_VALUE = 1.0
COUNTRY_COLOR_DISTANCE_NEIGHBOUR = 0.1
COUNTRY_COLOR_DISTANCE_ORIGIN = 0.25
BASE_RESEARCH = 0.01
BAD_RESEARCH_RATIO = 66 Entirely arbitrary number where we'll want to alert player.
MAX_RESEARCH_EFFICIENCY = 1.25 multiply by 100 to receive initial base max research efficiency. Global modifier is applied on top of this.
BASE_NAVAL_RANGE = 650
POTENTIAL_MISSION_COUNT = 4 Number of random missions to pick between
EXPECTED_DEITY_COUNT = 4 Number of deities each country is expected to have at game start.
CHANGE_PANTHEON_OMEN_COOLDOWN_MONTHS = 36 Cooldown period in months after a country changes it's pantheon. No omens can be called on that deity during this cooldown period.
DEIFIED_RULERS_EXPIRE = 20 Years before a deified ruler that has not been in a pantheon is forgotten and removed
CULTURAL_INTEGRATION_MIN_SPEED = 0.0005
CULTURAL_INTEGRATION_MAX_SPEED = 0.004
CULTURAL_INTEGRATION_FACTOR = 0.02 Multiplied by percentage of integrating culture pops in country to make monthly progress towards cultural integration (1.0)
REVOLT_ALERT_MONTHS_THRESHOLD = 60 highest monthly time until predicted revolts are considered relevant
REVOLT_IMMINENT_MONTHS_THRESHOLD = 24 highest monthly time until predicted revolts are considered relevant
REVOLT_MINIMUM_TREASURY = 200 smallest stash a single revolting state starts with.
MAX_INVENTION_TECH_TREE_DEPTH = 124
MAX_MILITARY_BONUS_TREE_DEPTH = 124
MINIMUM_CIVIL_WAR_DAYS_FOR_AUTORESOLVE = 90
NPowerBase
FROM_TITLE = 2
LOYAL_COHORTS = 100
LOYAL_VETERANS = 5
NON_LOYAL_COHORTS = 30
SHIPS = 10
GOVERNOR_POP = 70
RULER_POP = 20
HOLDINGS = 50
HEAD_OF_FAMILY = 120
MIN_EMPLOYER_UNIT_THRESHOLD = 25 when country is too small, this will be the smallest threshold with which the powerbase will be calculated
MIN_EMPLOYER_SHIP_THRESHOLD = 10 when scountry is too small, this will be the smallest threshold with which the powerbase will be calculated
NPop
PROMOTE_DEMOTE_THRESHOLD = 0.005 percentage above desired ratio before demote.
HAPPYNESS_FOR_UNREST_THRESHOLD = 0.5
PRIMARY_CULTURE_HAPPINESS = 0.3
WRONG_CULTURE_GROUP_HAPPYNESS = 0.12
WRONG_CULTURE_HAPPYNESS = 0.2
WRONG_RELIGION_HAPPNESS = 0
WRONG_GOVERNOR_RELIGION_HAPPYNESS = -0.06
DEITY_SAME_RELIGION_HAPPINESS = 0.04
UNREST_GENERATION = 0.5
UNREST_SCALE = 20 Basically UNREST_GENERATION * UNREST_SCALE..
MIGRATE_MINIMUM = 3
MIGRATE_MAXMIMUM = 20
DEATH_BEFORE_SLAVERY = 0.33
ATTRACTION_DIFFERENCE_THRESHOLD = 2
ATTRACTION_INCOMING_MODIFIER = -0.5
ASSIMILATE_DIFF_RELIGION_PENALTY = -0.33
CONVERT_DIFF_CULTURE_PENALTY = -0.20
CONVERSION_SCALE_PER_MISMATCHED_DEITY = -0.2
NCombat
GREAT_BATTLE_SIZE_THRESHOLD = 8000
MORALE_COLLAPSE_THRESHOLD = 0.25
PERSONAL_LOYALTY_BONUS = 0.1
SHIP_CAPTURE_CATEGORY_IMPACT = 0.1
NAVAL_EXPERIENCE_DAMAGE_REDUCTION = 0.3
LAND_EXPERIENCE_DAMAGE_REDUCTION = 0.3
BATTLE_RESULT_SCALE = 3
BATTLE_RESULT_CAP = 20.0
LAND_STRENGTH_DAMAGE_MODIFIER = 0.2
NAVAL_STRENGTH_DAMAGE_MODIFIER = 0.5
LAND_MORALE_DAMAGE_MODIFIER = 1.5
NAVAL_MORALE_DAMAGE_MODIFIER = 2.5
BASE_MORALE_DAMAGE = 2.0
RETREAT_STRENGTH_DAMAGE = 0.5 Percentage of total Unit Morale
MORALE_HIT_FOR_LATE_DEPLOYMENT = 0.10 Applied to all units that are instantly deployed to the battlefield AFTER your army is already able to retreat
MORALE_HIT_FOR_NON_SECONDARY_REINFORCEMENT = 0.05 Applied to all units that reinforce a battle from behind, but are not designated as the secondary rank unit type
DAYS_PER_PHASE = 5
DAYS_PER_SIEGE_PHASE = 25
DAYS_PER_SIEGE_PHASE_WITHOUT_FORT = 15
COMBAT_DICE_SIDE = 6
COMBAT_BASE = 5
COMBAT_MAX = 15
COMBAT_REBEL_MARTIAL = 7
COMBAT_DAMAGE_MULT = 0.024
LAND_POPULARITY_FACTOR = 0.1
NAVAL_POPULARITY_FACTOR = 0.025
ASSAULT_ATTACKER_LOSS = 1.0
ASSAULT_DEFENDER_LOSS = 0.1
ASSAULT_DICE_MODIFIER = 5
SIEGE_DISEASE_IMPACT = 0.05
SIEGE_MEMORY = 11
SIEGE_WIN = 20
MAX_BREACH = 1
GARRISON_SIZE = 1
ASSAULT_WIDTH_LIMIT = 3
SIEGE_FORCE_NEEDED_MULTIPLIER = 4
EXPERIENCE_GAIN = 40
EXHAUSTION_FROM_GREAT_CONQUEST = 0.1 Per province taken
AE_FROM_GREAT_CONQUEST = 0.75 Great Conquest wars reduce AE by 25%
GREAT_CONQUEST_MONTHS_OF_WAR_MULT = 2 Multiplier on AI acceptance
GREAT_CONQUEST_EXHAUSTION_MULT = 2 Multiplier on AI acceptance
PEACE_ACCEPTANCE_WAR_GOAL_GC = 140
FORT_FLIPPING_TIME = 15
WAR_EXHAUTION_FROM_LOSSES = 1.8 Multiplier on losses
MAX_WAR_EXHAUSTION_FROM_BATTLE = 3.5
SIEGE_SUPPLY_SHORTAGE_LOSS = 0.02
SIEGE_SUPPLY_SHORTAGE_IMPACT = 1
SIEGE_FOOD_SHORTAGE_LOSS = 0.03
SIEGE_FOOD_SHORTAGE_IMPACT = 2
SIEGE_WATER_SHORTAGE_LOSS = 0.05
SIEGE_WATER_SHORTAGE_IMPACT = 3
SIEGE_DEFENDER_DESERTION_LOSS = 0.1
SIEGE_DEFENDER_DESERTION_IMPACT = 2
SIEGE_BREACH_LOSS = 0.05
SIEGE_BREACH_IMPACT = 2
TACTICS_DEFAULT_EFFECTIVENESS = 0.5 If subunit not defined this is the effectiveness constribution it will get
TACTICS_START_EFFECTIVENESS = 0.0 The base line effectiveness the algorithm starts calculating with
TACTICS_EFFECTIVENESS_MIN_CAP = 0.0 Will cap to this in the end of calculation
TACTICS_EFFECTIVENESS_MAX_CAP = 1.0
NHorde
CHARACTER_LOOT_CUT = 0.2
BARBARIANS_TO_SLAVES = 0.1
BARBARIANS_TO_FREEMEN = 0.25
BARBARIAN_POWER_MULT = 1
BARBARIAN_PRIMARY = 0.5
BARBARIAN_SECONDARY = 0.3
BARBARIAN_FLANK = 0.2
BARBARIAN_RANGE = 1000 Distance barbarians may go before getting homesick.
BARBARIAN_CLOSENESS_PREFERENCE = 2 Barbarians' preference to pick a target close to current location.
BARBARIAN_HOME_PREFERENCE = 1 Barbarians' preference to pick a target close to home location.
BARBARIAN_TRIBAL_SPAWN = 0.5
BARBARIAN_TOTAL_SPAWN = 0.1
MIN_BARBARIAN_SPAWN_POWER = 2
BARBARIAN_TO_POWERFUL = 10
BARBARIAN_DISPLACEMENTDIFF = 3
BARBARIAN_DESTROY_CIV_FACTOR = 0.2
BARBARIAN_HORDE_BARBIE_INCREASE =5
BARBARIAN_LOOT_MULT = 5
EXTRA_BARBARIAN_NUM = 5
BARB_REINFORCE_OUTSIDE_SIEGE = 1
NUnit
COHORT_SIZE = 500
ATTRITION_ON_FOOD_CONSUMPTION_IMPACT = 0.1
RAISED_VETERAN_EXPERIENCE = 65
DISBAND_MANPOWER_RESTORE = 0.25
LAND_MORALE = 3.0
NAVAL_MORALE = 3.0
MOVEMENT_LOCKED = 0.5
LOW_MORALE_THRESHOLD = 0.5
ROAD_MOVEMENT_BONUS = -0.5
COHORT_MANPOWER_COST = 1
MONTHLY_REINFORCE = 0.05
MONTHLY_REINFORCE_SELF_CONTROLLED_MULTIPLIER = 2.00
MONTHLY_REINFORCE_ADJACENT_TO_SELF_CONTROLLED_MULTIPLIER = 1.00
MONTHLY_REINFORCE_ENEMY_CONTROLLED_MULTIPLIER = 0.10
MONTHLY_REINFORCE_UNOWNED_NONADJACENT_MULTIPLIER = 0.1
MONTHLY_REINFORCE_UNOWNED_MIGRANT_MULTIPLIER = 0.5
MONTHLY_REINFORCE_NEUTRAL_CONTROLLED_MULTIPLIER = 1.00
MONTHLY_REINFORCE_ADJACENT_TO_FRIENDLY_CONTROLLED_MULTIPLIER = 0.75
MONTHLY_REPAIR = 0.1
MERCENARY_REINFORCE_MULT = 0.33 Each cohort raised will take food from its origin province to feed itself for the number of months specified here
INITIAL_FOOD_RESERVES_IN_MONTHS = 3
LOCKED_MORALE_CAP = 0.5
LOW_FLANK_SIZE = 2
MID_FLANK_SIZE = 5
HIGH_FLANK_SIZE = 10
LEADER_ASSIGN_MIN_MONTHS = 12
OUTSIDE_OF_NAVAL_RANGE_ATTRITION = 4.0
NAVAL_ATTRITION_CHANCE = 0.4 Sub-units are not added into this from code. So as long as the average per unit is above or equal to this number everything works. for 0.1 with engineers adding 1.0 that's 1 engineer supporting 10 cohorts
WATERCROSSING_NEGATION_REQUIRED_PER_COHORT = 0.1
WATERCROSSING_PENALTY_FOR_RIVER = 1
WATERCROSSING_PENALTY_FOR_STRAIT = 2
WATERCROSSING_PENALTY_FOR_SHORE = 2
NPolitics
SENATE_SIZE = 100
PARTY_DEFAULT_APPROVAL = 50
SENATE_REQUIRED_APPROVAL = 0.30
SENATE_REQUIRED_APPROVAL_WITHOUT_PENALTIES = 0.51
NEUTRAL_SENATE_APPROVAL = 0.4
ENDORSE_PARTY_SEATS = 10
ENDORSE_PARTY_CAP = 50
LEGITIMACY_ENDORSEMENT_DURATION = 1825
SENATE_RED_THRESHOLD = 40
SENATE_GREEN_THRESHOLD = 51
STAB_HIT_BARB_TAKEOVER = 20
STAB_HIT_GOOD_PEACE = 5 Pretender support: Max(0, (PRETENDER_LOYALTY_BASE - GetLoyalty()) * PRETENDER_LOYALTY_MULTIPLIER)
Example: 50 / 0.5 with Loyalty: 30 = (50 - 30) * 0.5 = 10
Example: 50 / 0.5 with Loyalty: 80 = (50 - 80) * 0.5 = 0 ( -15 )
PRETENDER_LOYALTY_BASE = 50
PRETENDER_LOYALTY_MULTIPLIER = 0.5
NDiplomacy
AUTO_TIME_OUT_MONTHS = 2
PEACE_AUTO_ENFORCE_BASE_DAYS = 365
PEACE_AUTO_ENFORCE_RANK_DAY = 180
MIN_WARSCORE_TO_DEMAND = 10
PEACE_SEPERATE_BLOCK_MONTHS = 36
PEACE_CLAIM_AE_REDUCTION = -0.5 AE reduction if the taker has a claim
PEACE_SUBJECT_AE_REDUCTION = -0.5 AE reduction if it is taken for a subject
PEACE_AE_INCREASE_FOR_NON_TARGET = 0.33 AE increase for countries that are not main targets of the war
PEACE_COST_MODIFIER_FOR_REVOLT_WAR = -0.95 Applied against a revolt war opponent
PEACE_COST_MODIFIER_FOR_NON_TARGET = 0.33 Applied for countries that are not the main targets of the war
PEACE_COST_MODIFIER_FOR_CLAIM = -0.33 Applied if the taker has a claim
PEACE_COST_MODIFIER_FOR_SAME_CULTURE = 0.10 Applied if dominant culture in province is the same as taker's primary culture
PEACE_COST_MODIFIER_FOR_SAME_RELIGION = 0.10 Applied if dominant religion in province is the same as taker's religion
INTERVENE_OPINION_THRESHOLD = 100
DIPLOMATIC_RANGE = 800
OPINION_MIN = -200
OPINION_MAX = 200
SUBJECT_AE_FACTOR = 0.5
TRAVEL_DAYS = 30
TRIBUTE_MIN_RELATION = 100
TRANSFER_VASSAL_MIN_RELATION = 80
MAX_TRIBUTE_TREASURY_DEFICIT = -100.0
ANNEX_MIN_RELATION = 190
ANNEX_MIN_YEARS_WITH_TRIBUTE = 10
MONTHS_BEFORE_TOTAL_OCCUPATION = 60 Before this many months have passed in the war, you cannot gain 100% warscore by just occupying the warleader
DEFAULT_WARGOAL_TICKINGWARSCORE_BONUS = 1 Amount of warscore per month since attacker/defender started getting the bonus for completing war goal
WARGOAL_MAX_BONUS = 25
DEFAULT_WARGOAL_BATTLESCORE_BONUS = 3 Battle score bonus from winning battles
SUPERIORITY_WARGOAL_WARSCORE_THRESHOLD = 10 Needed battle score for getting ticking war score for war goal superiority
WARSCORE_MAX_FROM_BATTLES = 40 maximum amount to get from a battles .
WAR_JOIN_DEADLINE_MONTHS = 12
TRUCE_YEARS = 3
SCALED_TRUCE_YEARS = 5
REVANCHISM_MONTHLY_DECAY = 0.833
CASUS_BELLI_MONTHS = 60
AE_IMPACT_ON_OPINION = -4
PEACE_RELEASE_NATION_FACTOR = 0.5
PEACE_CANCEL_SUBJECT_FACTOR = 0.5
OPINION_GOOD_RELATIONS = 50 Threshold for good relations -1 stab hit.
OPINION_GREAT_RELATIONS = 100 Threshold for great relations -2 stab hit.
OPINION_NO_WAR = 100 Threshold for being unable to declare war because one's own opinion of enemy is too high.
IMPROVE_RELATION_SUBJECT_FACTOR = 2 Subjects have a maximum this times higher.
MAX_WARSCORE_REDUCTION = -0.95 Warscore reduction cannot go below -95%
NSuccession
REPUBLIC_POPULARITY_DIV = 200
REPUBLIC_PROMINENCE_DIV = 200
REPUBLIC_PRESTIGE_DIV = 4000
REPUBLIC_PRESTIGE_CAP = 0.2
REPUBLIC_NOT_SAME_PARTY = -0.4
REPUBLIC_PARTY_LEADER = 0.5
REPUBLIC_FRIEND_PARTY_LEADER = 0.25
REPUBLIC_FAMILY_PARTY_LEADER = 0.1
REPUBLIC_RIVAL_PARTY_LEADER = -0.25
REPUBLIC_WRONG_RELIGION = -0.25
REPUBLIC_WRONG_CULTURE = -0.25
REPUBLIC_NOT_ALLOWED_OFFICE = -0.8
REPUBLIC_DISLOYAL = -0.5
COGNATIC_FEMALE_PENALTY = -0.5
EGYPTIAN_FEMALE_PENALTY = -0.5
FALLBACK_FEMALE_PENALTY = -0.50
FALLBACK_CHILD_PENALTY = -0.5
FALLBACK_FAMILY = 2
FALLBACK_POPULARITY_DIV = 500
FALLBACK_PROMINENCE_DIV = 100
FALLBACK_PRESTIGE_DIV = 400
FALLBACK_PRESTIGE_CAP = 2.0
FALLBACK_AGE_DIV = 40
TRIBAL_CLAN_CHIEF = 100
TRIBAL_MARTIAL = 2.0
TRIBAL_CHARISMA = 1.5
TRIBAL_FINESSE = 1.0
TRIBAL_ZEAL = 1.0
TRIBAL_CHILD_PENALTY = -0.9
TRIBAL_FEMALE_PENALTY = -0.9
TRIBAL_SAME_FAMILY_PENALTY = -0.5
TRIBAL_MINOR_CHARACTER_PENALTY = -1.0
ELECTIVE_CHARISMA_MULTIPLIER = 5
NCharacter
TRAIT_GENERATION_CAP = 2
TRAIT_MILITARY_LIMIT = 1
TRAIT_PERSONALITY_LIMIT = 2
MIN_HOLDINGS_FOR_POWER_BASE = 5
HOLDING_BASE_MULTIPLIER = 0.25 % of Provincial income that a holding will grant to its owner
BASE_LOYALTY_GAIN_CHANCE = 0.5
LOYALTY_GAIN_OUTSIDE_COMBAT = 0.1
INITIAL_MARRIAGE_COUNT = 2
DISLOYALTY_THRESHOLD = 50
INFANCY_MAX_AGE = 5
AGE_OF_ADULTHOOD = 16
BASE_DOWRY = 0.05
MAX_DOWRY = 0.1
UNEQUAL_INHERITANCE_MULTIPLIER = 2
MAIN_HEIR_INHERITANCE_MULTIPLIER = 2
MAX_CHILD_BIRTH_AGE = 45
CHILD_BIRTH_TO_PREGNANCY_WAIT = 36
BASE_NR_OF_CHILDREN_PER_COUPLE = 2
ADDITIONAL_CHILD_PROMINENCE_THRESHOLD_1 = 18
ADDITIONAL_CHILDREN_FOR_PROMINENCE_THRESHOLD_1 = 0
ADDITIONAL_CHILD_PROMINENCE_THRESHOLD_2 = 80
ADDITIONAL_CHILDREN_FOR_PROMINENCE_THRESHOLD_2 = 0
ADDITIONAL_CHILDREN_FOR_KING = 2
ADDITIONAL_CHILDREN_FOR_HEIR = 1
IDEAL_CHILD_PER_FAMILY = 4 If court isze is bigger than threshold, reduce the number of children per couple by the define below
COURT_SIZE_CHILD_PENALTY_THRESHOLD = 120
SUBTRACTION_CHILDREN_COURT_SIZE_PENALTY = 1 Make sure we always have a base minimum of characters for each gender. Only creates new characters however if the number of children is below the threshold
MIN_ADULT_CHARACTERS_PER_GENDER = 10
MIN_ADULT_CHARACTERS_PER_GENDER_CREATION_CHILDREN_THRESHOLD = 4
SPOUSE_CREATION_MAXIMUM_AGE = 25 Only applies to women. If the female character is above this age, they will never be considered for automatic marriage
SPOUSE_MOURNING_DURATION = 90 in days
INHERIT_RECESSIVE_GENE_CHANCE = 0.25
TOO_DISLOYAL_THRESHOLD = 33
LOYAL_COHORT_INHERITANCE_CHARISMA_CHECK = 8 A random number modulo this define to check if the primary heir inherits loyal cohorts. Basically if the heir's charisma is equal to this number, it will never fail this check
COURT_SIZE_AGE_FILL = { 16 60 } when filling the initial court, characters get created using this age range
BASE_FERTILITY = 0.07
MAX_FERTILITY = 0.15
INHERIT_CHANCE_COUNTRY_CHARISMA = 20
MAX_TOOLTIP_SIZE_FAMILY_LIST = 25
FEMALE_CREATION_AGE_START = 16
FEMALE_CREATION_AGE_END = 26
MALE_CREATION_AGE_START = 18
MALE_CREATION_AGE_END = 35
WRONG_RELIGION_MAX_LOYALTY = -10
FRIEND_WITH_RULER_PARTY_CONVICTION = 0.1
RIVAL_WITH_RULER_PARTY_CONVICTION = -0.1
FRIEND_WITH_PARTY_LEADER_PARTY_CONVICTION = 0.1
RIVAL_WITH_PARTY_LEADER_PARTY_CONVICTION = 0.1
INITIAL_CONVICTION_TICKS_IN_MONTHS = 120
MIN_STATESMANSHIP_EFFECT = 20
MIN_STATESMANSHIP_OFFSET = 0
MAX_STATESMANSHIP_OFFSET = 10;
CULTURE_HAPPINESS_UPPER_THRESHOLD = 0.3 Upper threshold for culture happiness. If Culture happiness > CULTURE_HAPPINESS_UPPER_THRESHOLD + CULTURE_HAPPINESS_THRESHOLD , character loyalty will be positively affected
CULTURE_HAPPINESS_LOWER_THRESHOLD = 0.3 Lower threshold for culture happiness. If Culture happiness < CULTURE_HAPPINESS_LOWER_THRESHOLD - CULTURE_HAPPINESS_THRESHOLD , character loyalty will be negatively affected
CULTURE_HAPPINESS_FACTOR = 3 Scale culture happiness to loyalty after exceeding threshold
CULTURE_HAPPINESS_LOYALTY_MAX = 12 Max/min values that culture happiness can have on loyalty
NFamily
EXPECTED_JOB_PERCENTAGE = 0.7 (TOTAL_JOBS / NUM_FAMILIES) * EXPECTED_JOBS_PERCENTAGE
GRATEFUL_JOB_PERCENTAGE = 2 current jobs > (expected jobs * GRATEFUL_JOBS_PERCENTAGE)
MIN_SIZE = 4; below this size the family will look desperately into adopting minor characters
MAX_SIZE = 18; above this size the family won't look into adopting minor characters anymore
FAMILY COUNT
FAMILY_COUNT_MIGRANT_HORDE = 3;
FAMILY_COUNT_CITY_POWER = 3;
FAMILY_COUNT_LOCAL_POWER = 3;
FAMILY_COUNT_REGIONAL_POWER = 4;
FAMILY_COUNT_MAJOR_POWER = 4;
FAMILY_COUNT_GREAT_POWER = 5;
MINOR_POOL_MIGRANT_HORDE = 5;
MINOR_POOL_CITY_POWER = 6;
MINOR_POOL_LOCAL_POWER = 6;
MINOR_POOL_REGIONAL_POWER = 8;
MINOR_POOL_MAJOR_POWER = 12;
MINOR_POOL_GREAT_POWER = 17;
MAX_MINOR_CHARACTER_YEARLY_GROWTH = 2;
MINOR_FAMILY_COURT_MULTIPLIER = 0.15 creates a larger minor pool
Family colors
COLOR_DEFAULT = { 0.85490 0.81569 0.80784 0.3 } grey
COLOR_1 = { 0.435294 0.741176 0.776471 1 } Blue
COLOR_2 = { 0.843137 0.701961 0.384314 1 } Yellow
COLOR_3 = { 0.811765 0.337255 0.254902 1 } Red
COLOR_4 = { 0.380392 0.788235 0.470588 1 } Green
COLOR_5 = { 0.776471 0.403922 0.658824 1 } violet
COLOR_6 = { 0.0 0.65 0.65 1.0 } teal
COLOR_7 = { 0.89 0.26 0.20 1.0 } vermillion
COLOR_8 = { 1.0 0.75 0.0 1.0 } amber
COLOR_9 = { 0.5 0.85 0.0 1 } chartreuse
COLOR_10 = { 0.5 0.0 1.0 1.0 } violet
NReligion
HOLY_SITE_INCREASED_EFFECT = 0.25
MAX_ACTIVE_TREASURE_SLOTS = 3
NTrade
SLAVE_POPS_TO_PRODUCE_EXTRA = 20
MINIMUM_SLAVES_PER_GOOD = 3
ROUTE_BASE_INTERNAL_COMMERCE = 0.2
ROUTE_BASE_EXPORTING_COMMERCE = 1
ROUTE_BASE_IMPORTING_COMMERCE = 0.35
NProvince
ENSLAVEMENT_MONTHS_COOLDOWN = 60
LOOT_HORDE_WEALTH_FACTOR = 2.0
LOOT_COMMANDER_WEALTH_FACTOR = 2.5
DESTROY_BUILDING_MONEY_RETURN = 0.25
GOVERNOR_WAGE_TO_WEALTH = 1.0 additional efficiency for supply limit. BaseSupplyLimit() * (1.0 + efficiency)
these are mutually exclusive
SUPPLY_LIMIT_OWNER = 0.25 Should be highest of these defines or AI will be confused.
SUPPLY_LIMIT_ACCESS = 0.1
SUPPLY_LIMIT_ALLY = 0.1
SUPPLY_LIMIT_CONTROLLER = 0.1
OCCUPY_PROMINENCE_GAIN = 8.5
OCCUPY_COMMANDER_WEALTH_FACTOR = 25
DEFAULT_FOOD_CAPACITY = 0
STARVATION_IMMINENT_WARNING = 100
DISLOYAL_STATE_WARN_MONTHS = 3
TOO_DISLOYAL_THRESHOLD = 33
REVOLT_LOYALTY_THRESHOLD = 0
DEFAULT_TERRAIN_LAND = plains
DEFAULT_TERRAIN_WATER = ocean
NBuilding
POPULARITY_FROM_CONSTRUCTION = 5.0
FAMILY_PRESTIGE_FROM_CONSTRUCTION = 10.0
NGreatWork
GW_BASE_CONSTRUCTION_SPEED = 1
GW_NUMBER_OF_EFFECTS = 3
GW_BASE_PRESTIGE_GAIN = 1.5 These two defines need the same amount of entries and are linked by index. So freemen have a base GW production rate of 0.006. However modifiers that modify these values can only be used with the types here, as they are hardcoded
GW_WORKING_POPS_TYPES = { "freemen" "tribesmen" "slaves" }
GW_WORKING_POPS_BASE_PRODUCTION = { 0.006 0.005 0.003 }
GW_WORK_COST_SCALEFACTOR = 1
GW_DEFAULT_AI_TEMPLATE_DEBUG = "great_work_template_09"
GW_BASE_LEADER_BUILDPOWER_PERCENT = 5 Having a leader with finesse increases buildpower by (GW_BASE_LEADER_BUILDPOWER_MULTIPLIER * finesse)%
GW_NO_LEADER_BUILDPOWER_MULTIPLIER = 0.75 Having no no leader scales buildpower by GW_NO_LEADER_BUILDPOWER_MULTIPLIER
GW_LEADER_ASSIGNMENT_COOLDOWN_DAYS = 31
GW_CUSTOM_NAME_MAX_LENGTH = 24
GW_MAX_NUMBER_OF_COMPONENTS = 3
NJominiMap
WORLD_EXTENTS_X = 8191
WORLD_EXTENTS_Y = 25.5
WORLD_EXTENTS_Z = 4095
WATERLEVEL = 3.9
NAI
MAX_AREA_INNER_DEPTH = 15 This value denotes the maximum depth needed to go from any one province to another within the same area. It is used for the optimization of certain pathfinding. If your mod changes the map, do make sure to change this value. It can be obtained by running `Map.CalcAreaInnerDepth` in the console
MAX_AREA_INNER_PATH = 22 This value denotes the longest distance from any one province to another within the same area. It is used for the optimization of certain pathfinding. If your mod changes the map, do make sure to change this value. It can be obtained by running `Map.CalcAreaInnerPath` in the console
MAX_DEPTH_SEARCH_FOR_NAVAL_INVASION = 5 How far the AI will search for a shore from land for naval invasions to reachable targets
Buildings
BUILD_DURING_WAR_DELAY = 4 Months the AI will wait before building buildings while at war
BUILD_MONTHS_AWAY_FROM_WAR_THRESHOLD = 2 If the AI is less than this number of months away from declaring war they will hold building construction
BUILD_TROOPS_DELAY = 60 Delay added to the build counter if the AI wants to build troops, effectively prioritizing troop construction
BUILD_REPEAT_TIME = 100 Time window ( in days ) since last build date that the AI has to quickly queue another building to the front of the plan ( if it can afford it etc. ), else it will be queued at the end
BUILD_INSTANT_GOLD_THRESHOLD = 800 If the AI has more than this much gold left after construction it will try to instantly queue another build
BUILD_DELAY = 30 Default time the AI will wait before trying to build another building unless it decides to do so instantly
DESTROY_THRESHOLD = 0.0 If the AI weight of any building is less than or equal to this the AI might destroy it
PORT_BUILDING_COASTAL_NO_PORTS_WEIGHT = 0 If the Country has coastal provinces but no ports this will be added
Performance and search
MAX_UNITS_PER_TURN = 125 Higher => more responsive unit AI on average, more CPU. Use "ai.pawns" and "timing show" console commands to tune.
TACTICAL_DEPTH = 60 Depth of tactical search.
IDLE_DEPTH = 12 Depth of tactical search while idle can be reducd to this.
FRIEND_DEPTH_COST = 2 Depth cost in friendly territory.
ENEMY_DEPTH_COST = 3 Depth cost in enemy territory.
DEFAULT_DEPTH_COST = 5 Depth cost in other cases.
NAVAL_DEPTH_COST = 2 Depth costf for navies.
TARGET_PRIORITIZATION_DIST = 80 Within this distance AI prefers to pick fresh targets (weight).
HUNTER_KILLER_PRIORITIZATION_DIST = 120 Within this path distance AI prefers to choose chase over siege as vice versa for Hunter Killer.
SEA_ACCESS_DEPTH = 4 Search depth over sea provinces for e.g. incresed prio to take coastal provinces. (Divided by 2 for local powers.)
SEA_POTENTIAL_ACCESS_DEPTH = 4 Search depth over sea provinces for e.g. to declare wars. (Divided by 2 for local powers.)
POTENTIAL_ACCESS_BORDER_DISTANCE = 250 Max border distance for "potential" access lists. Impacts mainly range who AI allies due military access.
RIVER_CROSS_COST = 1.6 In tactical only (not A*).
STRAIT_CROSS_COST = 3.2 In tactical only (not A*).
ENEMY_CROSS_COST = 4 In tactical only (not A*). Multiplier for river/strait cost when an enemy is across river or strait.
ALLY_NEIGHBOR_ORDER = 3 Separate check: Recursively iterate of neighbors this many time to generate a list of permitted allies. Countries with ports or adjacent to countries with ports are excluded.
DEFENSIVE_LEAGUE_NEIGHBOR_ORDER = 2
STRIKE_TEAM_DEPTH = 8 How far strike teams can be composed.
STRIKE_TEAM_ADVANTAGE = 2 Advantage over enemy before AI contemplates splitting up strike teams into more.
STRIKE_TEAM_SUPPORT_RANGE = 100 Max range a strike team leader is allowed to count friendly units for purposes of attacking.
STRIKE_TEAM_TARGET_DECAY_WAR = 20 Monthly decay rate in % for strike team target strength (based on previously observed enemies in vicinity) while at war.
STRIKE_TEAM_TARGET_DECAY_PEACE = 30 Monthly decay rate in % for strike team target strength (based on previously observed enemies in vicinity) while at peace.
OVERCROWD_LIMIT = 5.25 AI tries to heavily avoid a ratio of friendly units to enemies above this. Recommend to keep above STRIKE_TEAM_ADVANTAGE.
REGION_PROVINCE_TARGET_LAND = 40 This sets a target size for land AI regions. ("ai.map region", "mapmode ai" in console to see these.) Greatly impacts how AI plays so edit with care.
REGION_PROVINCE_TARGET_SEA = 22 This sets a target size for sea AI regions. ("ai.map region", "mapmode ai" in console to see these.) Greatly impacts how AI plays so edit with care.
OPERATIONAL_DEPTH = 6 How far from existing controlled territory AI normally considers starting sieges (exceptions such as war goal excluded).
Objectives
MAX_RECON_DISTANCE_ARMY = 900000
MAX_RECON_DISTANCE_NAVY = 400
INVASION_REGRET_YEARS = 6 Number of years that AI feels regret over a failed invasion and vows to use more forces.
INVASION_REGRET_BOOST = 300 Additional % of troops AI will try to send as the result of a failed invasion.
INVASION_MIN_LAND_PATH_FOR_NAVAL_TRANSPORT = 1200 If an army can walk less than this distance to goal, don't use naval transport.
Planning
FAST_PLANNED_WAR_MONTHS = 24 Increasing this makes AI more tolerant of choosing long wars.
MAX_PLANNED_WAR_MONTHS = 70 AI will not plan for wars that are expected to take longer than this to be able to declare. It is also the deadline for the war declaration.
MAX_WAR_DIFFICULTY_INCREASE = 100 % more difficult the war is allowed to be at the deadline than at its inception.
TRADITION_LOOKAHEAD = 4 How many traditions ahead does AI look when weighting their effects multiplicatively (also applies to script weights).
REPICK_IDEAS_INTERVAL_MONTHS = 60 How often the ai will reconsider its current national ideas. Does not affect filling empty idea slots which is done as soon as possible.
WAR_LATENCY_WEIGHT = 100 Delaying planned wars is typically undesirable. This is an actual multiplier to latency.
PREDICTED_AT_WAR_THRESHOLD = 3 Months before the AI believes it will be in a planned war. AI will raise levies and take precautions below this threshold
Misc.
TUTORIAL_RANGE = 500 Distance from player capital various interactions are possible in tutorial.
TUTORIAL_TROOP_MAX = 0.4 Number of regiments times max manpower AI is allowed to build in tutorial.
HISTORICAL_UNIT_FACTOR = 20 Multiplier for AI selecting a unit on the basis that it's scripted in [Primary Culture]. For no effect, leave at 1.
FOG_OF_WAR_FORGET_CHANCE = 1 Chance of AI forgetting a unit in FoW.
MAX_ENDORSEMENT_TYRANNY = 5
MAX_ENDORSEMENT_STABILITY = 35 Economy
EXPENDITURE_DECAY_FACTOR = 0.9 Monthly
EXPENDITURE_SOFT_FACTOR = 0.5
NAVY_BUDGET = 25 Max fixed cost per month in percent.
ARMY_BUDGET = 35
ARMY_BUDGET_MANPOWER_REDUCTION = 20 Percent of reduction in max army size for building troops due to manpower pool getting empty.
FORT_BUDGET = 25
MAX_FORT_DISTANCE_CALCULATION = 3
WAR_BUDGET_MULTIPLIER = 1 Don't go over budget any more, it's very hard to climb back down w/ legions
DEFICIT_YEARS = 25 How long does AI plan to run a deficit when distressed.
LEGITIMACY_TARGET = 90 Amount of desired legitimacy AI will try to reach
STABILITY_TARGET = 45 Amount of desired Stability AI will try to reach
Battle
BATTLE_WEIGHT_MARTIAL = 0.15 How much martial stat matters according to AI.
BATTLE_WEIGHT_TERRAIN = 0.4 How much terrain defensiveness stat matters according to AI.
RETINUE_IGNORE_PECENTAGE = 20 Ignore enemy understrength retinues up to this percentage unless absolutely massive still.
MANPOWER_ASSAULT_PERCENTAGE = 30 AI must have manpower above this percentage to assault (mercenary heavy sieges excluded).
RETREAT_MAX_MORALE = 50 If having morale above this percentage, don't retreat.
RETREAT_ARMY_INFERIORITY = 0.2 Retreeat only if enemy is 5 to 1 in strength. Retreating with armies is much more severe than navies.
RETREAT_NAVY_INFERIORITY = 0.5 Retreeat only if enemy is 2 to 1 in strength.
RETREAT_TERRAIN_IMPORTANCE = 1 Scale factor to alter default impact of terrain variations.
IGNORE_STRENGTH_RATIO = 0.15 AI mostly ignores enemies this much smaller than themselves in terms of prioritization.
Forts
PLACE_FORT_BORDER_FACTOR = 2 Is on border 1/0 multiplied by this.
PLACE_FORT_COAST_FACTOR = -1.5 Is on cost 1/0 multiplied by this.
PLACE_FORT_PORT_FACTOR = 1 Is on cost 1/0 multiplied by this.
PLACE_FORT_DISTANCE_FACTOR = 2 Distance in provinces to nearest fort multiplied by this.
PLACE_FORT_CAPITAL_FACTOR = 2 Capital 1/0 multiplied by this.
PLACE_FORT_TERRAIN_FACTOR = 1 Def bonus multiplied by this.
PLACE_FORT_RIVER_FACTOR = 1 River 1/0 multiplied by this.
PLACE_FORT_LEVEL_FACTOR = 0.75 Existing fort level multiplied by this.
PLACE_FORT_PROVINCE_CAPITAL_FACTOR = 10 Forts in province capitals.
PLACE_FORT_PROVINCE_VALUE_FACTOR = 6 Forts in province capitals relative to value of province.
PLACE_FORT_LOCAL_UNREST_FACTOR = 1.25 Multiplied by local unrest
PLACE_ROAD_MIN_DISTANCE = 2 Minimum distance from one road endpoint to another.
DISBAND_FORTS_CAPITAL_BIAS = 1.5 More likely to choose Forts in capital city to disband first
Recruitment
RECRUIT_THREAT_FACTOR = 1.0 Scale threat by this factor when considering for recruitment.
RECRUIT_TERRAIN_FACTOR = 0.25 Scale terrain defensiveness by this factor when considering for recruitment.
RECRUIT_AREAL_BALANCE_FACTOR = 4.0 Scale balance urgency in is_in_area by this factor when considering for recruiment. (Urgency is highest when balance is close.)
RECRUIT_WAR_TARGET_FACTOR = 0.5 Limit for factor for how much distance to war target capital can alter score. Set to 0 for no limit, or to 1 to disable entirely.
RECRUIT_WAR_TARGET_FACTOR_BASE = 500.0 Base distance for above. Factor = Max( RECRUIT_WAR_TARGET_FACTOR, 1 / (RECRUIT_WAR_TARGET_FACTOR_BASE + Distance) ).
RECRUIT_TO_DISTANCE = 300 AI will not use Recruit to Unit over distances longer than this.
RECRUIT_UNITS_PERCENTAGE = 0.2 Percentage of total number of units to recruit in a single action
RECRUIT_SUPPORT_FOOD_MONTHS = 18 Target months of food for an army.
MIN_NUMBER_LEGIONS = 1 AI will always try to have at least this number of Legions
RECRUIT_MERC_SAFETY_EAGERNESS = 0.85 Safety Eagerness can range from 0 to 1.0 with 1.0 being totally safe. This is calculated based on how many forts and provinces the AI has lost during the war and also factors in enemy strength. AI will want to recruit mercs if the safety value falls below this
Unit composition (make sure they all sum up to 1.0)
MAX_FLANK = 0.2 Max % flanking units (to be kept at country wide basis and if possible on army basis)
MAX_FRONT = 0.4
MAX_SECONDARY = 0.4 Diplomacy
AE_MIN = 20 AI starts being hawkish when AE has reached this value plus its own AE value.
AE_MAX = 50 AI becomes particularly hawkish when AE has reached this value on harder difficulties.
AE_CARE = 25 AI usually waits for around this AE or a somewhat higher value before declaring a war.
ALLIANCE_BREAK_WARNING_MONTHS = 6 Months of warning prior to alliances/defensive leagues breaking.
TRADE_REQUEST_ACCEPTANCE = 200 Scaling of AI's "good/bad for us" acceptances.
DEFENSIVE_LEAGUE_COMMON_THREAT_THRESHOLD = 1.1 AI will only form defensive leagues when the common threat factor is at least this big (not same scale as common threat acceptance, 1 = "as scary as us").
EXPANSION_CONSTRICTION_RANGE = 65 AI is extra careful about allying within this border distance.
Peace
MAX_CALL_FOR_PEACE = 20 Start worrying about peacing ASAP above this value. 0-100 value, tho WE from it is capped at usual level.
PEACE_RESPITE_MONTHS = 6 Anti-ragequit device applied to human player on Easy and Normal; don't DOW them if they had no time to rest.
PEACE_ACCEPTANCE_SEPARATE_PEACE = -25 Modifier for peacing out separatately in the cases that's despicable.
PEACE_ACCEPTANCE_MONTHS_OF_WAR = 48 Maximum months of war (and coincidentally, maximum modifier).
PEACE_ACCEPTANCE_MONTHS_OF_WAR_GW = 100 Max months of war for Great Conquests
PEACE_ACCEPTANCE_EXHAUSTION = -10
PEACE_ACCEPTANCE_DESPERATION = -10
PEACE_ACCEPTANCE_WAR_BALANCE_MINUS = 30 Scaling for negative enthusiasm/positive acceptance. Underlying factor has been squared so as long as balance isn't completely uneven this will be far closer to 0.
PEACE_ACCEPTANCE_WAR_BALANCE_PLUS = 80 Scaling for positive enthusiasm/negative acceptance. Underlying factor has been squared so as long as balance isn't completely uneven this will be far closer to 0.
PEACE_ACCEPTANCE_WAR_BALANCE_CAP = 50 After scaling, absolute value of war balance acceptance is limited by this. (Due to scaling from unity, the effective min/max can be lower.)
PEACE_ACCEPTANCE_WAR_GOAL = 15
PEACE_ACCEPTANCE_CAPITAL = 5
PEACE_ACCEPTANCE_DIRECTION = 15
PEACE_ACCEPTANCE_SUBSTANTIAL_LAND_PERCENTAGE = 40 Percentage of cities lost for treaty demand to be classified as "substantial". Set to above 100 to effectively disable.
PEACE_ACCEPTANCE_SUBSTANTIAL_LAND_LOSS = -20 if we are losing a lot of land, be less accepting of the deal
PEACE_ACCEPTANCE_OFFERED_WAR_GOAL = 20 if offered wargoal, be more accepting of the deal
PEACE_ACCEPTANCE_DUE_TO_REVOLTER = -20 revolting countries are less likely to accept peace
PEACE_ACCEPTANCE_EXHAUSTION_GC = 100 CTA
CTA_ACCEPTANCE_WAR_BALANCE_MINUS = 80 Scaling for negative acceptance. Underlying factor has been squared so as long as balance isn't completely uneven this will be far closer to 0.
CTA_ACCEPTANCE_WAR_BALANCE_PLUS = 40 Scaling for positive acceptance. Underlying factor has been squared so as long as balance isn't completely uneven this will be far closer to 0.
Allies
ALLY_VALUE_TARGET_DISTANCE_WEIGHT = 3 Value of (inverse) distance to target for candidate ally.
ALLY_VALUE_SELF_DISTANCE_WEIGHT = 2 Value of (inverse) distance to self for candidate ally.
ALLY_VALUE_ALLY_DISTANCE_WEIGHT = 1 Value of (inverse) distance to existing allies for candidate ally.
Opinions
OPINION_NO_WAR = 125 AI will never plan wars against a country with opinion being at least this level.
OPINION_BREAK_ALLIANCE = -25 AI will break alliances when opinion has reached the level or below.
OPINION_NO_SUPPORT = -10 AI can try to assist a country for purposes of stopping an aggressor. This should be above OPINION_BREAK_ALLIANCE.
OPINION_REASONS_FOR_MILITARY_ACCESS = 30 Acceptance reasons AI can choose to reach with opinion to gain military access.
OPINION_REASONS_FOR_NEIGHBOR_MILITARY_ACCESS = 40 Acceptance reasons AI can choose to reach with opinion to gain military access in immediate neighbors.
Personality
NO_TREACHERY_TRUSTWORTHINESS = 50 Above this trustworthiness, AI may not even insult you to reduce their opinion of you or support rebellion, etc.
Spam
OFFER_MINIMUM_MONTHS = 12 Minimum months until AI may resend a similar offer to a human country. Note that there is also a probabilistic reduction model additionally, so this can be rather low.
OFFER_EMISSION_BASE = 0.01
OFFER_EMISSION_ADAPT = 0.15
OFFER_EMISSION_DECAY = 0.07
START_DATE_DIPLOMACY_REDUCTION_MONTHS = 12 AI does war declarations and some other diplo actions less frequently during these months.
War declarations
WAR_NEIGHBOR_FACTOR = 10 Scaled weight to declare war on neighbors.
WAR_TARGET_NEIGHBOR_FACTOR = 7 Weight to declare on a target adjacent to a past or present target.
WAR_INNER_FACTOR = 40 Scaled weight to declare war on inner countries (e.g. OPMs) inside AI country.
WAR_NEXT_TO_ENEMY_FACTOR = 5 Scaling weight for target next to enemy being fought.
WAR_EASY_FACTOR = 400 Actually a term, but w/e.. The easier war is expected to be, the more likely AI is to schedule it. Even war will be about 0.5^2 of this value.
WAR_QUICK_FACTOR = 120 To be extra confusing, here is another factor for the (not quite) same thing.
WAR_DECISIVE_FACTOR = 12 Extra extra confusing (but a decisive war is not as good as a quick war, but this could be erroneous ;-)).
WAR_ACCESSIBLE_FACTOR = 30 Scaled weight to declare war on accessible countries.
WAR_BORDERGORE_FACTOR = 0.35 The higher this value is the more AI prioritizes targets based on how less likely conquering their provinces is to cause bordergore and snakes. Not really a factor in the multiplicative sense.
WAR_CASUS_BELLI_FACTOR = 4 Scaled weight for having temporary CB.
WAR_CLAIM_FACTOR = 6 Scaled weight for having permanent CB/claim.
WAR_OPPORTUNISM_FACTOR = 0.3 Separate code path for reactive war declarations.
WAR_POWER_FACTOR = 0.012 Separate code path for power block balancing war declarations.
WAR_POWER_FACTOR_ACTIVE = 0.16 If power war flag has already been raised.
WAR_POWER_DISTANCE = 350 Maximum distance countries may consider engaging in power wars.
EAGERNESS_EXTERNAL_MANPOWER_FACTOR = 0.45 How much manpower advantage over neighbors matters vs. %MP of max for eagerness to declare war.
WAR_EXHAUSTION_RECOVERY_MONTHS = 12 AI will not actively reduce war exhaustion if it can reach WAR_EXHAUSTION_DESIRED at the current rate during war.
WAR_EXHAUSTION_RECOVERY_MONTHS_PEACE = 24 AI will not actively reduce war exhaustion if it can reach WAR_EXHAUSTION_DESIRED at the current rate during peace.
WAR_EXHAUSTION_TYRANNY_MONTHS = 60 Hardcoded way to make AI spend tyranny (up to this number of months when tyranny is decreasing) to decrease WE.
WAR_EXHAUSTION_DESIRED = 10 How much WE is the AI allowed to have before declaring war?
WAR_DESIRED_STABILITY = 35 How much Stability should the AI have before declaring war?
LOW_AGGRESSIVE_NO_WAR = 21 Aggressiveness lower than this threshold means AI will not declare wars
HIGH_AGGRESSIVE_ALWAYS_WAR = 400 Aggressiveness higher than this threshold means AI will always declare wars when it can
WAR_MIN_SHIPS_OVERSEAS_WAR = 5 The minimum number of ships AI needs to consider overseas war against the target
WAR_POWER_BALANCE_BUFFER = 0.2 Buffer when calculating power balance between countries to declare war on, to prevent AI from going into bad wars where it doesn't have a clear advantage
WAR_POWER_BALANCE_MARGIN_MULT = 0.06 Divided by MAX_WAR_DIFFICULTY_INCREASE to determine the amount of power balance AI needs to have before selecting war target. Increase this number to make the AI only declare war on targets it has a large margin of power balance against
Barbarians!
BARBARIAN_PAY_OFF_SCALE = 0.8 The lower this value is, the more reluctant AI will be to pay off barbarians. (In reality, this value is compared to strongest own army that can reach the barbarians.)
BARBARIAN_HANDLE_RANGE = 1000 Armies further than this will not be counted for purposes of killing a barbarian army.
Johan's stuff
PEACE_STALLED_WAR_THRESHOLD = 2 If the warscore has changed by this amount or less in the last year, the war is stalled. Is this even AI?
Challenge modifiers
ANTAGONIST_BONUS_ON_HARD = 0.25
ANTAGONIST_BONUS_ON_VERY_HARD = 0.5
ANTAGONIST_VERSUS_OTHER_AI_DICE_BONUS = 2
ANTAGONISM_PEACE_ACCEPT_BONUS_VS_OTHER_AI = 25 Job assignment weights
ASSIGN_OFFICE_SCORNED_WEIGHT = 4.0 Multiplicative: How much more important is it to fill an office position with a scorned character? The inverse is also true.
ASSIGN_UNIT_SCORNED_WEIGHT = 2.0 Multiplicative: How much more important is it to fill a general position with a scorned character?
Migration:
MIGRATION_TARGET_RANDOMNESS = 10 Larger means there's more randomness in where AI decides to migrate as opposed to calculated "best" culture provinces.
MIGRATION_TARGET_DISTANCE_OFFSET = 28 Larger => distance becomes relatively less important. Should be more than zero as it's used for a divisor of the form MIGRATION_TARGET_DISTANCE_OFFSET + distance.
Religion:
PANTHEON_HOLY_SITE_WEIGHT = 0.5 Additive Value: Additional Weight for selecting a deity with a Holy Site within our borders
PANTHEON_HAPPINESS_WEIGHT = 0.1 Weight for happiness, based on percentage of pops matching the deity's religion, might be necessary to rescale this in case modifier values change a lot in your mod.
PANTHEON_STICKINESS_WEIGHT = 1.0 Additive Value: Extra stickiness for currently selected deities to discourage strobing.
HOLY_SITE_RANDOMNESS = 40 The larger this is, the less likely the AI are to check for building holy sites.
DEIFICATION_RANDOMNESS = 160 The larger this is, the less likely AI are to deify their ruler.
Culture:
CULTURE_CHANGE_HAPPINESS_THRESHOLD = 0.25 dont change if primary culture happiness modifier is beneath this
CULTURE_CHANGE_POPCOUNT_THRESHOLD = 85 cultures beneath this pop count will be ignored for integration
CULTURE_CHANGE_THRESHOLD = 0.08 how large amount of the population a culture needs to be considered for integration
REVOKE_CULTURE_CHANGE_THRESHOLD = 0.04 how large amount of the population a culture needs to be considered for revoking integration
MINIMUM_RECRUIT_NEW_UNIT_IN_EMPTY_LEGIONS_SIZE = 4
ADVANCED_GOV_TRIBAL_CONQUEST_WILLINGNESS = 0.02
OPTIMAL_LEGION_SUBUNIT_COUNT = 60
WARS_IN_PLAN_BEFORE_INTEGRATION = 1 How many wars can we have in our action plan and still consider integrating subjects? 0 = Let's leave this until we have some downtime.
MAX_PLANNED_WARS = 3 How many wars can we plan at any one time? clamped between 1 and Min( Aggressivesness / 50, MAX_PLANNED_WARS )
AI_UNIT_SPLIT_WILLINGNESS = 1.22 DO not change this by large degrees if you still want AI to split units.
NLevy
MIN_SIZE = 4 minimum number of cohorts raised as levy
SUPPORT_REQUIREMENT = 9 every n-th number of cohorts in a levy should be support units
DISBAND_MILITARY_EXP_MULT = 0.015 when disbanding a levy military experience will be added to the country
EXPERIENCE_GAIN_THRESHOLD = 8 months that the levy has to be raised before disbanding it will give any military experience
WAR_EXHAUSTION_THRESHOLD = 6 months until a newly raised levy will start contributing to war exhaustion
WAR_EXHAUSTION_ON_RAISE = 0.5 amount of war exhaustion gained from simply raising a levy
MONTHLY_WAR_EXHAUSTION = 0.04 each governorship contributes this much to war exhaustion after having levies raised for too long
RAISE_LEVY_COOLDOWN_MONTHS = 4 number of months of cooldown after disbanding before you can raise a levy again
SIZE_MULTIPLIER_MAX = 1.5 that the max value for the raise levy size multiplier is.
FOOD_TO_LEAVE_IN_STATE_ON_RAISE = 50 Minimum food to leave raising state with.
FLAGGED_ATTRITION_DECAY = 0.1
MONTHS_TO_ADD_TO_DISBAND = 24 The maximum months that can be added to a levy cooldown when disbanded, based on the strength of the levy at disband time.
LEVY_IMPACT_MULTIPLIER = 7
NLegion
GLOBAL_RECRUITMENT_COST_MULT = 2.0
MAXIMUM_TRIBUNE_SIZE = 4