There are several optimizations techniques that were developed/tested by the M&T team during its long and lasting struggle for performance optimization. To name some major ones there are, cb optimization through changing all cbs into triggered_only and then using a monthly pulse event to assign correct cbs to corresponding countries, optimization of building/event/decision triggers, and optimization of event mtth in correspondence to how they're checked by the game engine. This following python script does the last one in a semi-automatic fashion.
WHAT IT DOES:
1. check all events
2. if any event has an mtth type of days whose value is greater than 365, change it to years and change its value correspondingly
3. if any event has an mtth type of days whose value is ranging between 30 and 365, change it to months and change its value correspondingly
4. if any event has an mtth type of months whose value is greater than 12, change it to years and change its value correspondingly
5. if any event that is not triggered_only is lacking an mtth, report its location without altering anything
6. if any event has an mtth type of days whose value is lesser than 30, report its location without altering anything
WHY IT DOES WHAT IT DOES:
this is mostly for modders who are not aware of this fact. The frequency at which event triggers are checked on ALL corresponding targets is determined by its mtth. Every event with mtth of years has its triggers checked once per year, events with mtth of months once per month, and events with mtth of days once per day. Any event without a formally written mtth is treated as having mtth type of days.
Not many people considers the performance impact that triggers can have on the mod, but they're really, really significant, especially those with mtth type of days. Imagine every province and every characters getting checked by numerous triggers every single day, and you'll get what I mean.
Building and decision triggers too can have significant impacts on the performance, but their optimization requires getting your hands dirty by actually looking and altering its structure. You can imagine it as events having 2 stages of optimization, while building and decision triggers have just 1.
HOW TO LET IT DO WHAT IT DOES
It's a python script, so you need to be able to run it. If you can, just move it to the mod folder and run it. Processes 2-4 does not require any human input, but processes 5-6 just displays the locations without actually altering it.
HOW GOOD IT IS AT WHAT IT DOES
Observed noticeable improvement in performance at year 2050.
HOW TO GET IT SO THAT IT CAN DO WHAT IT DOES
https://drive.google.com/open?id=0B53TaerJlcMrTVA1WmgtM0VlcDQ
(For those who doesn't want to go through all the details)
https://drive.google.com/open?id=0B53TaerJlcMrQXBxOEVPUngwRXc
WHAT IT DOES:
1. check all events
2. if any event has an mtth type of days whose value is greater than 365, change it to years and change its value correspondingly
3. if any event has an mtth type of days whose value is ranging between 30 and 365, change it to months and change its value correspondingly
4. if any event has an mtth type of months whose value is greater than 12, change it to years and change its value correspondingly
5. if any event that is not triggered_only is lacking an mtth, report its location without altering anything
6. if any event has an mtth type of days whose value is lesser than 30, report its location without altering anything
WHY IT DOES WHAT IT DOES:
this is mostly for modders who are not aware of this fact. The frequency at which event triggers are checked on ALL corresponding targets is determined by its mtth. Every event with mtth of years has its triggers checked once per year, events with mtth of months once per month, and events with mtth of days once per day. Any event without a formally written mtth is treated as having mtth type of days.
Not many people considers the performance impact that triggers can have on the mod, but they're really, really significant, especially those with mtth type of days. Imagine every province and every characters getting checked by numerous triggers every single day, and you'll get what I mean.
Building and decision triggers too can have significant impacts on the performance, but their optimization requires getting your hands dirty by actually looking and altering its structure. You can imagine it as events having 2 stages of optimization, while building and decision triggers have just 1.
HOW TO LET IT DO WHAT IT DOES
It's a python script, so you need to be able to run it. If you can, just move it to the mod folder and run it. Processes 2-4 does not require any human input, but processes 5-6 just displays the locations without actually altering it.
HOW GOOD IT IS AT WHAT IT DOES
Observed noticeable improvement in performance at year 2050.
HOW TO GET IT SO THAT IT CAN DO WHAT IT DOES
https://drive.google.com/open?id=0B53TaerJlcMrTVA1WmgtM0VlcDQ
(For those who doesn't want to go through all the details)
https://drive.google.com/open?id=0B53TaerJlcMrQXBxOEVPUngwRXc
Last edited: