Terra Invicta

Terra Invicta

83 ratings
Population Growth Rework
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.718 MB
29 May, 2023 @ 3:12pm
23 May @ 11:28am
7 Change Notes ( view )

Subscribe to download
Population Growth Rework

Description
Currently, a nation's education level will have massive penalty on the population growth.
The penalty is capped at -4.49% annual population growth at ~11 education.

This mod changes the penalty cap to -3.36% at 8 education. If you are noticing a hopeless decline of the global population in late game, this mod should provide a fix to that.

Requires a mod manager.

!!! This mod is made for validation-release, might cause crash if pop growth mechanism is being updated in the validation branch.

To switch to validation-release: Right click game - properties - beta - select validation from drop-down.

Popular Discussions View All (1)
2
11 Feb, 2024 @ 4:42pm
Crash on new game unpause
Brahkam
57 Comments
Eiliya 25 Aug @ 6:26am 
感谢更新🫡
Cardinal_Z  [author] 23 May @ 12:04pm 
Updated.
Cardinal_Z  [author] 22 May @ 6:04pm 
Ok I'm back, will update this soon.

The equation was moved to the getter a long time ago, I didn't know how to use harmony on getter back then :P
Taytoh 18 May @ 10:54am 
@Blue could you try uploading it again or could ya send that file my way? I'd really appreciate it as im trying to start a new game to see the update stuff without dealing with negative pop growth modifiers. If you're willing, just shoot me a friend request. Thanks!
Blue 12 Apr @ 6:29am 
I made a version running on 0.4.78, but I can't upload it, no idea why.
@Cardinal_Z if your want my code, I'd be happy to give it to you.
Blue 12 Apr @ 3:58am 
public double get_annualPopulationGrowth()
{
double num = 4.49788037409348;
return Mathd.Max(Mathd.Clamp(num + Mathd.Max(-num, -0.418190741 * (double)this.nation.education) + -0.0624798523403752 * (double)this.nation.cohesion + 9.80843732089162E-06 * (double)Mathf.Min(180000f, this.nation.perCapitaGDP) + -0.115739931206548 * (double)Mathf.Sqrt(Mathf.Abs(this.latitude)) + (double)((this.annualPopGrowthModifier + this.nation.template.popGrowthModifier) * Mathf.Max(0f, (25f - TITimeState.CampaignDuration_years_Exact()) / 25f)) - (double)(this.xenoforming.xenoformingLevel / 200f) - (double)(this.nuclearDetonations * 4), -10.0, 10.0) - (double)(Math.Max(0f, Mathf.Abs(GameStateManager.GlobalValues().temperatureAnomaly_C) - 8f) * ((this.template.environment == EnvironmentType.Beneficiary) ? 0.5f : ((this.template.environment == EnvironmentType.Vulnerable) ? 2f : 1f))), -100.0) * 0.01;
}
Blue 12 Apr @ 3:58am 
moved to getter function in TIRegionstate.annualPopulationGrowth variable
also some stuff was added to the equation
explodoboy 13 Mar @ 5:33pm 
Some more info for whenever the experimental changes come into effect:

The equation where the pop growth modifier is calculated has been moved to a variable with a getter function. The part where the Education modifier is calculated is done in a Mathd.Max(). You should be able to set the desired maximum by reducing the first parameter's value from:

[0 - 4.49788037409348]

to something else.
Cardinal_Z  [author] 13 Mar @ 4:35pm 
Thanks for the log! will look into it.
explodoboy 13 Mar @ 1:18pm 
This appears to cause a crash on the latest experimental version. Be aware if any of you intend on using this on the betas.

---

For the mod author. It appears that ModifyGDP() has been renamed, removed, or its parameters changed:

MissingMethodException: void PavonisInteractive.TerraInvicta.TINationState.ModifyGDP(double)
at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.PavonisInteractive.TerraInvicta.TIRegionState.GrowPopulationByMonth_Patch1(PavonisInteractive.TerraInvicta.TIRegionState)
at PavonisInteractive.TerraInvicta.TINationState.MonthlyNationUpdate (System.Single eyes) [0x00261] in <fc64ee07b6424672ad1bcb59c1f0c3e5>:0
at