Victoria 3

Victoria 3

Profiling-based Optimization (Performance Mod)
Showing 1-10 of 10 entries
Update: 2 Jul, 2024 @ 10:40pm

Update: 2 Jul, 2024 @ 6:03am

Update: 2 Jul, 2024 @ 5:52am

Fixed a dumb mistake

Update: 2 Jul, 2024 @ 5:35am

(7/2) Rationalize the calculation for professional qualification:
1. Peasant under serfdom will always be checked first and bypassing unnecessary checks if possible
2. Duplicate peasant under serfdom and accepted culture conditions have been removed
3. Peasant under serfdom should be mutually exclusive with other pop_types, using else_if
4. Favored types that have the same weights have been merged using OR, allowing short-circuiting

Update: 29 Jun, 2024 @ 4:25am

(6/29) Reorder the `potential` conditions for all character interactions to make short-circuiting more often.

Update: 11 Apr, 2024 @ 5:45am

No longer overwrites the entire on_action.txt, which should make it more compatible with other mods.

Update: 8 Apr, 2024 @ 11:51am

Update: 8 Apr, 2024 @ 10:13am

3. Change the AI calculation of desired army size bonus for small country.
Previously, AI desired army size will increase by 1 for every 100000 incorporated population, with the increase capped at max 10. I changed it so that if the country has more than a million incorporated population, the max directly applies without the need to calculate a division. Not going to be a big deal I suppose but still an improvement.

4. Rehauled the `Red Scare` Journal Entry's trigger altogether.
I am still not satisfied with the monstrous performance cost of this journal entry even after my initial fix, and I decided to rewrite the logic altogether.
Previously, whenever the journal entry system refreshes, anyone with inactive entry will iterate over every other country and see if there's one who has diplomatic relevance and council republic. This is very costly as journal entries are refreshed quite often.
The new code uses a yearly pulse event to keep log of every council republic in existence. In the `Red Scare` Journal Entry, the country will only iterate over the cached list of existing council republics and see if there's anyone that has diplomatic relevance (plus being more than a minor power, which is suggested by the tooltip but was not actually implemented by the vanilla code?) This results in drastically reduced frequency for iterating over all countries when checking for council republics, and should result in noticeable improvement once a few years have elapsed (at which point labor_movement will have been researched and the journal enabled). A quick test suggests that council republics should still correctly activate this journal entry, thus there will be no gameplay impact at all.

Update: 7 Apr, 2024 @ 9:44am

Update: 5 Apr, 2024 @ 9:35am

1. Removed the constant checking of flag definitions for default countries:
Come on, while we all agree that dynamic country flags are brilliant, their performance cost is ridiculous. In essence, the game is looking at every country in every tick to see if they qualify for a different flag at that moment. This is the script item that contributed the most to early game lag and it continues to play a role throughout the game. Even though disabling this means that some countries might have funky flags (most notably colonial administrations), I would rather my game run smoother than having dynamic flags per se. I might change it to a more sophisticated method if there's a way to only refresh the flag when needed (but it seems like the engine doesn't permit that)

2. Changed the calculation for 'Red Scare' Journal Entry's trigger to use a less costly one:
Previously, the is_shown_when_inactive uses this trigger:
any_country = {
has_diplomatic_relevance = root
has_technology_researched = labor_movement
}
This is kind of stupid. What this means is that whenever the journal entry system refreshes, it will iterate over all countries to see if anyone of them has diplomatic_relevance and also researched the tech labor movement...just so that this journal entry can be DISPLAYED as inactive.
I changed it so that when the labor movement tech is researched, a global variable will be set indicating that someone has researched it. Since this trigger only affects whether this journal entry will be displayed at all, not whether it will actually become active, there's hardly any change to the gameplay.