Excellent job GnoSIS! A very insightful read.
I concur that your proposed second solution would be the best way to both optimize the game dramatically and make it, at least for my taste, way more realistic. However, i'm fully aware that such a change would require a very extensive rework of the job system, and taking that in consideration i think that your first proposal is optimal, for a time at least.
Simply put, and if i have understood your analysis correctly, the game wastes an extreme amount of processing capacity in job checks that are not necessary at all.
The current job check system:
- Almost constant (Monthly checks).
- Universal (Checks for all vacant jobs and compares them to all pops galaxy wide, no matter if they are unemployed or not, planet per planet).
- Excludes from the calculations only planets that have no vacant jobs. (Which is very counter-intuitive for both the player).
- The result is a system that works well enough in the early game, but scales really poorly as the game progresses, coming to an almost complete halt in the late mid or early late game (at least under the conditions that the game is supposed to be played) and penalizes the player for planning ahead (building districts and buildings before the pops needed to fill them are created).
Damn, that is inefficient and messy. If i had to make a guess, i would say that they created this check system before reworking the pop growth and migration systems, under the assumption that late game planets with vacant jobs would the exception rather than the rule. However, in late mid/early late game the filling of jobs is either at the hand of an almost useless migration system (that needs a full rework on its own) or a very micromanagement heavy resettlement mechanic that is as optimized as the job check system itself. Result: The player colonizes/captures a planet/habitat/ringworld, queues the necessary districts and buildings for said planet, resettles some pops to it (only if it is an option) and forgets about it. The Ai more or less works under the same (logical and intuitive) principles, and both them and the player/s dramatically decrease the performance of the game as a consequence as the game goes on, just for doing the logical thing.
How can we solve this mess?
- The job check system needs a complete rework. as you pointed out, a more dynamic system would be optimal and lag free, but for the time being a more reactive system would be enough.
- The migration and resettlement systems need a complete rework, not only to optimize the game performance but to make the game more enjoyable by reducing micromanagement.
How can we make the job check system more reactive and less performance intensive?
- Eliminate the monthly universal check.
- Check for a specific planet/habitat/ringworld ONCE when a district/building is constructed/repaired.
- Check for a specific planet/habitat/ringworld ONCE when a pop is created, migrates or is resettled.
- Check for a specific planet/habitat/ringworld ONCE when the player/Ai sifts the job priorities or planet focus.
- Check for a specific planet/habitat/ringworld ONCE when said planet has one of its species genetically or robotically modified.
- Check for a specific planet/habitat/ringworld ONCE when said planet ownership changes to another empire.
- Check for a specific empire ONCE when said empire changes its ethics/civics/policies/traditions/ascension perks.
WIth this system, the game checks only when it needs to, and most planets don't consume processing power most of the time except when they are actively growing/changing. Unused job spaces are not calculated unless there is a new pop that could fill them, or if a substantial change happens in its host planet/empire. This system is far from perfect (it would still be susceptible to slow downs caused by late game planetary development, war, and empire evolution), but at the very least it would be more reactive, and less performance heavy than what we have now.
These are just some ideas i had about the topic though. I'm not familiar enough with the game's code to know if changes like these could work, but i wanted to share them nevertheless.
Uburian