Defines

From Crusader Kings II Wiki
Jump to: navigation, search

Defines are numerical variables used by the engine, allowing to tweak behaviors that are not opened to scripting (diplomatic actions, succession laws, ...).

Defines are static and global: they apply to the whole game and cannot be changed dynamically.


Configuration[edit]

Vanilla values are configured in the file common/defines.lua, which contains more than 1000 variables affecting many areas of the game.

The structure is based on bracketed categories (NDiplomacy, NMilitary, ...), containing long lists of simple key/value pairs. Comments need to start with "--".

NDefines = {
	NDiplomacy = {
		PRESTIGE_LOSS_ON_SEND_GIFT_DECLINE = 10,	-- OBSOLETE
		(...)
	}
	NMilitary = {
		ARCHERS_PHASE_SKIRMISH_ATTACK = 2,
		ARCHERS_PHASE_SKIRMISH_DEFENSE = 1,
		(...)
	}
	(...)
}

Overriding common/defines.lua directly in a mod will cause the game to CTD if the mod is missing defines that are later added in a vanilla patch. Thankfully, as of patch 2.4, it is no longer necessary to include a copy of the whole file to change some values. Instead, you can put your changed values in a custom .lua file in common/defines/ folder, with the following format:

NDefines.NDiplomacy.PRESTIGE_LOSS_ON_SEND_GIFT_DECLINE = 50

Additional changed values go on separate lines, with no commas at the end of lines:

NDefines.NMilitary.ARCHERS_PHASE_SKIRMISH_ATTACK = 5
NDefines.NMilitary.ARCHERS_PHASE_SKIRMISH_DEFENSE = 3


List of defines[edit]

Here is a list of defines, grouped by functionality and with the unit of the define numeric value.

Life[edit]

Age static modifiers[edit]

Key Unit Description
NDefines.NCharacter.AGE_YOUNG = 20 Age Non-child characters below this age have the 'teen' static modifier applied.
NDefines.NCharacter.AGE_ADULT = 30 Age Non-child characters below this age have the 'young' static modifier applied.
NDefines.NCharacter.AGE_OLD = 50 Age Non-child characters below this age have the 'adult' static modifier applied.
NDefines.NCharacter.AGE_VERY_OLD = 70 Age Non-child characters below this age have the 'old' static modifier applied.

Birth[edit]

Key Unit Description
NDefines.NCharacter.MAX_CHILD_BIRTH_AGE = 45 Female menopause age.
NDefines.NCharacter.CHILD_BIRTH_TO_PREGNANCY_WAIT = 3 Months Probably months between birth and when woman can be pregnant again.
NDefines.NCharacter.BASE_NR_OF_CHILDREN_PER_COUPLE = 2
NDefines.NCharacter.EXTRA_NR_OF_CHILDREN_FOR_PLAYERS = 2
NDefines.NCharacter.COURT_SIZE_CHILD_PENALTY_THRESHOLD = 30
NDefines.NCharacter.FERTILITY_BASE_MULT = 0.50 Base fertility multiplier to adjust the base chance of impregnation
NDefines.NCharacter.SECONDARY_SPOUSE_FERTILITY_MULT = 0.50 Applied to fertility of secondary spouses and concubines
NDefines.NCharacter.NOT_SPOUSE_FERTILITY_MULT = 0.50 Applied to fertility when two lovers are not married
NDefines.NCharacter.MARRIED_LOVERS_FERTILITY_MULT = 1.5 Applied to fertility when lovers are married
NDefines.NCharacter.PRESTIGE_FROM_DYNASTY_ON_BIRTH_DIV = 5 Newly born characters get the dynasty prestige of their mother and father divided by this as their starting prestige.

Childhood[edit]

Main article: Education

Key Unit Description
NDefines.NCharacter.NEED_GUARDIAN_AT_AGE = 6 Age The age at which children should be appointed a mentor/guardian.
NDefines.NCharacter.MAX_WARDS_PER_GUARDIAN = 2 Int Self Explanatory.
NDefines.NCharacter.CHILDHOOD_FOCUS_ALERT_AGE = 6 Age The childhood focus alert is shown for children this old
NDefines.NCharacter.AGE_CHILDHOOD_PULSE = 6 Age The childhood pulse events start from this age
NDefines.NCharacter.AGE_ADOLESCENT = 12 Children are considered to be adolescent from this age.
NDefines.NCharacter.CHILDHOOD_AUTO_EDUCATION_FOCUS_AGE = 15 Age Children automatically get education focus at this age.
NDefines.NCharacter.BASE_MAX_ATTRIBUTE = 10 The max attribute value you can get from growing up
NDefines.NCharacter.CONCLAVE_CHILDHOOD_ATTRIBUTE_INCREASE_CHANCE = 20 The chance of increasing an attribute during childhood
NDefines.NCharacter.CONCLAVE_ADOLESCENCE_ATTRIBUTE_INCREASE_CHANCE = 25 The chance of increasing an attribute during adolescence
NDefines.NCharacter.CONCLAVE_UNKNOWN_PARENT_DEFAULT_STAT = 5 If a child has no parents represented as characters in the game, this stat value is used when getting stat increases
NDefines.NCharacter.CONCLAVE_INHERITED_ATTRIBUTE_INCREASE_CHANCE = 1.0 The parent's base stats influence stat increases in children by this much

Adulthood[edit]

Key Unit Description
NDefines.NCharacter.AGE_OF_ADULTHOOD_MALE = 16 Age Male can rule at this age.
NDefines.NCharacter.AGE_OF_ADULTHOOD_FEMALE = 16 Age Female can rule at this age.

Traits[edit]

Main article: Traits

Key Unit Description
MAX_GENERATED_TRAITS_FOR_HISTORICAL Generate random traits up this number for adult historical characters.
INBRED_TRAIT_CHANCE_FACTOR Inbreeding: Multiplier to the base chance.
LUNATIC_TRAIT_CHANCE_FACTOR Inbreeding: Multiplier to the base chance
INBRED_DIVINE_BLOOD_TRAIT_CHANCE_FACTOR Inbreeding: Multiplier to the base chance
LUNATIC_DIVINE_BLOOD_TRAIT_CHANCE_FACTOR Inbreeding: Multiplier to the base chance
NDefines.NCharacter.MALE_ATTRACTION_CUTOFF = 65 Age After this age, the sex appeal of traits no longer have any effect
NDefines.NCharacter.FEMALE_ATTRACTION_CUTOFF = 45 Age After this age, the sex appeal of traits no longer have any effect

Objectives[edit]

Main article: Objectives

Key Unit Description
NDefines.NDiplomacy.OBJECTIVE_DISCARD_WEIGHT_THRESHOLD = 0.05 The AI will not pick ambitions or plots below this evaluated weight
NDefines.NCharacter.CHANGE_AMBITION_YEARS = 3 Years Delay between being able to pick a new ambition.
NDefines.NCharacter.CHANGE_FOCUS_YEARS = 5 Years Delay between being able to change focus.

Marriage[edit]

Key Unit Description
NDefines.NCharacter.BETROTHAL_MIN_AGE = 12 Age AI will not arrange betrothals for children below this age
NDefines.NCharacter.AGE_OF_MARRIAGE_MALE = 16 Age Male allowed to marry at this age.
NDefines.NCharacter.AGE_OF_MARRIAGE_FEMALE = 16 Age Female allowed to marry at this age.
NDefines.NCharacter.MAX_AGE_BEFORE_BETROTHAL_BREAKS = 20 Age
NDefines.NCharacter.PRESTIGE_FROM_DYNASTY_ON_MARRIAGE_DIV = 10 Characters get the dynasty prestige of the spouse divided by this on marriage.
NDefines.NCharacter.MARRIAGE_TIER_DIFF_PRESTIGE_MULT = 100 Prestige multiplier from marrying below or above your rank.
NDefines.NCharacter.CONSORT_TIER_PRESTIGE_MULT = 25 Prestige multiplier for rank of consort.
NDefines.NCharacter.MUSLIM_NUM_WIVES_MONTHLY_PRESTIGE_BONUS = 0.4 The prestige effect from each extra expected wife.
NDefines.NCharacter.MUSLIM_NUM_WIVES_MONTHLY_PRESTIGE_PENALTY = 1.0 The prestige effect from each lacking expected wife.
NDefines.NCharacter.PAGAN_NUM_CONSORTS_MONTHLY_PRESTIGE = 0.2 The monthly prestige effect for pagans for each young Concubine.
NDefines.NDiplomacy.DOWRY_MULTIPLIER = 1.0 This value is multiplied with the prestige gain of the patrician from the marriage in order to determine the dowry that must be paid to marry a feudal character.
NDefines.NAI.MARRIAGE_AI_PRESTIGE_VALUE = 0.33 Multiplier for how highly AI values prestige when arranging marriages and evaluating marriage offers
NDefines.NAI.MARRIAGE_THREATENING_FOR_THEM_MODIFIER = 5 How much AI will pay attention to marriages with realms they have a CB on and are considerably stronger than
NDefines.NAI.DESIRED_CONSORTS = 0 AI will always want at least this many concubines, if they lack sons

