Where are the happiness control files now?

Raider

Warlord
Joined
Sep 3, 2002
Messages
169
Could someone please tell me where the happiness controls are? I see happiness mod folder and the files in it. However, those files do not have the main controls I am looking for such as multiplies for tech level, distress/technology/etc and policies(this is a component)???

I want do edit some of those values down a bit.

I feel like the latest patch is back to absurd happiness settings that I remember from a few years back where from one turn to the next you can get hit with a massive unhappiness increase.

I was playing an Immortal game and had happiness/unhappiness hovering around 70. Then a turn passes (a new policy unlocks) and my unhappiness goes up to just over 100 and my empire is massively unhappy. I happened to check the multipliers for needs the turn before and after and in one turn it went from 66% to 88%. That's just silly to me.

Anyway, long story short, could you guys tell me where those settings are in the current file setup? Thank you.
 
Could someone please tell me where the happiness controls are? I see happiness mod folder and the files in it. However, those files do not have the main controls I am looking for such as multiplies for tech level, distress/technology/etc and policies(this is a component)???

I want do edit some of those values down a bit.

I feel like the latest patch is back to absurd happiness settings that I remember from a few years back where from one turn to the next you can get hit with a massive unhappiness increase.

I was playing an Immortal game and had happiness/unhappiness hovering around 70. Then a turn passes (a new policy unlocks) and my unhappiness goes up to just over 100 and my empire is massively unhappy. I happened to check the multipliers for needs the turn before and after and in one turn it went from 66% to 88%. That's just silly to me.

Anyway, long story short, could you guys tell me where those settings are in the current file setup? Thank you.
(1) Community Patch > Core Files > Core Values > CoreDefines.sql

Unhappiness increases when a city changes size naturally, which updates the cached median for needs in that city. Policies have no effect on it. Instant pop boosts from Ruins, Events, etc. shouldn't count.

Code:
-- VP Defines

-- Happiness System Rework
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPY_THRESHOLD', '50'; -- Below this approval rating threshold, the empire is unhappy

-- Bonus/Penalty to Growth based on Local Happiness
INSERT INTO Defines (Name, Value) SELECT 'LOCAL_HAPPINESS_FOOD_MODIFIER', '2'; -- % bonus to Growth per point of Local Happiness above Local Unhappiness
INSERT INTO Defines (Name, Value) SELECT 'LOCAL_UNHAPPINESS_FOOD_MODIFIER', '10'; -- % penalty to Growth per point of Local Unhappiness above Local Happiness

-- Penalty to Growth if empire is super unhappy
INSERT INTO Defines (Name, Value) SELECT 'GLOBAL_GROWTH_PENALTY_PER_UNHAPPY', '2.5'; -- Global % penalty to Growth when the empire is unhappy, per approval rating % below 50

-- Production penalties if unhappy
INSERT INTO Defines (Name, Value) SELECT 'LOCAL_UNHAPPY_SETTLER_PRODUCTION_PENALTY', '-10'; -- Local % penalty to Settler production for each point of Local Unhappiness above Local Happiness
INSERT INTO Defines (Name, Value) SELECT 'LOCAL_UNHAPPY_COMBAT_UNIT_PRODUCTION_PENALTY', '-10'; -- Local % penalty to combat unit production for each point of Local Unhappiness above Local Happiness
INSERT INTO Defines (Name, Value) SELECT 'GLOBAL_SETTLER_PRODUCTION_PENALTY_PER_UNHAPPY', '2.5'; -- Global % penalty to Settler production when the empire is unhappy, per approval rating % below 50
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPY_MAX_UNIT_PRODUCTION_PENALTY', '-75'; -- Maximum penalty to any kind of unit production from happiness

-- Great Musician Happiness
INSERT INTO Defines (Name, Value) SELECT 'GREAT_MUSICIAN_BLAST_HAPPINESS', '2';

-- Unhappiness from Needs
INSERT INTO Defines (Name, Value) SELECT 'YIELD_MEDIAN_PERCENTILE', '50'; -- 50 = true median. Values below 50 will try to pick a city below the true median, values above 50 will try to pick a city above it. Capped between 1 and 100.
INSERT INTO Defines (Name, Value) SELECT 'YIELD_MEDIAN_MIN_POP_REQUIREMENT', '3'; -- The required population for a city to be counted in the global median for Needs. Prevents an early game unhappiness spike due to the high initial rate per citizen.
INSERT INTO Defines (Name, Value) SELECT 'TECH_COUNT_MEDIAN_PERCENTILE', '50'; -- 50 = true median. See YIELD_MEDIAN_PERCENTILE above. Only used if TECH_NEED_MODIFIER_PER_TECH_ABOVE_MEDIAN or TECH_NEED_MODIFIER_PER_TECH_BELOW_MEDIAN are enabled below.

