I'm not sure it's a good idea to present my humble and primitive solution when you have already done 5000+ lines of coding...
But just maybe...
(Also I'm aware that my English is far from perfect...)
What if, instead of trying to make invasions harder, make holding conquered planets a LOT harder, AND creating a mechanism where pacifying and occupying a planet costs you a lot, and failing to meet the occupation upkeep risks uprising, but this time with a serious chance of succes.
Currently, we only have to bring a coupe thousands of marines and heavy equipment and we can overrun even the Hegemony.
And this is a viable strategy ( I think since 0.95 it's even better, because of the size limit of 6 ) because you don't really have to pay for the occupation.
Just stabilize the planet, and they are instantaneously profitable...
Next planet.
My reasoning is that in the age of space warfare and orbital bombardment, the current model of bringing a couple of thousand troops is not that unrealistic. Achieving victory defined as eliminating centralized, organized resistance is much more a function of firepower, than the number of boots on the ground. Here, having space supremacy is THE ULTIMATE force multiplier. (For instance, you can eliminate ANY troop concentration anywhere)
(That does not mean, that invading a bigger planet should not take long, or take more troops, or take more fuel spent on "fire support" or all of them..)
Having the high ground is important, and space is the ultimate high ground
https://www.youtube.com/watch?v=d6uckPRKvSg&ab_channel=AshPlattHowever after a fleet departs, a new collab or occupation administration has to deal with the unruly population...
(So in effect, you have this brief period, where you can occupy the planet without additional funds, while the original task force is over the planet, ready to bombard...)
This suppression value should scale with the size of the planet, so occupying and pacifying size 7 or 8 would be a nightmare, requiring years of investments on the scale of the revenue of a dozen average-sized planets (4-5-6).
(Also making planets with active rebellion unprofitable, even without any additional money spent could be a good idea representing a population, that actively breaks the law, evades taxes, etc..)
(In addition, any occupied planet might have reduced patrol fleets and ground defense strength...)
After a while, and large sums of money, the rebellion would slowly fade away, but in the case of a size 6 it would take years, and size 7 or 8 would take 10-15 years or so...
This mechanism would basically be an updated version of the current rebellion mechanism, but would completely alter the balance of power with respect to government vs rebels. I think currently the problem is not so much the easy conquest of the planets, but how easy is to hold them and how profitable they become almost instantaneously (after pressing the stabilize button a few times...)
It makes snowballing very easy, which is the real immersion-breaking thing in many (most) strategy games.
I have a couple of ideas regarding how to implement this feature.
Instead of the unrest modifier, we should add the "rebellion" modifier which would effectively be a "derivative of stability", so every month the stability would go down, making an open rebellion more likely. Countering this should be some kind of monthly fee, similar to the current growth modifier button, where pressing the button would allocate money to fund the occupation and pacification. So if you spend the money the "rebellion" effect is frozen for the time being (derivative is zero for the moment..).
Eliminating this rebellion (pacification) could be implemented as having to fund the occupation for a set period of time, this time being the function of the planet size and other possible factors...
Or there could be some kind of toggle to increase or decrease the funds, so massively increasing the occupation funds (like exponentially) would shorten the occupation time.
(Also to make things believable, a rebellion would first target the patrol HQ, so during an open rebellion the planet would not have a home-grown space superiority force)
One last thing. The AI should have a different mechanism, where similarly to their current invasion capacity, they would have an occupation capacity, based on their faction size for eg. I think this is necessary because AI empires could not go bankrupt, so having to allocate funds is not a problem for them.
So to sum up:
*I think the main problem is not how to conquer planets, but how to hold them
*In any case most of the planets in SS have populations comparable to my home country (Hungary) or yours. It's perfectly believable that a small, but very well-armed mechanized force, with continuous overwhelming air support, could eliminate our national defense forces fairly quickly.
*Preventing snowballing makes the whole world more believable
*In real life after conquering new land the occupation could cost as much or in many cases (like Afghanistan, South Vietnam, commie Afghanistan, etc) a lot more.
*After conquering a planet you have to occupy it, which costs a lot of money so, in the end, your economy determines how many planets you can simultaneously occupy.
*Fine-tuning the exact values would require play-testing and feedback, but the mechanism could make pacifying smaller (size 3,4) planets relatively quick and cheap, and larger planets progressively costlier and longer.
*This would also prevent the source of the current complaints, that factions are eliminated too quickly (like Tri-Tachion), especially if we introduce other modifiers in case of the occupation cost other than size (for eg, technology, or faction modifiers, etc).
I know, that if you have already invested that much time into implementing your ideas, you probably don't want to start from scratch...
I wanted to create this post months ago but kept postponing it because it's very tiresome to write such long essays in English for me, while I had to work on university projects...
So thank you in advance, and if you read my post, I hope maybe you find some of my ideas interesting.