Death[edit]

Key Unit Description
NDefines.NCharacter.INFANT_DEATH_CHANCE = 0.0 Chance of stillbirth / death at birth
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_0 = 5 Per mille Natural deaths per decade out of 10000 people for each age range (0-9, 10-19, ..., 100+)
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_10 = 1
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_20 = 15
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_30 = 20
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_40 = 51
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_50 = 100
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_60 = 400
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_70 = 1400
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_80 = 3500
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_90 = 7000
NDefines.NCharacter.NATURAL_DEATH_CHANCE_AGE_100 = 9000
NDefines.NCharacter.TREASURY_CHANCE_TO_DISAPPEAR_STANDARD = 0.05 Chances that artifacts disappear on inheritance
NDefines.NCharacter.TREASURY_CHANCE_TO_DISAPPEAR_NO_HEIR = 0.5 Chances that artifacts disappear on inheritance when the dying character doesn't have an heir

Realm[edit]

Vassal opinion[edit]

Key Unit Description
PRESTIGE_OPINION_DIV Prestige divided by this number determines the bonus to Feudal opinion. In the case of negative opinion the opinion change is multiplied by five.
PRESTIGE_OPINION_MAX This is the maximum amount of opinion gain or loss from prestige.
PIETY_OPINION_DIV Piety divided by this number determines the bonus to Clergy opinion. In the case of negative opinion the opinion change is multiplied by five.
PIETY_OPINION_MAX This is the maximum amount of opinion gain or loss from piety.
JAIN_LIEGE_OPINION_BONUS Jain Lieges Get Vassal Opinion Bonus
REALM_DIPLOMACY_OPINION_MUL_FACTOR Realm diplomacy factor affecting opinion value

De jure drift[edit]

Main article: De jure

Key Unit Description
NDefines.NTitle.ALLOW_DE_JURE_ASSIMILATION_ANYWHERE = 1 Bool If set to 0, will only assimilate duchy titles which contain the assimilating Kingdom's capital or border existing de jure land of that title
NDefines.NTitle.DE_JURE_ASSIMILATION_YEARS = 100 Years Duchies a under the de facto control of another kingdom will change de jure liege after this many years
NDefines.NTitle.EMPIRE_DE_JURE_ASSIMILATION_YEARS = 100 Years Kingdoms under the de facto control of another empire will change de jure liege after this many years
NDefines.NTitle.GAME_RULES_DEJURE_LONG = 300 Years
NDefines.NTitle.GAME_RULES_DEJURE_LONG_EMPIRE = 300 Years
NDefines.NTitle.GAME_RULES_DEJURE_SHORT = 50 Years
NDefines.NTitle.GAME_RULES_DEJURE_SHORT_EMPIRE = 50 Years
NDefines.NTitle.GAME_RULES_DEJURE_SHORTEST = 10 Years
NDefines.NTitle.GAME_RULES_DEJURE_SHORTEST_EMPIRE = 10 Years

Demesne limit[edit]

Key Unit Description
NDefines.NDiplomacy.DEMESNE_BASE_MAX_SIZE = 1.0 This is the base demesne limit.
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_BARON_MULT = 1.0 Extra Max Demesne Size from the ruler's rank (Basileus is separate)
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_COUNT_MULT = 1.0
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_DUKE_MULT = 1.0
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_KING_MULT = 3.0
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_EMPEROR_MUL = 4.0
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_GREAT_DUKE_BONUS Dukes with more than one duchy will get this value added to their demesne limit.
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_STEWARDSHIP_MULT = 0.15 Characters will have their stewardship plus half their spouse's stewardship, multiplied by this value, added to their demesne limit
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_PATRICIAN = 1.0 Patricians get this value added to their demesne limit. Note that the multipliers for tier will not be applied to patricians.
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_PATRICIAN_DOGE = 1.0 Doges get this value added to their demesne limit, in addition to DEMESNE_MAX_SIZE_PATRICIAN.
NDefines.NDiplomacy.GAVELKIND_MAX_SIZE_BONUS = 0.30 Titles with gavelkind will have this percentage of their demesne limit (including all modifiers mentioned above) added to their demesne limit.
NDefines.NDiplomacy.DEMESNE_MAX_SIZE_JAIN_BONUS = 3 Followers of the Jain religion have extra demesne

Vassal limit[edit]

Key Unit Description
NDefines.NDiplomacy.VASSAL_BASE_LIMIT = 1.0 Base Vassal Limit
NDefines.NDiplomacy.VASSAL_LIMIT_DUKE_MULT = 10.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.VASSAL_LIMIT_KING_MULT = 20.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.VASSAL_LIMIT_EMPEROR_MULT = 30.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.VASSAL_LIMIT_GREAT_DUKE_BONUS = 5.0 Extra Vassal Limit for Dukes with more than one Duchy
NDefines.NDiplomacy.VASSAL_LIMIT_DIPLOMACY_MULT = 0.3 Extra Vassal Limit from ruler and spouse diplomacy
NDefines.NDiplomacy.VASSAL_LIMIT_DECADENCE_MULTIPLIER = 0.25 Negative modifier, multiplied with the current decadence.
NDefines.NDiplomacy.VASSAL_LIMIT_LEVY_MULTIPLIER = 1 Used for levy penalty calculation for being over vassal limit.
NDefines.NDiplomacy.VASSAL_LIMIT_LEVY_BASE = 4 Used for levy penalty calculation for being over vassal limit.
NDefines.NDiplomacy.VASSAL_LIMIT_TAX_MULTIPLIER = 1 Used for tax penalty calculation for being over vassal limit.
NDefines.NDiplomacy.VASSAL_LIMIT_TAX_BASE = 4 Used for tax penalty calculation for being over vassal limit.
NDefines.NDiplomacy.VASSAL_LIMIT_COUNT_BARONS = 0 If set to 1, baron-tier vassals will also count towards vassal limit.
NDefines.NDiplomacy.CONCLAVE_VASSAL_LIMIT_DUKE_MULT = 8.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.CONCLAVE_VASSAL_LIMIT_KING_MULT = 15.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.CONCLAVE_VASSAL_LIMIT_EMPEROR_MULT = 20.0 Extra Vassal Limit from the ruler's rank
NDefines.NDiplomacy.CONCLAVE_VASSAL_LIMIT_GREAT_DUKE_BONUS = 3.0 Extra Vassal Limit for Dukes with more than one Duchy

Short reign[edit]

Key Unit Description
NDefines.NDiplomacy.SHORT_REIGN_YEARS_END = 9 Years This value is the default length of the short reign penalty. The penalty is multiplied by the number of years left.
NDefines.NDiplomacy.LONG_REIGN_YEARS_START = 10 This value is the number of years someone has to rule before they start getting the long reign bonus of 1 opinion per year beyond this value.
NDefines.NDiplomacy.SHORT_REIGN_OPINION_MULT = 1.0 The number of years left of a short reign is multiplied by this value to determine the short reign penalty. It can be overridden in the religion files.
NDefines.NDiplomacy.MAX_LONG_REIGN_BONUS = 100 Opinion Max bonus in opinion you can get from long reign
NDefines.NDiplomacy.LONG_REIGN_PENALTY = -2 Penalty ticking down every year from long reign bonus
NDefines.NDiplomacy.LONG_REIGN_PENALTY_START = 3 What year penalty tick should start
NDefines.NDiplomacy.SHORT_REIGN_OPINION_MULT = 1.0 Opinion penalty multiplier to short reign years
NDefines.NDiplomacy.LONG_REIGN_OPINION_MULT = 0.5 Opinion penalty boost to long reign years


Council[edit]

Main article: Council

