Skip to content

Commit

Permalink
adjustments to pop growth
Browse files Browse the repository at this point in the history
  • Loading branch information
schombert committed Aug 24, 2023
1 parent 6bd4e16 commit 73cc943
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/economy/demographics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ void update_growth(sys::state& state, uint32_t offset, uint32_t divisions) {
auto mod_sum = state.world.province_get_modifier_values(loc, sys::provincial_mod_offsets::population_growth) +
state.world.nation_get_modifier_values(owner, sys::national_mod_offsets::pop_growth);

auto total_factor = ln_factor * province_factor * 4.0f + mod_sum;
auto total_factor = ln_factor * province_factor * 4.0f + mod_sum * 0.1f;
auto old_size = state.world.pop_get_size(ids);
auto new_size = old_size * total_factor + old_size;

Expand Down Expand Up @@ -1161,7 +1161,7 @@ float get_monthly_pop_increase(sys::state& state, dcon::pop_id ids) {
auto mod_sum = state.world.province_get_modifier_values(loc, sys::provincial_mod_offsets::population_growth) +
state.world.nation_get_modifier_values(owner, sys::national_mod_offsets::pop_growth);

auto total_factor = ln_factor * province_factor * 4.0f + mod_sum;
auto total_factor = ln_factor * province_factor * 4.0f + mod_sum * 0.1f;
auto old_size = state.world.pop_get_size(ids);

return old_size * total_factor;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/topbar_subwindows/gui_population_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ void describe_growth(sys::state& state, text::columnar_layout& contents, dcon::p
auto mod_sum = state.world.province_get_modifier_values(loc, sys::provincial_mod_offsets::population_growth) +
state.world.nation_get_modifier_values(owner, sys::national_mod_offsets::pop_growth);

auto total_factor = ln_factor * province_factor * 4.0f + mod_sum;
auto total_factor = ln_factor * province_factor * 4.0f + mod_sum * 0.1f;

if(type == state.culture_definitions.slaves)
total_factor = 0.0f;
Expand Down
4 changes: 2 additions & 2 deletions src/provinces/province.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ float monthly_net_pop_growth(sys::state& state, dcon::province_id id) {
life_rating = 0;
}

float growth_factor = life_rating + state.defines.base_popgrowth;
float growth_factor = life_rating * 0.1f + state.defines.base_popgrowth;

float life_needs = state.world.province_get_demographics(id, demographics::poor_everyday_needs) +
state.world.province_get_demographics(id, demographics::middle_everyday_needs) +
Expand All @@ -394,7 +394,7 @@ float monthly_net_pop_growth(sys::state& state, dcon::province_id id) {
life_needs /= total_pops;

float growth_modifier_sum = ((life_needs - state.defines.life_need_starvation_limit) * growth_factor * 4 +
state.world.province_get_modifier_values(id, sys::provincial_mod_offsets::population_growth) +
state.world.province_get_modifier_values(id, sys::provincial_mod_offsets::population_growth) * 0.1f +
state.world.nation_get_modifier_values(nation, sys::national_mod_offsets::pop_growth) * 0.1f); // /state.defines.slave_growth_divisor;

// TODO: slaves growth
Expand Down

0 comments on commit 73cc943

Please sign in to comment.