INSERT INTO Defines (Name, Value) SELECT 'DISTRESS_MEDIAN_BASE_MODIFIER', '100'; -- The median Food/Production need for a city (after modifiers) is multiplied by this value and then divided by 100. Higher values = more Unhappiness.
INSERT INTO Defines (Name, Value) SELECT 'DISTRESS_MEDIAN_RATE_CHANGE', '0.65'; -- The rate at which the global median for Distress changes. Valid values are between 0.01 and 1.00. Higher values cause the median to shift more quickly.

INSERT INTO Defines (Name, Value) SELECT 'POVERTY_MEDIAN_BASE_MODIFIER', '100'; -- The median Gold need for a city (after modifiers) is multiplied by this value and then divided by 100. Higher values = more Unhappiness.
INSERT INTO Defines (Name, Value) SELECT 'POVERTY_MEDIAN_RATE_CHANGE', '0.65'; -- The rate at which the global median for Poverty changes. Valid values are between 0.01 and 1.00. Higher values cause the median to shift more quickly.

INSERT INTO Defines (Name, Value) SELECT 'ILLITERACY_MEDIAN_BASE_MODIFIER', '100'; -- The median Science need for a city (after modifiers) is multiplied by this value and then divided by 100. Higher values = more Unhappiness.
INSERT INTO Defines (Name, Value) SELECT 'ILLITERACY_MEDIAN_RATE_CHANGE', '0.65'; -- The rate at which the global median for Illiteracy changes. Valid values are between 0.01 and 1.00. Higher values cause the median to shift more quickly.

INSERT INTO Defines (Name, Value) SELECT 'BOREDOM_MEDIAN_BASE_MODIFIER', '100'; -- The median Culture need for a city (after modifiers) is multiplied by this value and then divided by 100. Higher values = more Unhappiness.
INSERT INTO Defines (Name, Value) SELECT 'BOREDOM_MEDIAN_RATE_CHANGE', '0.65'; -- The rate at which the global median for Boredom changes. Valid values are between 0.01 and 1.00. Higher values cause the median to shift more quickly.

INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_RELIGIOUS_MINORITY_POP', '0.5'; -- Base Unhappiness per religious minority citizen. Modified by need modifiers. (rounded up)

-- Unhappiness Need Modifiers (modify the median value)
INSERT INTO Defines (Name, Value) SELECT 'CAPITAL_NEED_MODIFIER', '25'; -- +x% Needs in the capital. Offsets boost from Palace, helps make Capital a source of Unhappiness early on.
INSERT INTO Defines (Name, Value) SELECT 'TECH_NEED_MODIFIER_PERCENT_RESEARCHED', '0'; -- Modifier to needs equal to % of techs researched, multiplied by this value and then divided by 100. Disabled by default.
INSERT INTO Defines (Name, Value) SELECT 'TECH_NEED_MODIFIER_PER_TECH_ABOVE_MEDIAN', '0'; -- Modifier to needs for each tech ahead of the median # of techs researched you are. Disabled by default. 100 = 1%.
INSERT INTO Defines (Name, Value) SELECT 'TECH_NEED_MODIFIER_PER_TECH_BELOW_MEDIAN', '0'; -- Modifier to needs for each tech behind the median # of techs researched you are. Disabled by default. -100 = -1%.
INSERT INTO Defines (Name, Value) SELECT 'CITY_SIZE_NEED_MODIFIER', '0'; -- Modifier to needs per citizen in the city. Disabled by default. -100 = -1%.
INSERT INTO Defines (Name, Value) SELECT 'EMPIRE_SIZE_NEED_MODIFIER_CITIES', '500'; -- Modifier to needs per non-puppet city in the empire, excluding the capital. Scales with map size. Default is 500 (+5%). Does not support negative values.
INSERT INTO Defines (Name, Value) SELECT 'EMPIRE_SIZE_NEED_MODIFIER_POP', '25'; --  Modifier to needs per citizen in the empire, excluding those in puppet cities. Scales with map size. Default is 25 (+1% per 4 citizens). Does not support negative values.

-- Unhappiness from Other Sources
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_STARVING_POP', '1.0'; -- Unhappiness point per starving citizen. (rounded down)
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_PILLAGED_TILE', '0.50'; -- Unhappiness point per pillaged plot owned by city. (rounded down)
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_ISOLATED_POP', '0.34'; -- Unhappiness point per pop if unconnected or blockaded. (rounded down)
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_SPECIALIST', '100'; -- 100 = 1 unhappiness per specialist.
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_X_PUPPET_CITIZENS', '4'; -- Puppets produce flat unhappiness based on # of citizens in the city. This is the divisor.
INSERT INTO Defines (Name, Value) SELECT 'WAR_WEARINESS_POPULATION_PERCENT_CAP', '34'; -- This is the % of empire population that war weariness is capped at.
 
Ah, thank you.

So if I am reading this correctly, it looks like setting the values for something like Poverty to less than 100 will decrease the unhappiness from it.

I think from reading this I see what happened. I founded 2 additional cities, then some large cities added a pop, their values got reset with the new empire size need modifier and I got hard owned.
 
Top Bottom