Key Unit Description
NDefines.NDiplomacy.DUKE_POWERFUL_VASSAL_COUNT = 4 The x most powerful vassal will expect a seat in the council
NDefines.NDiplomacy.KING_POWERFUL_VASSAL_COUNT = 5 The x most powerful vassal will expect a seat in the council
NDefines.NDiplomacy.EMPEROR_POWERFUL_VASSAL_COUNT = 6 The x most powerful vassal will expect a seat in the council
NDefines.NCouncil.MONTHS_OF_DISCONTENT_COUNCIL = 24 Months How long a council is discontent after succession.
NDefines.NCouncil.CHANGE_POSITION_COOLDOWN = 12 Months
NDefines.NCouncil.COUNCIL_REJECTED_LAW_TIMEOUT = 10 Years How many years the timeout for a law is when council reject the law change.
NDefines.NCouncil.COUNCIL_REJECTED_CROWN_LAW_TIMEOUT = 5 Years How many years the timeout for a crown law is when council reject the law change.
NDefines.NCouncil.LAW_VOTE_CHANGE_TIME_LIMIT = 1 The time limit abstained council members have to vote before their vote becomes automatically an against vote.
NDefines.NCouncil.ENFORCE_PEACE_LENGTH = 60 Months How many months Enforce Peace is active for.
NDefines.NCouncil.ENFORCE_PEACE_START_DELAY = 3 Months How many months it takes before the enforce peace becomes active.
NDefines.NCouncil.ENFORCE_PEACE_BLOCK_LENGTH = 24 Months How many months Enforce peace is blocked when vassal uses the interaction.
NDefines.NCouncil.ENFORCE_PEACE_COOLDOWN = 60 Months How many months liege has to wait before he can use enforce peace again.
NDefines.NCouncil.NO_VOTING_PIETY_OVERRIDE = 1 Bool Flag that disables law voting when Conclave is enabled for groups that otherwise change laws based on piety without Conclave.
NDefines.NCouncil.NO_VOTING_PRESTIGE_OVERRIDE = 1 Bool Flag that disables law voting when Conclave is enabled for groups that otherwise change laws based on prestige without Conclave.
NDefines.NCouncil.REGENCY_VOTING = "(...)" List<interactions> In regencies the council votes on these issues. Example: "laws declare_war_interaction revoke_title_interaction imprison_character_interaction grant_landed_title_interaction exile_imprisoned_interaction execute_imprisoned_interaction"
NDefines.NCouncil.COUNCIL_REJECTION_ALL_LAWS_TIMEOUT = 1 Years How many years the timeout for doing a law change (for any law) is when the council has rejected a law change.
NDefines.NCouncil.COUNCIL_REJECTION_ALL_CROWN_LAWS_TIMEOUT = 1 Years How many years the timeout for doing a law change (for any law) is when the council has rejected a law change.
NDefines.NCharacter.ASSIGN_ACTION_DAYS Days Days before a Councillor can be assigned a new job in a county. Don't set to 0.

Laws[edit]

Key Unit Description
NDefines.NTitle.MAX_CROWN_LAW_CHANGES = 1 Number
NDefines.NTitle.CROWN_LAW_CHANGE_MONTHS = 600 Months
NDefines.NTitle.CROWN_LAW_CHANGE_TIMER = 1 Bool If set to 0, rulers will be restricted to MAX_CROWN_LAW_CHANGES. If set to 1, they'll have a CROWN_LAW_CHANGE_MONTHS cooldown
NDefines.NDiplomacy.LAW_CHANGE_PIETY_COST = 50 Muslims must have and pay this amount of piety in order to change demesne laws.
NDefines.NDiplomacy.CROWN_LAW_CHANGE_PIETY_COST = 100 Muslims must have and pay this amount of piety in order to change crown laws.
NDefines.NDiplomacy.LAW_CHANGE_PIETY_COST_ABSOLUTISM = 100 Piety cost for Iqta government when changing normal demesne laws with no council
NDefines.NDiplomacy.CROWN_LAW_CHANGE_PIETY_COST_ABSOLUTISM = 100 Piety cost for Iqta government when changing Crown laws with no council
NDefines.NDiplomacy.LAW_CHANGE_PRESTIGE_COST = 100 Prestige cost for Nomadic government when changing normal demesne laws
NDefines.NDiplomacy.CROWN_LAW_CHANGE_PRESTIGE_COST = 200 Prestige cost for Nomadic government when changing Crown laws
NDefines.NDiplomacy.LAW_CHANGE_PRESTIGE_COST_ABSOLUTISM = 100 Prestige cost for Nomadic government when changing normal demesne laws with no council
NDefines.NDiplomacy.CROWN_LAW_CHANGE_PRESTIGE_COST_ABSOLUTISM = 100 Prestige cost for Nomadic government when changing Crown laws with no council

Succession laws[edit]

Key Unit Description
NDefines.NCharacter.CHANGE_SUCC_LAW_YEARS = 10 Years Rulers must have reigned this long before they can change succession laws.
Papal succession[edit]
Key Unit Description
NDefines.NReligion.PAPAL_SUCCESSION_PASS_ON_HOLDINGS = 1 Bool Set to zero if holdings shouldn't be passed on
NDefines.NReligion.PAPAL_SUCCESSION_LOSE_MINOR_TITLES = 1 Bool Set to zero if minor religious titles should be lost
Patrician elective[edit]
Key Unit Description
NDefines.NEconomy.DOGE_SUCC_RANDOM_FACTOR = 500 The random Respect factor on actual Doge succession
NDefines.NEconomy.PATRICIAN_CAMPAIGN_FUND_FACTOR = 5 The effect of money in the Campaign Fund on Doge elections (money * factor)
NDefines.NEconomy.PATRICIAN_PRESTIGE_RESPECT_FACTOR = 2 The effect of Prestige on the Respect value for Doge elections (prestige * factor)
NDefines.NEconomy.PATRICIAN_AGE_RESPECT_FACTOR = 1 The effect of Age on the Respect value for Doge elections (age * age * factor)
Feudal elective[edit]
Key Unit Description
MAX_ELECTOR_TITLES_LEGALLY_HELD Number If a liege holds more than this number of elector titles in an Elective realm, vassals will start to get angry.
TITULAR_TITLES_COUNT_TOWARDS_DUCHY_LIMIT Bool If set to 1 then titular duchy titles (duchy titles with no de-jure land) will count towards the maximum duchy titles held before vassals will get upset.

Claims[edit]

Key Unit Description
NDefines.NDiplomacy.WOMEN_INHERIT_PRESSED_CLAIMS = 1 Bool If this value is set to 1, women will inherit pressed claims on their parents' titles.
NDefines.NDiplomacy.BASTARDS_INHERIT_PRESSED_CLAIMS = 1 Bool If this value is set to 1, bastards will inherit pressed claims on their parents' titles.

Factions[edit]

Main article: Factions

Key Unit Description
NDefines.NCharacter.MAX_LED_FACTIONS = 2 Number Maximum number of led Factions
NDefines.NCharacter.MAX_JOINED_FACTIONS = 2 Number Maximum number of Factions a character can be a member of (including led factions)
NDefines.NCharacter.NON_AGGRESSION_PACT_BLOCKS_FACTIONS = 1 Bool If set to 1 then factions will be blocked for vassals that have a non-aggression pact with their liege.
NDefines.NAI.FACTION_EXPIRATION_MONTHS = 12 Months How long AI will cling onto weak factions
NDefines.NAI.FACTION_EXPIRATION_MONTHS_RANDOMNESS = 5 Months Randomness to how long AI will cling onto weak factions
NDefines.NAI.FACTION_EXPIRATION_SIZE_LIEGE = 0.5 How much smaller a faction must be compared to liege to be considered weak
NDefines.NAI.FACTION_EXPIRATION_SIZE_OTHER_FACTION = 0.5 How much smaller a faction must be compared to the strongest faction to be considered weak
NDefines.NAI.FACTION_EXPIRED_MONTHS = 24 Months How long AI will avoid factions after they have been expired

Revolts[edit]

Key Unit Description
NDefines.NDiplomacy.BASE_REVOLT_CHANCE_MOD = 250 Pre Old Gods rebel spawn chance modifier (fires on_rebel_revolt) : lower means fewer revolts. MUST NOT BE ZERO.
NDefines.NDiplomacy.TOG_REVOLT_CHANCE_MOD = 100 Old Gods rebel spawn chance modifier (fires on_rebel_revolt) : lower means fewer revolts. MUST NOT BE ZERO.
NDefines.NMilitary.REVOLTRISK_REDUCTION_PER_YEAR = 1 Revolt-risk reduction from temporary sources.
NDefines.NDiplomacy.CROWN_LAW_REVOLTRISK_INCREMENT = 10 Crown authority will increase revolt risk by this value. Note that this is presumably hardcoded to the "centralization" law group.
NDefines.NDiplomacy.GAME_RULE_PROVINCIAL_REVOLT_RARE_DIVIDER = 2.0 Divider to decrease risk of revolt when using the "provincial revolt: rare" game rule
NDefines.NAI.REVOLT_AGGRESSION_FACTOR = 0.75 General aggressiveness for revolts against the liege
NDefines.NAI.REVOLT_DISTANCE_FACTOR = 1.0 Multiplier for how much distance from capital affects independence minded revolters
NDefines.NAI.REVOLT_OTHER_INDEP_RISK = 10 Each ongoing other independence revolt increases revolt risk by this amount for all independence-minded revolters
NDefines.NAI.REVOLT_OTHER_INDEP_RISK_CAP = 50 Cap to the total risk from the above

