We've all experienced the late game lag. Two centuries, three, sometimes four pass and the game becomes unbearably slow. The culprits are many; inheritance calculations, poor optimization, endless wars, courtiers...
Even though Paradox took some steps in the right direction and introduced the pruning mechanic (or was it there from the start?), it doesn't quite work.
My character's court regularly fills up to 150. Some vassals have up to 200, and one champ had even accumulated a whooping 576 courtiers. Peculiarly, foreign realms didn't seem to have this issue.
The solution, I believed, was to aid the pruning process and ease the load on the CPU.
So I wrote an event that fires for each ruler, kills every unimportant character in his/her/its court, and does the same for every vassal, thus purging every court in the realm.
Nifty, right? The first version worked a bit too well and ended plenty of dynasties, but it also made the game fly.
After some edits it works... most of the time.
In some courts, it works perfectly. In others, it kills even heirs and ruler's children. In some it doesn't do anything. It even purged the Borjigins, excluding Genghis himself and all but one son.
Can any of you modders help perfect this little tool of mass murder?
Here's the whole thing for those interested:
Even though Paradox took some steps in the right direction and introduced the pruning mechanic (or was it there from the start?), it doesn't quite work.
My character's court regularly fills up to 150. Some vassals have up to 200, and one champ had even accumulated a whooping 576 courtiers. Peculiarly, foreign realms didn't seem to have this issue.
The solution, I believed, was to aid the pruning process and ease the load on the CPU.
So I wrote an event that fires for each ruler, kills every unimportant character in his/her/its court, and does the same for every vassal, thus purging every court in the realm.
Nifty, right? The first version worked a bit too well and ended plenty of dynasties, but it also made the game fly.
After some edits it works... most of the time.
Code:
any_courtier = {
limit = {
is_ruler=no
has_job_title = no
has_minor_title = no
not={trigger={ any_close_relative ={is_ruler=yes}}}
or={
is_marriage_adult=no
is_married=no
not={trigger={any_spouse={is_ruler=yes }}}
}
}
death = {death_reason = death_natural}
}
In some courts, it works perfectly. In others, it kills even heirs and ruler's children. In some it doesn't do anything. It even purged the Borjigins, excluding Genghis himself and all but one son.
Can any of you modders help perfect this little tool of mass murder?
Here's the whole thing for those interested:
Code:
#All unimportant courtiers die, starter event
character_event =
{
id = 108101
is_triggered_only = yes
desc = "Purge all unimportant characters, part 1"
picture = GFX_evt_emissary
option =
{
name = "Purge!"
root = { character_event = { id = 108102 } }
any_independent_ruler = { character_event = {hide_window = yes id = 108102 } }
}
}
#purge event
character_event =
{
id = 108102
desc = "Purge all unimportant characters, part 2"
picture = GFX_evt_emissary
is_triggered_only = yes
option={
name= "get on with it"
any_courtier = {
limit = {
is_ruler=no
has_job_title = no
has_minor_title = no
not={trigger={ any_close_relative ={is_ruler=yes}}}
or={
is_marriage_adult=no
is_married=no
not={trigger={any_spouse={is_ruler=yes }}}
}
}
death = {death_reason = death_natural}
}
any_vassal={
character_event={ id=108102 }
}
}
}