The habitat spam is a symptom. Adding a hard cap screws over pacifists (and void dwellers) and leaves no way to alleviate the actual problems that lead to the spam:
- It's always better to have more pops, and pop growth is capped without more growth queues. Habitats give more growth queues.
- Once you have more pops, the number of useful places you can put them is capped by number of planets, especially for building slots. Habitats give more spaces for jobs (researchers, soldiers, and refiners in particular, as they cannot come from districts until ringworlds)
- Once you're no longer claiming systems, a peaceful (or weak) empire has no more use for influence. Habitats give a marginal benefit in exchange for abundant influence.
#1 is hard to fix, but habitat's interaction with it isn't. I wouldn't want habitats to
not give growth queues, but they really shouldn't really give a full growth queue (unless you're void dwellers). If they gave the inverse of ringworld/ecumenopolis bonuses (negated for void dwellers), that would be great. If an ecumenopolis grows 25% more pops because it's effectively 3 planets stapled together, though with urbanization reduction in size, then a habitat should grow fewer pops because it's (by default) only half a planet, and it caps out at the equivalent of size 12 (with even fewer building slots).
#3 is hopefully (partially) solved by the AI now actually knowing how to build orbital rings. That will create a different problem (an enormous spam of ruined rings whenever the crisis rolls around which take up megastructure slots to rebuild/in the outline, and which weirdly duplicate), but that's a separate issue.
#2 and #3 would also be partially solved by adding more influence sinks:
- if you could keep developing the habitats you have, with reasonable costs (instead of "pay 150 influence to build a whole new habitat, with a new queue and new building slots or 50 influence to add 4 more districts with no queue/building slots"), players would have less need to spam habitats, and the AI could remain competitive while also not spamming habitats. If that expansion also partially undid the reduced growth effects I proposed as a solution to #1, so much the better.
- if the mineral (though not influence) cost of ecumenopoleis and build time scaled with planet size (or just the AI was taught to be more more clever with them), then both players and the AI could make more rational decisions about encasing basically every planet that isn't producing basic resources, which will give you more growth and save on district sprawl (with free building slots). It's maybe weird that encasing everything is the right decision, but it would be at least better gameplay than habitats everywhere.
- if planets were just generically expandable with influence (or more terraforming candidates were available at huge influence cost), there would be a better answer than "just build more habitats"
Just restricting habitats is a bandaid solution, with tons of negative effects. It's only good for people who conquer constantly, and hence are both inconvenienced by habitat spam and also have other uses for influence.
As an example of what the fix for #1 might look like: Void Dweller could give +40% growth on habitats, -10% growth everywhere except habitats. Habitats come with a -60% growth/assembly penalty, by default (note that this result in Void Dwellers having almost the same net growth, -20%, by default). Habitat expansion costs 75 influence, gives 2 districts and a building slot each, and reduces the grown penalty by 20% (-60%, -40%, and -20% for the 3 expansion levels). So 75 influence buys 2 districts, a building slot, and 20% of a growth queue, whether you're expanding or building more (though you get free building slots for tech/traditions/AP, which is fine). Void dwellers will ultimately come out ahead (-10% growth compared to current on two of their starting habitats and all newly built ones, +10% on their big starting one, and +30% total when they get everything fully upgraded), but it will cost them much more influence to get everything maxed out. For everyone else, habitat spam will be less profitable, and habitat expansion will be equally profitable to spam, resulting in less spam (and an AI that can be programmed to always expand before building more without artificially crippling it).
The end result is that Habitats will feel even more cramped than before (a stated design goal), by default, but when you expand them, they should give you (roughly) the same things you got from building two habitats before for the same cost, except with fewer spaces for planet uniques (though assembly ones will be equal, with fewer pops), less sprawl, and less noise on the galaxy map.