Closed EmperorRAG closed 7 years ago
From the other discussion: state_capital_only is a built-in property of pops, which in vanilla is applied to aristocrats, capitalists, and bureaucrats, and in the mod currently only for soldiers and officers.
The migration factors already include some urbanization logic:
modifier = { factor = -1 location = { is_state_capital = yes } }
modifier = { factor = -1.0 OR = { type = farmers type = labourers } }
If, for any reason, we can't move all the pops into state capitals, we can instead strengthen this heavily for the desired pop types, so that they will probably migrate to some state capital on their own. If needed, we can also add a push for farmers and labourers in state capitals or those with urban terrain for a "ruralization" though I imagine this isn't as necessary. This would still lower calculations by merging pops, but it is unnecessary and not preferable if the former is possible.
The game doesn't crash anymore if you change the pops to state capital only without changing the pop demographics. Good news is that it will still deliver better performance during game sessions, but I want to know if you would still like the pop demographics to be changed. Changing the pop demographics will only improve on loading times though.
IMO it's not worth the work, unless there's an automated way to change it. Is it a noticeable performance change?
In the early start date, there isn't initially a change in performance. As the game goes on though, you do notice the difference. The change has the most impact on the modern day start because there are many different pop cultures in the western nations which require many more calculations. Overall the betterment in the performance is more aimed over a long game session than a short one unless you start in the modern day scenario.
It sounds like you've gotten it working. I would submit a PR, then. I personally like the idea; care to weigh in, @settintotrieste?
Sure @ARR8 , I have been thinking about whether the change will affect split states, does the allocation of state_capital_only prevent pop promotion to those pops in say Gibraltar which is a split state? Other than issue, I am ready to implement the optimisation.
Changing to state_capital_only causes crashes when nations with split states are released with secede_province. As the mod requires secede province commands for many crucial features, this method of optimisation cannot be pursued.
I think this crash is due to the POPS not actually being in a combined POP group as the soldier pops and officer pops are combined into one POP group. The crash just means that until all the POPS that are affected are combined into a single group for each state, it won't be viable.
In this case it would be better to make only rich strata pops state_capital_only but I will have to do some testing on this feature first to make sure that there are no crashes.
This thread is for the continuation of the discussion relating to pop optimization that was started in #109:
Initial post
Pop logic
Solution to the crash