Governments[edit]

Key Unit Description
NDefines.NCharacter.WRONG_GOV_FORM_TAX_MOD = -0.75
NDefines.NCharacter.WRONG_GOV_FORM_LEVY_MOD = -0.75
Merchant republics[edit]
Key Unit Description
NDefines.NCharacter.MERCHANT_REPUBLIC_MAX_PATRICIANS = 5 Number The amount of merchant republic patrician families that the game will keep active.
NDefines.NEconomy.MERCHANT_REPUBLIC_SALARY_MULT = 3 Councillor salaries in Merchant Republics are multiplied by this
NDefines.NEconomy.PATRICIAN_FAMILY_SHARES_HEAD = 50 Monthly Patrician Income, number of shares for the Patrician himself
NDefines.NEconomy.PATRICIAN_FAMILY_SHARES_REST = 5 Monthly Patrician Income, number of shares for adult male dynasty members in the Patrician's court
NDefines.NEconomy.PATRICIAN_INHERITANCE_FROM_RELATIVE_MULT = 0.5 When a Patrician inherits the wealth of a non-Patrician relative, this multiplier determines the part he actually gets
NDefines.NEconomy.PATRICIAN_GOLD_TO_MONTHLY_PRESTIGE = 0.0005 Prestige that Patricians get each month from their treasury (CFixedPoint64 to support such small numbers)
NDefines.NEconomy.PATRICIAN_CITY_TAX_MULT = 0.5 Patricians don't pay normal City Tax to their liege... (CFixedPoint64)
Nomadism[edit]
Key Unit Description
NDefines.NNomad.ALWAYS_GENERATE_NOMADS = 0 Bool If turned on will generate nomads even if they are not playable (i.e. titles with historical_nomad = true and without Horse Lords DLC)
NDefines.NAI.NOMAD_KEEPS_BARON_TRIBAL_SETTLEMENTS = 1 Bool If set to 1, Independent AI Nomads will never give away baron tribal settlements in owned provinces (they will instead use the decision to pillage these holdings)
NDefines.NAI.NOMAD_BUILDS_TEMPLES = 0 Bool If set to 1, AI Nomads will build temples like any other government would (when at 0 they will only build them in holy sites lacking a temple province)
Tribal[edit]
Key Unit Description
NDefines.NCharacter.TRIBAL_EMPTY_HOLDING_LEVY_MULTIPLIER = 0.5
NDefines.NCharacter.TRIBAL_EMPTY_HOLDING_GARRISON_MULTIPLIER = 0.5
NDefines.NCharacter.TRIBAL_EMPTY_HOLDING_TAX_MULTIPLIER = 0.5

Warfare[edit]

Threat[edit]

Main article: Threat

Key Unit Description
NDefines.NInfamy.REALM_SIZE_BASE_MODIFIER = 1
NDefines.NInfamy.REALM_SIZE_GROWTH_MODIFIER = 0.125 The bigger you are, the more dangerous you are, modifier for when nation is growing.
NDefines.NInfamy.REALM_SIZE_SHRINK_MODIFIER = 0.0 The bigger you are, the more dangerous you are, modifier for when nation is shrinking.
NDefines.NInfamy.WAR_REALM_CHANGE_VALUE = 0.55 How much base value for realm growth/shrink is worth in a war.
NDefines.NInfamy.INDEPENDENCE_REALM_CHANGE_VALUE = 10.0 How much base value for realm growth/shrink is worth when giving a vassal independence.
NDefines.NInfamy.INHERITANCE_CHANGE_VALUE = 0.15 How much base value for realm growth/shrink is worth when inheriting titles.
NDefines.NInfamy.VASSAL_CHANGE_VALUE = 0.3 How much base value for realm growth/shrink is worth when inheriting titles.
NDefines.NInfamy.INFAMY_DECAY_BASE = 0.8 How many percent that decay each month as base.
NDefines.NInfamy.MIN_INFAMY_DECAY = 0.21 The minimum infamy decay regardless of troop strength.
NDefines.NInfamy.MAX_INFAMY_DECAY = 0.4 The maximum infamy decay regardless of troop strength.
NDefines.NInfamy.MILITARY_STRENGTH_DECAY_BASE = 600 Divider on military strength value that is used for the logarithmic part of the decay value.
NDefines.NInfamy.MAX_INFAMY_PER_WAR_PROVINCE = 15 A single province taken in war can give at most this much threat.
NDefines.NInfamy.MIN_INFAMY_PER_WAR_PROVINCE = 2 A single province taken in war can give at most this much threat.

Defensive pacts[edit]

Key Unit Description
NDefines.NDiplomacy.DEFENSIVE_PACT_THREAT_LIMIT = 0.05 The amount of provinces in a realm that is needed for beeing a valid target of a defensive pact
NDefines.NDiplomacy.DEFENSIVE_PACT_SIZE_RATIO = 1.0 Relative size requirement is this at 100% threat
NDefines.NDiplomacy.DEFENSIVE_PACT_MAX_RANGE = 400 At 100% threat characters are able to join defensive pacts against targets of this distance
NDefines.NDiplomacy.DEFENSIVE_PACT_MAX_RANGE_SAME_GROUP = 300 At 100% threat characters are able to join defensive pacts against targets of this distance
NDefines.NDiplomacy.DEFENSIVE_PACT_THREAT_SIZE_START = 0.0 Relative size requirement starts from this level of threat
NDefines.NDiplomacy.DEFENSIVE_PACT_BASE_SIZE = 0.0 This is the base size requirement at 0% threat
NDefines.NDiplomacy.MAX_INFAMY_GAIN = 50 This is the max infamy gained from a single source
NDefines.NDiplomacy.EVERY_DEFENSIVE_PACT_JOIN_THREAT = 0.95 If threat is this high, members of all defensive pacts against a target will join
NDefines.NDiplomacy.EVERY_DEFENSIVE_PACT_EXCEPT_HEADS_JOIN_THREAT = 0.75 If threat is this high, members of all defensive pacts against a target will join, except religious heads that only joins when their own group is attacked
NDefines.NDiplomacy.OTHER_DEFENSIVE_PACT_JOIN_THREAT = 0.5 If threat is this high, other religious groups band together when attacked, if it's lower every defensive pact acts on its own
NDefines.NDiplomacy.NON_AGGRESSION_PACT_REJECTED_COOLDOWN = 1 Number of years before a character can ask to form a non-aggression pact again

Armies[edit]

Key Unit Description
NDefines.NMilitary.ARMY_MOVEMENT_SPEED = 3 Base movement speed of land units
NDefines.NMilitary.NAVY_MOVEMENT_SPEED = 15 Base movement speed of naval units
NDefines.NMilitary.NUMBER_OF_TROOPS_PER_GALLEY = 100 The number of men each galley can hold.
NDefines.NMilitary.REINFORCE_RATE = 0.05 Reinforce rate per year (based on total size of the subunit).
NDefines.NMilitary.GARRISON_REINFORCE_RATE_MULTIPLIER = 5 The rate at which the garrison reinforce in comparison to levies
NDefines.NMilitary.LEVY_RAISED_REINFORCE_RATE_MULTIPLIER = 0.5 The rate at which the garrison/levy reinforce when the levy is raised
NDefines.NMilitary.LEVY_PERCENT_BEFORE_CAN_RAISE = 1.1 Needs at least this much % of full levy before we can raise it
NDefines.NMilitary.FRIENDLY_TERRITORY_LEVY_RETURN_PERCENT = 1.0 Percent Percent of subunit that returns to its holding levy when unit is disbanded in friendly territory
NDefines.NMilitary.OTHER_TERRITORY_LEVY_RETURN_PERCENT = 0.5 Percent Percent of subunit that returns to its holding levy when unit is disbanded in non-friendly territory
NDefines.NMilitary.RAISED_TROOPS_VASSAL_OPINION_DAYS = 61 Days After 61 days of having their troops raised, vassals will get -1 opinion more of you.
NDefines.NMilitary.OPINION_WHEN_MARSHAL_INSTEAD_OF_SELF Below this opinion value a vassal tends to use his marshal instead of himself when someone asks to raise his troops (a vestigial pre-LOR node)
NDefines.NMilitary.OPINION_WHEN_NO_LEADER Below this opinion a vassal will not supply a leader for subunits at all (a vestigial pre-LOR node)
NDefines.NMilitary.MIN_LEVY_RAISE_OPINION_THRESHOLD Below this opinion value you'll get the least amount of troops possible (as defined by crown laws)
NDefines.NMilitary.MAX_LEVY_RAISE_OPINION_THRESHOLD Above this opinion value you'll get the max amount of troops possible

