Hello,
This mod will speed up purges for crisis factions for V2.7+. I've created it here on the steam workshop:
https://steamcommunity.com/sharedfiles/filedetails/?id=2245706058
It's also on the paradox modding site but I never use that, so I couldn't actually tell you how to find it there lol.
Background info on the problem this mod solves:
Currently when crises invade worlds they use the generic "Extermination purge" - this is available to regular empires and is balanced so it can take months to kill a single pop. This is not good for a crisis ... it means it could be sitting around for decades or even centuries trying to purge an ecumenopolis (for example) or even years for smaller worlds, this slows down crisis expansion to a crawl.
In past versions of the game (pre 2.0) multiple pops could be killed at the same time/in the same month by a purge.
Post 2.0 this is impossible - only one may die at a time and at most one may die per a month. This led to 2/3 crises (Prethoryn swarm & contingency)struggling to expand, as they need to invade worlds before they can move on (the unbidden just bomb and move on).
What this mod does, exactly;
It adds a check that runs each time a battle ends, when it sees a battle was won by a non-default (i.e. not a playable) country, whilst the galaxy has a crisis ongoing (determined by a global flag), it will fire a second event that executes 1 pop on that world if it's been marked for "purging".
TLDR: This means crises will purge worlds approx. 25x faster with this mod enabled.
If you combine this with the time defenders hold out (on high pop or fortified worlds) it will still give you a slim chance to mount a rescue/liberation of the world before its infested... but you'll need to move fast no more waiting around for a century before saving those pops.
How does this mod work, exactly:
I have copied in the 2 files below for those who just want to see how it works, for curiosity or use in their own mods without having to fetch it off steam first.
And by all means if you want to use this for your own mod or whatever, go right ahead.
Here is the on_action file (located in modroot\common\on_actions\fastpurge_on_action.txt)
Here is the event file (located in modroot\events\fastpurge_event.txt)
Performance:
What thread isnt complete without its own performance comments?
I'm deleting pops, and only on specific worlds that the crisis has landed on, and only once an ingame week (though multiple worlds can purge on different days, its not locked to date, but rather every 7 days, spreading the load out more evenly in a game-month), so it's pretty insignificant CPU load.
I run the game on an i7-4790k clocked at 4.5ghz with 16gb DDR3 ram.
I have noticed no slowdowns whilst testing this vs vanilla, I tag-switched to the prethoryn and invaded several worlds simultaneously and it didnt lead to stutter for me.
Your mileage may vary.
This mod will speed up purges for crisis factions for V2.7+. I've created it here on the steam workshop:
https://steamcommunity.com/sharedfiles/filedetails/?id=2245706058
It's also on the paradox modding site but I never use that, so I couldn't actually tell you how to find it there lol.
Background info on the problem this mod solves:
Currently when crises invade worlds they use the generic "Extermination purge" - this is available to regular empires and is balanced so it can take months to kill a single pop. This is not good for a crisis ... it means it could be sitting around for decades or even centuries trying to purge an ecumenopolis (for example) or even years for smaller worlds, this slows down crisis expansion to a crawl.
In past versions of the game (pre 2.0) multiple pops could be killed at the same time/in the same month by a purge.
Post 2.0 this is impossible - only one may die at a time and at most one may die per a month. This led to 2/3 crises (Prethoryn swarm & contingency)struggling to expand, as they need to invade worlds before they can move on (the unbidden just bomb and move on).
What this mod does, exactly;
It adds a check that runs each time a battle ends, when it sees a battle was won by a non-default (i.e. not a playable) country, whilst the galaxy has a crisis ongoing (determined by a global flag), it will fire a second event that executes 1 pop on that world if it's been marked for "purging".
- It will then fire the event again on (currently) a 7 day delay, to kill another pop.
- If there is only 1 pop left on the world the event aborts.
- The last pop is left to be killed by the purge process incase any scripts hook in to that (i dont think they do, but better to be safe than sorry).
- It should be noted that purging is still running so you have slightly more than 1 pop dying each week when you average it.
Lets take a world with 200 pops as our test case:
Purging adds 35/100 each month and there is no overflow so to purge 1 pop takes 3 months. Purging 200 pops takes 600 months (600/12 = FIFTY YEARS! to wipe out a world with 200 pops)
Now lets take my mod and recompute that. (200-1)/7 = 28.43 months to wipe out all but the last pop on a planet + 3 months for purging to kill the last one = 31 months (31/12 = 2.6 years)
[total #pops - 1 as it wont fire on the last one / 7 days per pop death]
But there's more, as purging is running concurrently, we can take 28/3 to see that ~9 pops will have been "vanilla-purged" alongside this mod,
So the actual time to wipe out 200 pops is closer to 2 years total. (50 years vanilla / 2 years modded = ~25x faster)
Purging adds 35/100 each month and there is no overflow so to purge 1 pop takes 3 months. Purging 200 pops takes 600 months (600/12 = FIFTY YEARS! to wipe out a world with 200 pops)
Now lets take my mod and recompute that. (200-1)/7 = 28.43 months to wipe out all but the last pop on a planet + 3 months for purging to kill the last one = 31 months (31/12 = 2.6 years)
[total #pops - 1 as it wont fire on the last one / 7 days per pop death]
But there's more, as purging is running concurrently, we can take 28/3 to see that ~9 pops will have been "vanilla-purged" alongside this mod,
So the actual time to wipe out 200 pops is closer to 2 years total. (50 years vanilla / 2 years modded = ~25x faster)
If you combine this with the time defenders hold out (on high pop or fortified worlds) it will still give you a slim chance to mount a rescue/liberation of the world before its infested... but you'll need to move fast no more waiting around for a century before saving those pops.
How does this mod work, exactly:
I have copied in the 2 files below for those who just want to see how it works, for curiosity or use in their own mods without having to fetch it off steam first.
And by all means if you want to use this for your own mod or whatever, go right ahead.
Here is the on_action file (located in modroot\common\on_actions\fastpurge_on_action.txt)
.
.
Code:
# Triggers country_event for the attacker upon victory
# (Before controller is switched)
# This = country, leader attacker
# From = country, planet owner
# FromFrom = planet
# IDENTITIES: attacker is the side that "IsHostile" to
# the planet controller; e.g. spawned monster armies
# are attackers, but if they win and the player attempts
# to retake the planet, the player is the attacker
on_planet_attackers_win = {
events = {
fastcrisispurge.1
}
}
.
.
Code:
namespace = fastcrisispurge
# Pop death interval
@deathinterval = 7 # days between re-running fastcrisispurge.2 to kill a pop.
# Gate-keeper event. Triggered by on_planet_attackers_win, runs on the winning attacker country (#root).
country_event = {
id = fastcrisispurge.1
hide_window = yes # no popup
is_triggered_only = yes # only fires on successful invasions
trigger = {
has_global_flag = galactic_crisis_happened # Do nothing if no crisis has kicked off.
OR = { # Do nothing if the invader isnt one of the crisis country types.
is_country_type = swarm
is_country_type = extradimensional
is_country_type = extradimensional_2
is_country_type = extradimensional_3
is_country_type = ai_empire
is_country_type = gray_goo
has_country_flag = uses_faster_purges_mod # If modders want to, they can give this flag to their custom factions for it to work with them.
}
}
immediate = {
#set_country_flag = faster_pop_purge_engaged_cntry # debug flag on attacker (not needed)
FromFrom = { # Target the planet from the battle
planet_event = { id = fastcrisispurge.2 } # proceed to kill-pop event
}
}
}
# Killing event. scopes to the invaded planet.
planet_event = {
id = fastcrisispurge.2
hide_window = yes # no popup
is_triggered_only = yes # triggered via above
location = root
pre_triggers = {
has_owner = yes # Not a barren or empty world
is_occupied_flag = yes # Does the "occupied" flag even work for crises?
has_ground_combat = no # No pop-killing during fighting - if another empire counter-invades this should abort the next pop-death.
}
trigger = { # if there is 1 pop left, abort event. Let it die via purging or some non-event means, to not break other checks.
num_pops > 1 # only execute if #pops greater than 1 on planet
}
immediate = {
set_planet_flag = faster_crisis_purge_on # enable flag on world for debug
random_pop = { # selects random pop marked for purge on the planet
limit = {
is_being_purged = yes
}
kill_pop = yes # kills said pop.
}
remove_planet_flag = faster_crisis_purge_on
planet_event = { id = fastcrisispurge.2 days = @deathinterval } # N days later re-fire event to kill another pop
}
}
What thread isnt complete without its own performance comments?
I'm deleting pops, and only on specific worlds that the crisis has landed on, and only once an ingame week (though multiple worlds can purge on different days, its not locked to date, but rather every 7 days, spreading the load out more evenly in a game-month), so it's pretty insignificant CPU load.
I run the game on an i7-4790k clocked at 4.5ghz with 16gb DDR3 ram.
I have noticed no slowdowns whilst testing this vs vanilla, I tag-switched to the prethoryn and invaded several worlds simultaneously and it didnt lead to stutter for me.
Your mileage may vary.
Last edited:
- 2