﻿NCharacters = {
	NUM_RANDOM_NAME_TRIES_FOR_UNIQUENESS = 3	# When generating random names for characters, try this many times to find a unique name within the country [>=1]
	RULER_MIN_AGE_FOR_HEIR = 20 				# Before this age, don't randomly generate heirs for rulers
	RULER_AGE_FOR_HEIR_CHANCE_BOOST = 30 		# A year after this age start boosting chance of heir generation
	RULER_HEIR_GENERATION_CHANCE = 0.001 		# Per day
	RULER_HEIR_CHANCE_BOOST_SCALE = 0.001 		# Added to RULER_HEIR_CHANCE_BOOST for each year after RULER_AGE_FOR_HEIR_CHANCE_BOOST
	AGE_GENERATION_STARTVAL = 20
	AGE_GENERATION_DICE_ROLL_MAGNITUDE = 6
	AGE_GENERATION_NUM_DICE_ROLLS = 5
	RECRUIT_COMMANDER_NUM_OPTIONS = 3
	RECRUIT_COMMANDER_POOL_SIZE = 5
	RECRUIT_COMMANDER_VALUE_MARGINAL = -50
	RECRUIT_COMMANDER_VALUE_AGE_MULT = 0.5
	RECRUIT_COMMANDER_VALUE_SAME_IGS = -40
	RECRUIT_COMMANDER_REMOVE_AGE = 55			# removed from the recruit pool when they reach 55 years
	COMMANDER_START_RANK = 1
	HIGHEST_PROMOTION_RANK = 5
	RULER_COMMANDER_START_RANK = 6
	POPULARITY_HATED_THRESHOLD = -50
	POPULARITY_DISLIKED_THRESHOLD = -25
	POPULARITY_LIKED_THRESHOLD = 25
	POPULARITY_LOVED_THRESHOLD = 50
	POPULARITY_AUTHORITY_FACTOR = 1			# Popularity of ruler is multiplied by this when turned into Authority
	ADULT_AGE = 16 # Characters under this age have more limited options. For example they cannot become military leaders [>= 0]
	OLD_AGE = 60 # Characters above this age may get some specific traits and events [>= ADULT_AGE]
	
	VOIDED_CHARACTER_DEFAULT_DURATION = 12 # Default months a character will be in the void before being deleted

	INHERIT_RECESSIVE_GENE_CHANCE = 0.25 # Probability of a recessive gene being picked as an heir's dominant/recessive gene. Only used for portraits.

	AGITATOR_EXPECTED_SPAWN_INTERVAL_0_LITERACY = 12 # At 0% literacy, a new agitator is expected to spawn in a given country once every this many years. (supports decimal values)
	AGITATOR_EXPECTED_SPAWN_INTERVAL_100_LITERACY = 2 # At 100% literacy, a new agitator is expected to spawn in a given country once every this many years. (supports decimal values)
	AGITATOR_MOVEMENT_SUPPORT_WEIGHT = 0.5 # Political movements will gain support from agitators' popularity multiplied by this weight
	AGITATOR_MOVEMENT_POPULARITY_THRESHOLD = 15 # Agitators whose popularity is at or lower than this threshold will not be considered when starting/joining political movements

	### TRAIT GENERATION
	# Every week, a character's Expected Trait Value meter increases by the specified amount below depending on their role and what they're doing (Commanders also gain the Activity Level from their Orders)
	# Every week, a percentile die is rolled against ( Expected Trait Value meter - Current Trait Value . If the die rolls under the current value, a new random trait will be added, if a valid one exists.
	
	WEEKLY_CONDITION_CHANCE = 0.03					# The chance that a character will get a condition each week (1 = 1%)
	MAX_EXPECTED_TRAIT_VALUE = 12.0					# The maximum amount of Trait Value a character can develop normally (note: not adhered to by add_trait effect)
	MAX_TRAITS_PERSONALITY = 2						# The max amount of Personality Traits a character can develop normally (note: not adhered to by add_trait effect)
	MAX_TRAITS_SKILL = 2							# The max amount of Skill Traits a character can develop normally (note: not adhered to by add_trait effect)
	MAX_TRAITS_CONDITION = 2						# The max amount of Condition Traits a character can develop normally (note: not adhered to by add_trait effect)
	
	TRAIT_GAIN_DIVISOR = 100.0						# Final trait gain is always divided by this so we don't have to use all the decimals
	DEFAULT_TRAIT_GAIN = 0.25						# Every character's Expected Traits meter increases by this much per week by default
	TRAIT_GAIN_POLITICIAN_POWERFUL = 0.1			# Powerful Politicians Expected Traits meter increases by this much *extra* each week
	TRAIT_GAIN_RULER = 0.1							# Rulers Expected Traits meter increases by this much *extra* each week
	TRAIT_GAIN_COMMANDER_RECRUITABLE = 0.05			# Recruitable offer commanders Expected Traits meter increases by this much per week, overrides all other factors
	TRAIT_GAIN_IN_EXILE_POOL = 0.1					# Characters in the exile pool Expected Traits meter increases by this much per week, overrides all other factors
	TRAIT_GAIN_VOIDED = 0.0							# Voided characters Expected Traits meter increases by this much per week, overrides all other factors

	# The following parameters determine how character life expectancy is calculated. The calculation is based on a normal distribution with parameters:
	# µ = CHARACTER_LIFE_EXPECTANCY_BASE_YEARS
	# σ = CHARACTER_LIFE_EXPECTANCY_STDDEV_YEARS
	#
	# While the mean of the distribution is fixed, the result is modified by the health value of the character.
	# The way character health affects the life expectancy is given by the formula ((h / bh) - 1) * d, where:
	# - h is the character health
	# - bh is the baseline health
	# - d is the value of CHARACTER_LIFE_EXPECTANCY_DELTA_YEARS
	#
	# (h / bh) - 1 is the "distance to baseline health" of the character. For each point of distance away from baseline, a character will live CHARACTER_LIFE_EXPECTANCY_DELTA_YEARS more or less.
	#
	# Since the domain of the normal distribution is [-∞; +∞], we establish a hard cutoff defined by CHARACTER_LIFE_EXPECTANCY_CUTOFF. This value is expressed in σ, or standard deviations away from the mean.
	# It is recommended to leave that value to 3, as 99.73% of values of the ditribution fall in the range [-3σ; +3σ].
	# Because of the above, with default values a character with 0 health will die between the ages of 50 and 80, while a character with 2 health will die between the ages of 70 and 100.
	#
	# NOTE: due to some performance optimizations, changing these values will either have no effect or unexpected behaviour until the game is restarted, even if they are hot reloaded.

	MIN_CHARACTER_HEALTH = 0.0					# Baseline is 1.0 (meaning 100%), defined in the base_values modifier. 0.0 means -100% from baseline. [any value]
	MAX_CHARACTER_HEALTH = 2.0					# Baseline is 1.0 (meaning 100%), defined in the base_values modifier. 2.0 means +100% from baseline. [>= MIN_CHARACTER_HEALTH]
	CHARACTER_LIFE_EXPECTANCY_BASE_YEARS = 75	# The median life expecancy in years at baseline health. It's the µ parameter of the normal distribution [> 0]
	CHARACTER_LIFE_EXPECTANCY_STDDEV = 5		# The standard deviation for the life expectancy distribution. It's the σ parameter [> 0]
	CHARACTER_LIFE_EXPECTANCY_CUTOFF = 3		# We clamp the distribution between this amount of σ in both directions. A range of [-3σ; +3σ] accounts for 99.73% of values. [> 0]

	CHARACTER_LIFE_EXPECTANCY_DELTA_YEARS_BELOW_BASELINE = 60	# Random base for years that life expectancy is decreased by, for every point of distance below baseline health [>= 0]
	CHARACTER_LIFE_EXPECTANCY_DELTA_YEARS_ABOVE_BASELINE = 15	# Random base for years that life expectancy is increased by, for every point of distance above baseline health [>= 0]
	
	# Random base for life expectancy delta yearsis multiplied by a random range of lerp(CHARACTER_LIFE_EXPECTANCY_DELTA_LERP_LOWER_BOUND, CHARACTER_LIFE_EXPECTANCY_DELTA_LERP_UPPER_BOUND)
	CHARACTER_LIFE_EXPECTANCY_DELTA_LERP_LOWER_BOUND = 0.5
	CHARACTER_LIFE_EXPECTANCY_DELTA_LERP_UPPER_BOUND = 1.5		
	
	GUARANTEED_SURVIVABILITY_DAYS_MIN = 30		# A character that stops being immortal and that should have died when it happens will instead live at least this amount of days, to avoid situations like a character dieing immediately upon finishing an expedition [>= 0]
	GUARANTEED_SURVIVABILITY_DAYS_MAX = 180		# As above, but the upper limit of the range [>= GUARANTEED_SURVIVABILITY_DAYS_MIN]
}