Stellaris

Stellaris

Interstellar Incorporated: Space Corp [3.10.*]
Capping fleet size in a reasonable way.
The average corporation isn't trying to conquer or defend empires. Their concern is going to be pirates. So they should build to defend their ships against that... and once they have that, don't build more. Give them a fleet capacity, make it 50% higher for private military companies, and keep them to that. If they have enough money set aside to build their largest ship twice over, and still can't build because of capacity, don't put more money into that.

budget_amount = if (defense_credits > ship_cost *2 && ships >= capacity, 0, normal_amount)

Something like that.

One way of determining the fleet cap for them might be based on the trade value at the capitol planet, as well as their own HQ level. https://stellaris.paradoxwikis.com/Trade shows how many pirates can spawn given trade value in the system. At worst you get 14 corvettes, 8 destroyers, and 4 cruisers - oddly, after that the total fleet power drops. Since that is 46 fleet power at most, no corporate fleet needs to ever exceed that. But go ahead and allow larger fleet cap, just limit a single fleet to 50.

So... you give a base fleet cap of 5, plus 5 per 10 (or fraction thereof) reaching the capitol. This is modified by the corp's HQ level - 45% base plus 5% per HQ level.

Gives these values:
* Capitol has 5 trade: base fleet cap 10
- HQ level 1, 50% = 6
- HQ level 5, 70% = 8
- HQ level 10, 100% = 10
* Capitol has 45 trade: base fleet cap 30
- HQ level 1, 50% = 15
- HQ level 5, 70% = 21
- HQ level 10, 70% = 30
* Capitol has 95 trade: base fleet cap 55
- HQ level 1, 50% = 27 (round down)
- HQ level 5, 70% = 38 (round down)
- HQ level 10, 100% = 55, can use 50 in one fleet but the other 5 has to be in a different fleet.
* Capitol has 200 trade: base fleet cap 105
- HQ level 1 = 52
- HQ level 5 = 73
- HQ level 10 = 105, would need at least 3 fleets.

Then the corp has to determine where to put those ships as escorts, as part of AI, but at least it doesn't just build as many as it wants.