Attrition[edit]

Main article: Attrition

Key Unit Description
NDefines.NMilitary.OWN_SETTLEMENT_SUPPLY_BONUS = 0.5 Extra supply from being in home realm
NDefines.NMilitary.NEUTRAL_SETTLEMENT_SUPPLY_BONUS = 0.25 Neutral supply bonus (relative to base supply)
NDefines.NMilitary.CONTROL_SETTLEMENT_SUPPLY_BONUS = 0.25 Supply bonus from occupied enemy settlements
NDefines.NMilitary.ENEMY_SETTLEMENT_SUPPLY_BONUS = -0.1 Supply bonus from unoccoupied enemy settlements
NDefines.NMilitary.HOSTILE_RELIGION_SUPPLY_MOD = -0.25 Supply modifier from a hostile religion
NDefines.NMilitary.NEARBY_SETTLEMENT_SINGLE_SUPPLY_BONUS = 0.75 Bonus for nearby settlement, if not controlling one yourself
NDefines.NMilitary.MAX_ATTRITION_LEADER_REDUCTION = -0.1 Center leader reduces max attrition(reduction in actual percent)
NDefines.NMilitary.ATTRITION_LEVEL_FACTOR = 0.5 A general "attrition per month" multiplier
NDefines.NMilitary.ATTRITION_LEVEL_FACTOR_50_OVER = 1.0 A general "attrition per month" multiplier when 50% over the supply limit
NDefines.NMilitary.ATTRITION_LEVEL_FACTOR_100_OVER = 2.0 A general "attrition per month" multiplier when 100% over the supply limit
NDefines.NMilitary.COASTAL_SUPPLY_BONUS = 0.5 Supply bonus in coastal provinces
NDefines.NMilitary.PAGAN_HOME_SUPPLY_MOD = 0.12 Non Pagans suffer extreme attrition in some Pagan homelands (based on province religion)
NDefines.NMilitary.NAVAL_ATTRITION = 0.0 Attrition taken monthly by units loaded on ships.
NDefines.NMilitary.DIFFERENT_RELIGIONGROUP_SUPPLY_PENALTY = -0.5 Only 50% supply in provinces with different religious group

Combat[edit]

Main article: Combat

Key Unit Description
NDefines.NMilitary.OVERRUN_RATIO = 25 Ratio needed for total extermination of enemy units
FLANKING_DAMAGE_BONUS Percentage bonus when flanking in combat
LEADER_MARTIAL_DAMAGE_BONUS Percentage bonus to damage for each point of martial the flank leader has
MORALE_COLLAPSE_THRESHOLD Threshold before unit runs away from combat (i.e. initiates the retreat phase).
MORALELOSS_FACTOR Affects the death rate in combat (a higher value means more troops are killed per day of combat).
MIN_COMBAT_DAYS The minimum number of days in combat (before retreating/withdrawing is possible).
NUMBER_OF_RETREAT_DAYS The number of days before you retreat successfully
DAYS_BETWEEN_COMBAT_EVENTS Combat events will happen every this many days
BATTLE_PRESTIGE_MULTIPLIER Total prestige gained in the battle will be this * ( losers losses ) / 1000
BATTLE_TECH_MULTIPLIER Military tech gain from battles multiplier.
MAINLEADER_PRESTIGE_PART The % of the total prestige gained in the battle that the center flank leader will get
FLANKLEADER_PRESTIGE_PART The % of the total prestige gained in the battle that each other flank leader will get
BATTLE_UNIT_OWNER_PRESTIGE_MULT The % of the total prestige gained in the battle that will be divided among the participating unit owners
BATTLE_UNIT_OWNER_PIETY_MULT The % of the total piety gained in the battle that will be divided among the participating unit owners
BATTLE_PIETY_MULTIPLIER Piety gain/loss multiplier. This is based on the prestige value, so a value of 1 gives a leader as much piety as he gains prestige from combat

Sieges[edit]

Main article: Siege

Key Unit Description
DAYS_BEFORE_DEFENDER_SALLY Number of days before defenders sally in a siege where they have superior numbers (more appropriately - this seems to be the frequency of siege events).
ATTACKER_ASSULT_DAMAGE_FACTOR Attacker damage scale factor when assaulting. This affects how much damage the attackers RECIEVE from the defenders (damage is dependent on skirmish values)
DEFENDER_ASSULT_DAMAGE_FACTOR Defender damage scale factor when assaulting. This affects how much damage the defenders RECIEVE from the attackers (damage is dependent on skirmish values)
DAYS_PER_FORTLEVEL_BEFORE_ASSAULT Number of days until attacker can assault (this is also affected by the fort level and outnumbering ratio).
NDefines.NAI.AI_ASSAULT_RATIO = 10 AI will launch assaults at this ratio of attackers to defenders
SIEGE_DAMAGE Siege attack values are multiplied by this value(when not doing a sally). Note that this is daily damage (using the defender's skirmish damage) done to the attackers.
PERCENT_OF_GARRISON_DETACHED This percent of the garrison is detached from the winning unit of a siege
SIEGE_MORALE_LOSS Monthly morale loss in a siege. This is a raw damage percentage (out of 1 or 100%) that is adjusted by other factors (namely fort level [(N+1)^-1] and outnumbering ratio [attackers/defenders] ).
SIEGE_PIETY_MULTIPLIER Piety gain/loss multiplier for sieges
SIEGE_WEALTH_MULTIPLIER Wealth gain/loss multiplier for sieges (this is referenced with the total annual income of the holding at the time).

Warscore[edit]

Main article: Warscore

Key Unit Description
CAPTURED_CLOSE_MALE_RELATIVE_WAR_SCORE War score for holding a close male relative prisoner per month" multiplier
CAPTURED_HEIR_WAR_SCORE War score for holding the heir prisoner
OCCUPATION_PENALTY_MONTHS These are different modifier lengths applied to settlements upon conquest
WAR_CONTRIBUTION_OCCUPATION_PER_DAY Occupying a Holding gives this Contribution score per day
WAR_CONTRIBUTION_BATTLE_PER_DAY Every day in battle, a participant gets this. (My Troops / Total Friendly Troops) * Total Enemy Troops * WAR_CONTRIBUTION_BATTLE_PER_DAY. Max is [My Troops].
MONTHS_UNTIL_REBEL_WIN Number of days until province is totally conquered by rebels
CAPITAL_WARSCORE_MULTIPLIER Warscore multiplier for capital(this is scaled with SETTLEMENT_WARSCORE_MULTIPLIER)
SETTLEMENT_WARSCORE_MULTIPLIER Warscore worth for occupied private demesne (concerning relevant direct participants of the war).
VASSAL_SETTLEMENT_WARSCORE_MULTIPLIER Warscore worth for occupied vassals
CONTESTED_TERRITORY_WARSCORE_MULTIPLIER Multiplier for contested settlements
NDefines.NMilitary.DAYS_UNTIL_HOLDER_GETS_WARSCORE = 365 ays until the war score of the title owner starts increasing, if he controls the Holdings
NDefines.NMilitary.DAYS_UNTIL_HOLDER_GETS_WARSCORE_INDEP = 0 Days until the war score of the title owner starts increasing in Independence Wars, if he controls the Holdings
NDefines.NMilitary.CONTESTED_TITLE_OCCUPIED_WARSCORE_BONUS = 15 Amount of warscore per year since attacker/defender started getting the bonus
NDefines.NMilitary.CONTESTED_TITLE_OCCUPIED_WARSCORE_BONUS_INDEP = 20 Amount of warscore per year since attacker/defender started getting the bonus, for independence wars (can be overridden separately in religion scripts)
NDefines.NMilitary.BATTLE_WARSCORE_WORTH = 75 Warscore from battles are multiplied with this value
NDefines.NMilitary.BATTLE_WARSCORE_DEFENDER_MULTIPLIER = 1.5 Defenders wins are multiplied with this value, which also means they get more prestige for a win
NDefines.NMilitary.BATTLE_MINIMUM_WARSCORE = 0.2 Battles below this value (in actual percentage) are removed from warscore calculations
NDefines.NMilitary.TOTAL_OCCUPATION_SCALE = 0.8 The % of occupation which gives you 100% warscore
NDefines.NMilitary.CONTROLLER_MONTHS_BEFORE_OWNER_CHANGE = 120 Number of months before ownership change of province, for certain cb:s that have contested titles

Mercenaries[edit]

Key Unit Description
NDefines.NMilitary.MERC_REINFORCE_RATE = 0.015 The rate at which mercenaries and holy orders reinforce in the field (based on total size of the subunit)
NDefines.NMilitary.MERC_REINFORCE_RATE_WHEN_IDLE = 0.03 The rate at which mercenaries and holy orders reinforce when not hired (based on total size of the subunit)
NDefines.NMilitary.MERCENARY_MAINTENANCE_FACTOR = Maintenance factor (i.e. upkeep) for NORMAL/NON-VASSAL mercenary units
NDefines.NMilitary.MERCENARY_VASSAL_MAINTENANCE_FACTOR = Maintenance factor (i.e. upkeep) for VASSALIZED mercenary units
NDefines.NMilitary.HOLY_ORDER_HIRE_COST_FACTOR = Conversion of nominal gold cost to piety cost when hiring Holy Orders
NDefines.NMilitary.VASSAL_MERC_HIRE_COST_FACTOR = 0.125 Fraction of nominal hire cost when hiring VASSAL mercenaries and/or VASSALIZED holy orders
NDefines.NMilitary.MERCENARY_HIRE_DISTANCE_THRESHOLD = 600 Mercs will not be available if the province of origin is more distant from your capital
NDefines.NCharacter.DYNAMIC_MERCENARY_HEIR_WEALTH_MULT = 0.10 How much a dynamic mercenary get from his wealth when he is an heir and the parent dies.
NDefines.NCharacter.NUM_INHERITABLE_DYNAMIC_MERCENARIES = 1 How many dynamic mercenary bands that can be inheritable. The ones not inherited are cut loose and become independent.

Retinues[edit]

Main article: Retinues

Key Unit Description
NDefines.NMilitary.RETINUE_FROM_REALMSIZE Retinue points obtained from realmsize (the total amount of men of your entire realm, vassals and all).
NDefines.NMilitary.RETINUE_INCREASE_PER_TECH The retinue multiplication per relevant tech level.
NDefines.NMilitary.RETINUE_HIRE_COST_MULTIPLIER The cost of hiring retinues (based on the sum of individual "costs" of a single soldier as defined).
NDefines.NMilitary.RETINUE_REINFORCE_RATE Reinforce rate percentage dependent on total number of men.
NDefines.NMilitary.RETINUE_REINFORCE_COST The cost of reinforcing retinues (based on the sum of individual "costs" of a single soldier as defined).
NDefines.NMilitary.RETINUE_CONSTANT_COST Retinues cost at all times, i.e. their upkeep.

Raiding[edit]

Main article: Raiding

Key Unit Description
NDefines.NMilitary.LOOTED_MODIFIER_MONTHS = 36 Months How long pagan-raid inflicted looting lasts
NDefines.NMilitary.LOOT_TAX_MULTIPLIER = 1.5 Base gold looted from raided holdings is (tax * LOOT_TAX_MULTIPLIER) + (total building value * LOOT_BUILDING_MULTIPLIER)
NDefines.NMilitary.LOOT_BUILDING_MULTIPLIER = 0.02 Extra gold looted from raided holdings, from buildings (LOOT_BUILDING_MULTIPLIER * building built cost)
NDefines.NMilitary.LOOT_HOLDING_DEST_MIN_SAFE = 4 there is a 1 in (LOOT_HOLDING_DESTRUCTION_ODDS) chance that a holding with less than LOOT_HOLDING_DEST_MIN_SAFE buildings will be destroyed by looting
NDefines.NMilitary.LOOT_HOLDING_DESTRUCTION_ODDS = 20 Odds affecting said LOOT_HOLDING chances
NDefines.NMilitary.LOOT_HOLDING_BUILDING_DEST_ODDS = 10 there is a 1 in this chance a random building is destroyed when looted
NDefines.NAI.RAID_MAX_REALM_SIZE = 24 Holdings Realms with more holdings than this will never go on Raids
NDefines.NAI.RAID_AGGRESSION = 18 General frequency of raids. A LOWER number means more often!
NDefines.NAI.RAID_PREP_INV_SPARE_SAME_CULTURE = 1 Bool AI of religions that allow prepared invasions will not raid provinces in their own culture group (to prevent intra-Scandinavian raids)
NDefines.NAI.RAID_SPARE_ACCEPTED_RELIGIONS = 1 Bool AI will not raid rulers of other religions in the same religion group, unless heresy vs parent religion

Dynasty[edit]

Key Unit Description
NDefines.NCharacter.DYNASTY_CONTROLS_HOLY_ORDER_PRESTIGE = 2 Monthly Prestige from a dynasty member as head of a Holy Order (only for counts+ and if the same religion).
NDefines.NCharacter.DYNASTY_CONTROLS_HOLY_ORDER_PIETY = 1 Monthly Piety from a dynasty member as head of a Holy Order (only for counts+ and if the same religion).
NDefines.NCharacter.DYNASTY_CONTROLS_RELIGIOUS_HEAD_PRESTIGE = 2 Monthly Prestige from a dynasty member as head of a religion (only for counts+ and if the same religion).
NDefines.NCharacter.DYNASTY_CONTROLS_RELIGIOUS_HEAD_PIETY = 3 Monthly Piety from a dynasty member as head of a religion (only for counts+ and if the same religion).

Landed kin prestige[edit]

Key Unit Description
LANDED_SIBLING_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_HALF_SIBLING_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_NIECE_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_CHILD_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_GRAND_CHILD_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_PARENT_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_UNCLE_AUNT_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_GRAND_PARENT_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_GREAT_GRAND_PARENT_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.
LANDED_GREAT_GRAND_PARENT_PRESTIGE_BONUS For religions with landed win prestige bonus. Is multiplied with the percentage of how many of your realm they own.

Decadence[edit]

Main article: Decadence

Key Unit Description
NDefines.NMilitary.LOW_DECADENCE_MORALE_MOD = 0.5 Modifier Extra Morale defence when at 0% decadence
NDefines.NMilitary.HIGH_DECADENCE_MORALE_MOD = -0.5 Modifier Extra Morale damage taken when at 100% decadence
NDefines.NDiplomacy.VASSAL_LIMIT_DECADENCE_MULTIPLIER = 0.25 Modifier Negative modifier, multiplied with the current decadence.
NDefines.NTitle.BARON_GRANT_DECADENCE_RED = 0.01 Modifier Title Grant Decadence Reduction (Multiplied with current decadence)
NDefines.NTitle.COUNT_GRANT_DECADENCE_RED = 0.02
NDefines.NTitle.DUKE_GRANT_DECADENCE_RED = 0.04
NDefines.NTitle.KING_GRANT_DECADENCE_RED = 0.1
NDefines.NTitle.EMPEROR_GRANT_DECADENCE_RED = 0.2
NDefines.NEconomy.DECADENCE_MODIFIER = 0.2 Modifier Maximum effect of decadence, positive for low dec, negative for high
NDefines.NEconomy.DECADENCE_PER_WEEK_OF_COMBAT = -0.04 Percent Decadence lost per 7 days of combat, for each participant in the combat
NDefines.NEconomy.DECADENCE_PER_WEEK_OF_SIEGE = -0.008 Percent Decadence lost per 7 days of siege, for each participant in the siege
NDefines.NDecadence.BASE_EMPEROR_GAIN = 0.225 Decadence Base decadence gain by tier
NDefines.NDecadence.BASE_KING_GAIN = 0.18
NDefines.NDecadence.BASE_DUKE_GAIN = 0.12
NDefines.NDecadence.BASE_COUNT_GAIN = 0.09
NDefines.NDecadence.BASE_BARON_GAIN = 0.045
NDefines.NDecadence.BASE_UNLANDED_GAIN = 0.0225
NDefines.NDecadence.REALM_SIZE_MULTIPLIER = 0.005
NDefines.NDecadence.DEMESNE_FRACTION_MULT_POS = 0.5
NDefines.NDecadence.DEMESNE_FRACTION_MULT_NEG = -0.8
NDefines.NDecadence.SAFETY_VALUE = 75 Decadence The limit at where your decadence will give you a risk of decadence revolts

Interactions[edit]

Opinion[edit]

Key Unit Description
NDefines.NCharacter.ADULT_DIPLOMACY_OPINION_SUB_FACTOR = 4 Adult diplomacy factor affecting opinion value
NDefines.NCharacter.ADULT_DIPLOMACY_OPINION_MUL_FACTOR = 1.5 Adult diplomacy factor affecting opinion value
NDefines.NCharacter.CHILD_DIPLOMACY_OPINION_SUB_FACTOR = 4 Adult diplomacy factor affecting opinion value (I think this should be child, but it says adult in the file)
NDefines.NCharacter.CHILD_DIPLOMACY_OPINION_MUL_FACTOR = 1.5 Adult diplomacy factor affecting opinion value (I think this should be child, but it says adult in the file)
NDefines.NCharacter.INHERITED_OPINION_END_AGE = 30 Inherited opinions end when the inheritor hits this age
NDefines.NCharacter.INHERITED_OPINION_MIN_MONTHS = 12 This is the minimum number of months for inherited opinions
NDefines.NCharacter.INHERITED_OPINION_FACTOR = 0.5 This is the factor of the opinion of the previous holder that gets inherited

Favors[edit]

Main article: Favors

Key Unit Description
NDefines.NDiplomacy.FAVOR_THRESHOLD_TO_FORCE_HUMANS = 250 Mininum importance of issue for us to consider forcing a human to do it by using the favor they owe us
NDefines.NDiplomacy.CHANCES_TO_USE_FAVOR = 75 Percent Chance to use favor to change the outcome of a diplomatic request (as a percentage)
NDefines.NDiplomacy.MINIMUM_BUY_FAVOR_COST = 40 Minimum amount of money needed to buy favor.
NDefines.NDiplomacy.BUY_FAVOR_INCOME_SCALEFACTOR = 40
NDefines.NDiplomacy.BUY_FAVOR_TIER_REDUCTION_FOR_NOMADS = 0.25 Percent Reduction for nomads since they're always considered emperors
NDefines.NCouncil.FAVOR_USE_DURATION = 36 Months How long a favor last when used in council in amount of months
NDefines.NAI.CONTINUE_WAR_TRESHOLD = 5 Warscore How much warscore needed for the AI to consider using a favor to stop the liege enforce peace
NDefines.NAI.STOP_WAR_THRESHOLD = -50 Warscore How much warscore needed for the AI to consider using a favor to force the liege to start enforcing peace
NDefines.NAI.ASK_FOR_COUNCIL_POSITION_BASE_DESIRE = 25 Opinion Base score for the AI to use the AskForCouncilPosition interaction when they have a favor on their liege

Diplomacy distance[edit]

Key Unit Description
NDefines.NDiplomacy.MAX_DIPLO_DISTANCE = 700 Most diplomacy is disallowed if two rulers are too distant
NDefines.NDiplomacy.MAX_DIPLO_DISTANCE_SAME_RELIGION = 100 Bonus to max diplo distance for being of the same religion
NDefines.NDiplomacy.MAX_DIPLO_DISTANCE_SAME_RELIGION_GROUP = 0 Bonus to max diplo distance for being of the same religion group
NDefines.NDiplomacy.MAX_DIPLO_DISTANCE_SAME_CULTURE = 100 Bonus to max diplo distance for being of the same culture
NDefines.NDiplomacy.MAX_DIPLO_DISTANCE_SAME_CULTURE_GROUP = 100 Bonus to max diplo distance for being of the same culture group
NDefines.NDiplomacy.GAME_RULE_RESTRICTED_DIPLO_DISTANCE_MULTIPLIER = 0.5 Multiplier to max diplo distance when using the "diplomatic range: restricted" game rule

Diplomatic actions[edit]

Main article: Diplomatic actions

Key Unit Description
NDefines.NDiplomacy.<INTERACTION>_MONEY Gold This determines how much gold a specific diplomatic interaction costs, or multiplier of yearly income for DIVORCE_INTERACTION.
NDefines.NDiplomacy.<INTERACTION>_PIETY Piety This determines how much piety a specific diplomatic interaction costs.
NDefines.NDiplomacy.<INTERACTION>_PRESTIGE Prestige This determines how much prestige a specific diplomatic interaction costs.
NDefines.NDiplomacy.<INTERACTION>_THRESHOLD_FOR_NO The purpose of this value is currently unknown.
NDefines.NDiplomacy.<INTERACTION>_THRESHOLD_FOR_YES The purpose of this value is currently unknown.
NDefines.NDiplomacy.<INTERACTION>_MUST_HAVE_COST Bool Is having prestige/piety >= cost required for this action?
NDefines.NDiplomacy.<INTERACTION>_ENABLED Bool Should this action be used at all? See Decision modding for replacing by a custom decision.
List of interactions[edit]
  • IMPRISON_CHARACTER_INTERACTION
  • RELEASE_FROM_PRISON_INTERACTION
  • EXECUTE_IMPRISONED_INTERACTION
  • EXILE_IMPRISONED_INTERACTION
  • RETIRE_TO_MONASTERY_INTERACTION
  • DEMAND_RELIGIOUS_CONVERSION_INTERACTION
  • INVITE_TO_COURT_INTERACTION
  • TRANSFER_VASSAL_INTERACTION
  • CLAIM_TITLE_INTERACTION
  • REVOKE_TITLE_INTERACTION
  • AWARD_HONORARY_TITLE_INTERACTION
  • REVOKE_HONORARY_TITLE_INTERACTION
  • ASSIGN_VOTER_TITLE_INTERACTION
  • REVOKE_VOTER_TITLE_INTERACTION
  • SEND_ASSASSIN_INTERACTION
  • DECLARE_WAR_INTERACTION
  • OFFER_PEACE_INTERACTION
  • SEND_GIFT_INTERACTION
  • OFFER_VASSALIZATION_INTERACTION
  • ASK_FOR_VASSALIZATION_INTERACTION
  • ARRANGE_BETROTHAL_INTERACTION
  • BREAK_BETROTHAL_INTERACTION
  • OFFER_SUCCESSION_MARRIGE_INTERACTION
  • OFFER_MARRIGE_INTERACTION
  • RANSOM_CHARACTER_INTERACTION
  • EDUCATE_CHARACTER_INTERACTION
  • ABANDON_AMBITION_INTERACTION
  • STOP_BACKING_AMBITION_INTERACTION
  • JOIN_AMBITION_INTERACTION
  • GRANT_LANDED_TITLE_INTERACTION
  • GRANT_VICE_ROYALTY_INTERACTION
  • SETTLE_ADVENTURER_INTERACTION
  • APPOINT_TO_OFFICE_INTERACTION
  • RESIGN_FROM_OFFICE_INTERACTION
  • APPOINT_COMMANDER_INTERACTION
  • RESIGN_COMMANDER_INTERACTION
  • RESIGN_AS_COMMANDER_INTERACTION
  • ASK_FOR_INVASION_INTERACTION
  • ASK_FOR_DIVORCE_INTERACTION
  • DIVORCE_INTERACTION
  • ASK_FOR_EXCOMMUNICATION_INTERACTION_MONEY
  • CALL_ALLY_INTERACTION
  • ASK_TO_LIFT_EXCOMMUNICATION_INTERACTION
  • ASK_TO_RANSOM_CHARACTER_INTERACTION
  • ASK_TO_JOIN_WAR_INTERACTION
  • RELEASE_VASSAL_INTERACTION
  • ASK_TO_EMBARGO_INTERACTION
  • PREPARE_INVASION_INTERACTION
  • MAKE_CONSORT_INTERACTION
  • DISMISS_CONSORT_INTERACTION
  • RETRACT_VASSAL_INTERACTION
  • ASK_FOR_MONEY_INTERACTION
  • ASK_FOR_CLAIM_INTERACTION
  • ASK_FOR_CRUSADE_INTERACTION
  • NOMINATE_BISHOP_TO_POPE_INTERACTION
  • ABSORB_CLAN_INTERACTION
  • SPLIT_CLAN_INTERACTION
  • FORM_BLOOD_OATH_INTERACTION
  • SETTLE_FEUD_INTERACTION
  • FORM_ALLIANCE_INTERACTION
  • DISSOLVE_ALLIANCE_INTERACTION
  • START_COALITION_INTERACTION
  • LEAVE_COALITION_INTERACTION
  • BUY_FAVOR_INTERACTION
  • REQUEST_SUPPORT_INTERACTION
  • CALL_IN_FAVOR_INTERACTION
  • REPLACE_MERCENARY_CAPTAIN_INTERACTION
  • STOP_ENFORCE_PEACE_INTERACTION
  • ASK_TO_DECLARE_WAR_INTERACTION
  • FORM_NON_AGGRESSION_PACT_INTERACTION
  • FORCE_JOIN_FACTION_INTERACTION
  • ASK_REALM_PEACE_INTERACTION
  • ASK_COUNCIL_POSITION_INTERACTION
Send gift[edit]
Key Unit Description
MINIMUM_SEND_GIFT_COST This value determines the minimum amount of gold that can be given away to other characters.
SEND_GIFT_INCOME_SCALEFACTOR This value multiplied by someone's monthly income is what a gift will amount to, unless the value is lower than the MINIMUM_SEND_GIFT_COST.
NDefines.NDiplomacy.SEND_GIFT_DIPLOMACY_MULT = 0.5 Diplomacy affects the opinion bonus multiplied with this
NDefines.NDiplomacy.SEND_GIFT_NOT_LIEGE_BONUS = 7 Not being the liege of the receiver affects the opinon bonus by this much
NDefines.NDiplomacy.SEND_GIFT_GREED_MULT = 0.15 Changes how much greed affects the opinion
NDefines.NDiplomacy.PRESTIGE_LOSS_ON_SEND_GIFT_DECLINE This is the amount of prestige that is lost if someone declines your gift. It is not currently in use
NDefines.NDiplomacy.PIETY_FROM_CHURCH_GIFTS This amount of piety will be gained when giving a gift to a member of the clergy.
Create title[edit]
Key Description
DEJURE_COUNTY_LIMIT_TO_CREATE Fraction of de jure counties that you must control to create a non-imperial title.
EMPIRE_DEJURE_COUNTY_LIMIT_TO_CREATE Fraction of de jure counties that you must control to create an imperial title.
NDefines.NAI.MAX_KING_TITLES_TO_CREATE = 0 Number AI will not seek to create/usurp more King-level titles than this (0 for unlimited)
NDefines.NAI.MAX_EMPIRE_TITLES_TO_CREATE = 0 Number AI will not seek to create/usurp more Empire-level titles than this (0 for unlimited)
NDefines.NAI.AI_EMPEROR_CREATES_KINGDOMS = 0 Bool If set to 1, AI Emperors will create King-level titles
NDefines.NAI.AI_EMPEROR_CREATES_VICE_ROYALTY_KINGDOMS = 1 Bool If set to 1, AI Emperors with the kingdom viceroyalty law will create King-level titles regardless of the setting above
NDefines.NAI.AI_ALWAYS_CREATES_DUCHIES = 0 Bool If set to 1, AI will always create Duchy titles even if it has Gavelkind etc
Usurp title[edit]
Key Unit Description
NDefines.NTitle.DEJURE_COUNTY_LIMIT_TO_USURP = 0.8 Fraction of de jure counties that you must control to usurp a non-imperial title.
NDefines.NTitle.EMPIRE_DEJURE_COUNTY_LIMIT_TO_USURP = 0.8 Fraction of de jure counties that you must control to usurp an imperial title.
NDefines.NDiplomacy.USURP_TITLE_PRESTIGE_MULT = 0.25 The prestige gain from creating a title will be multiplied by this amount if the title is being usurped rather than created.
Declare war[edit]
Key Unit Description
NDefines.NDiplomacy.BREAK_TRUCE_PRESTIGE_PERC_COST = 0.5 This percentage of current prestige will be lost when breaking a truce. Ranges from 0 to 1.
NDefines.NDiplomacy.BREAK_TRUCE_PRESTIGE_COST = 200 This absolute value of prestige will be lost when breaking a truce. The cost is incurred after the percentage cost.
NDefines.NDiplomacy.ATTACKING_SOMEONE_CRUSADING_PIETY_COST = 40 This amount of piety will be lost when attacking someone of your own religion while they're participating in a Crusade.
NDefines.NDiplomacy.ATTACKING_SOMEONE_DEFENDING_AGAINST

_OTHER_RELIGIOUS_GROUP_PIETY_COST = 100

This amount of piety will be lost when attacking someone of your own religion while they're being attacked by someone in a different religious group.
NDefines.NDiplomacy.ATTACKER_CALL_DECLINE_COST = 25 This amount of prestige will be lost when declining a call to join an offensive war.
NDefines.NDiplomacy.DEFENDER_CALL_DECLINE_COST = 100 This amount of prestige will be lost when declining a call to join a defensive war.
NDefines.NDiplomacy.ALLIED_CALL_DECLINE_COST = 200 This amount of prestige will be lost when declining a call to war from an ally.
NDefines.NDiplomacy.TRIBAL_VASSAL_CALL_DECLINE_COST_FACTOR = 3.0 Prestige cost multiplier for tribal vassals
NDefines.NDiplomacy.DOW_ON_ALLY_PRESTIGE_COST = 50 This amount of prestige is required in order to declare war on an ally, and will be removed upon doing so.
NDefines.NDiplomacy.ALLIANCE_BREAKER_MODIFIER_MONTHS = 3650 Months How long the alliance breaker temporary modifier lasts
NDefines.NDiplomacy.TRUCE_BREAKER_MODIFIER_MONTHS = 3650 Months How long the truce breaker temporary modifier lasts
NDefines.NDiplomacy.MIN_PREP_INV_TARGET_HOLDINGS = 9 Realms with less than this number of holdings within a target kingdom cannot be targeted by a prepared invasion.
NDefines.NDiplomacy.MAX_PREP_INV_TARGET_HOLDINGS = 40 Realms with more than this number of holdings within a target kingdom cannot be targeted by a prepared invasion.
NDefines.NDiplomacy.MAX_PREP_INV_ATTACKER_HOLDINGS = 40 Rulers with more than this number of holdings cannot prepare invasions.
NDefines.NDiplomacy.PREP_INV_REQ_PRESTIGE = 1000 Rulers need this amount of prestige in order to prepare an invasion.
NDefines.NDiplomacy.INTER_MUSLIM_WAR_MONTHLY_PIETY_COST = 2 Muslims will lose this amount of piety each month if attacking other Muslims of the same religion. Rebellions won't incur this piety cost.
Banish[edit]
Key Unit Description
NDefines.NDiplomacy.BANISH_TAKE_WEALTH_PERCENTAGE_LANDED = 0
NDefines.NDiplomacy.BANISH_TAKE_WEALTH_PERCENTAGE_COURTIER = 1
NDefines.NDiplomacy.BANISH_REALM_SIZE_CHANCE_RATIO_MODIFIER = 2
Grant independence[edit]
Key Unit Description
NDefines.NDiplomacy.RELEASE_VASSAL_TRUCE_DAYS = 3650 Days Truce with vassal after granting independence.
Release prisoner[edit]
Key Unit Description
NDefines.NDiplomacy.RELEASE_PRISONER_PIETY = 5 This amount of piety will be gained when releasing a prisoner.
Assassination[edit]
Key Unit Description
NDefines.NDiplomacy.ASSASSINATION_COST_RANK_MULT = 100 Additional cost for assassinations multiplied by rank (count = 1, emperor = 4). Also applies to children of rulers.

Interface[edit]

Portraits[edit]

Main article: Portrait modding

Key Unit Description
NDefines.NCharacter.PORTRAIT_ADULT_MALE_AGE_THRESHOLD = 16 Age Male child to adult age portrait switch
NDefines.NCharacter.PORTRAIT_ADULT_FEMALE_AGE_THRESHOLD = 16 Age Female child to adult age portrait switch
NDefines.NCharacter.PORTRAIT_MID_AGE_THRESHOLD = 30 Age Middle age switch for character portraits
NDefines.NCharacter.PORTRAIT_OLD_AGE_THRESHOLD = 50 Age Old age switch for character portraits
NDefines.NCharacter.EARLY_PORTRAIT_AND_UNIT_BEFORE_YEAR = 950 Date Before this date, early versions of Units and Portraits will be used if available
NDefines.NCharacter.LATE_PORTRAIT_AND_UNIT_AFTER_YEAR = 1200 Date After this date, late versions of Units and Portraits will be used if available
NDefines.NGraphics.NUMBER_OF_PROPERTIES = 14 Int Number of letters in properties string (zeros will be added if some letters are missing in character history). This allows to add custom properties in portrait_properties.txt.

Misc[edit]

Defines that don't fit in any other category.

Key Unit Description
NDefines.NCharacter.PAPAL_INVEST_PIETY_COST_MULT = 0.5 When Papal Investiture is in place, the Piety cost of religious actions will be multiplied by this value.
NDefines.NDiplomacy.MAX_DUCHIES_LEGALLY_HELD = 2 Beyond this number of duchies held, vassals will start to get angry with their liege. Does not apply if the liege is duke-level.
NDefines.NDiplomacy.MUSLIM_TEMPLE_HOLDING_MONTHLY_PIETY = 0.2 Muslims will get this amount of piety per month for each temple in their demesne.
NDefines.NDiplomacy.PAGAN_PEACE_MONTHS = 24 After this number of months, Pagans will start to lose prestige for being at peace.
NDefines.NDiplomacy.PAGAN_PEACE_MONTHLY_PRESTIGE_LOSS = 2.0 Pagans will lose this amount of prestige each month for being at peace.
Modding
Common
Gfx/Sfx/localisation