An "Unlimited Unit Cap" Option

Hello Everyone,

I'd like to make the case for an unlimited* unit cap option in ranked, custom games.

First off, why are unit caps implemented in games at all? The two main reasons that come to mind are first, to limit slow down and second, as an incentive to attack.

The probably most popular title using a unit cap for these exact purposes is, of course, Starcraft. The unit cap in Starcraft is 200 and, with a limit that low, fulfills it's purposes flawlessly.

The simulation speed in Starcraft never drops and players are not only incentivized to attack, but "supply" as it's called in that game plays an integral part of the game, not only when the unit cap is reached.

In fact, it is so essential, that the supply counter uses the same amount of UI space, as the other two main resources. As such, supply, and by extension the unit cap, is a vital part of Starcraft game design. Removing it, or even changing it slightly, would make Starcraft completely unrecognizable.

Compare this to FAF: Excluding campaign missions, essentially all games on FAF are already played as if there were no unit cap. Settings like 1.5k unit cap and "share unit cap at death to allies" are active in almost all team games, from noob to pro alike. The "supply counter" in FAF is a minuscule part of the score screen, tugged far away from our two main resources, mass and energy.

As it is so seldomly reached, our unit cap neither limits slow down, nor serves as an incentive to attack. Even worse, if it IS reached, you often don't even realize you have reached it, as the message telling you so doesn't pop up reliably.

So what does actually happen? You stop spending your mass for 20 seconds, before you realize what's wrong, and then you have to search around the map to ctrl+k superfluous units or give a part of your army to your ally. Both are decidedly not fun and, because hitting the unit cap happens irregularly, it will hit you by surprise every. frigging. time.

Don't even get me started on the times in which your teammate gets sniped late in a full-share game and his army gets transferred to two players, not one, because the guy with the highest score didn't have enough unit cap to spare..

As such, I'd propose an unlimited* unit cap option so that we can finally leave behind the vestiges of the past and, more importantly, further improve the already great game that FAF has become.

tl;dr: The unit cap in Supreme Commander serves no purpose anymore and hitting it results in bad game design. An unlimited* unit cap option would solve this.

*: I am aware that literally unlimited is not possible with current, finite, technology, but I'd gladly settle for 65535, or whatever the underlying software limit actually is.

Some unit cap seems important as an incentive to not over build low tech units instead of higher tech ones. Like t1 arty spam on a phantom match, i think there needs to be a hard cap to keep that sort of thing from going way to crazy. Unlimited does seem cool as an option though.

We have an unlimited unit cap in LOUD - and while in one perspective that's nice to have, it's not a practical limit. Even on the best of days - with a very streamlined codebase like LOUD, on the fastest of machines, the practical upper limit, before you start seeing unit count induced side-effects, like severe UI lag, and SIM degradation - is about 5 thousand units - in total. We do, on rare instances, see games with 10k or more, but those are rare indeed - and usually involve 1 v 1 situations.

I hear what you say about unit cap being given the same kind of real estate, on the UI, as the other two resources - and I offer a suggestion here, that we've had in LOUD for several years now, unit cap growth.

It is possible to turn unit cap into another resource, one that can be managed by the player, or offered up as a reward for things like achieving veteran status. For example, in LOUD, we have various structural enhancements that will lower the unit cap cost of certain things like T2 and T3 Pgens, T3 shields, etc - giving the player the option to 'invest' in more unit cap with his resource base. Also, each level of veterancy grants additional unit cap, encouraging a certain kind of gameplay that's less wasteful - and it's permanent (unlike the structural enhancements). And lastly, that poor servant of the ACU - the SACU, gains additional value as a total replacement for your horde of lower level engineers by actually lowering your unit cap usage.

Long and short - it's possible to make some changes that make unit cap a flexible part of the 'Supreme Commander' experience and still have some kind of lid on potential performance issues.

@spikeynoob said in An "Unlimited Unit Cap" Option:

Some unit cap seems important as an incentive to not over build low tech units instead of higher tech ones. Like t1 arty spam on a phantom match, i think there needs to be a hard cap to keep that sort of thing from going way to crazy. Unlimited does seem cool as an option though.

I'm not well versed enough in phantoms to be able to judge that.

I just know that in the game mode I frequent, Seton's, unit cap does not interact with float spam at all. You can easily spam 500+ arties before you have to even think about unit cap, which is enough to stall out any navy aggression forever (if your opponent doesn't know how to deal with it) (or if he is Aeon, but that's another discussion).

But yes, it would of course just be an option, so should it ruin phantoms, the solution is to just not play with it.

@sprouto said in An "Unlimited Unit Cap" Option:

Long and short - it's possible to make some changes that make unit cap a flexible part of the 'Supreme Commander' experience and still have some kind of lid on potential performance issues.

To actually have a meaningful impact on performance, you'd need to reduce the unit cap drastically, which, imo, would ruin the game. While I do agree that you can make good games with unit caps, it is just not implemented in any sensible way in Supreme Commander.

Considering that the community seems to agree with me, as seen by the typical game options used, I think we should just play to our strengths. Removing the unit cap for those that want to, instead of redesigning the entire game to make it at least somewhat palatable, seems to be the obvious choice.

Well I just don't think 1500 unit cap is much of a barrier, especially if you have it shared with allies on death. I don't think I've ever hit unit cap in those situations; only where unit cap is not shared, or it is only 1k cap.
But one slight problem is if someone has to go afk and walks their acu to a safe spot and just transfers all their units, thinking they might be able to return in 5-10 minutes, but give everything over to avoid inconveniencing everyone. In that case, a solution would be to have 1500 unit cap per player, available to the whole team.

But besides that tiny change which impacts maybe 1% or less of my games, I don't think I'd want a higher unit cap. The game just isn't optimized well enough, so pathfinding issues really crop up well before we would be hitting 6k units for one team in a 4v4. It frequently happens that if you give new orders to units they just lose their previous orders and stop moving, necessitating a shift-g to try to get them to move. I have seen it many times before on setons. I'd rather play games that have at least some incentive to avoid that cancerous, unenjoyable -4 sim speed pain for everyone involved.

One thing I'm not sure about is how buildings affect lag. Maybe we could have buildings not impact the unit cap? If that would be the case maybe just a 1k UNIT cap would be plenty.

ALL units impact performance - buildings, units, wrecks.

@sprouto Ok thank you for that. Is there any difference between units and buildings though? It would make sense to me that 500 zthuees floating along are a bigger issue than 500 pgens or mass fabs or whatever. E.g. the 500v500 asf fight that drops sim speeds to -9 clearly is more demanding than units that just sit there, so I'd guess buildings that never move are similarly less demanding to process. If that's the case we could consider adjusting it somewhat, but if not then leave things as is.

There is some difference - mostly related to the number of weapons, or the amount and type of intel generated, throw in the additional loads of any animations or blinking lights (which of themselves aren't a problem - but the SIM is responsible for tracking and initiating all those things) and movement, you get a picture of why this is not just a simple subject. From a simple memory standpoint - the overhead of a structure and a mobile unit are fairly similar. The impact on performance lies primarily there. Adjusting the unit cap impact of them won't alter the performance curve in any way - it will simply move the unit cap goalpost around a bit.

Wrecks are a little bit less of an issue, by definition they are very simple - but even so - the number of wrecks, and to a lesser degree, props - can add significantly to the processing overhead.

@corvathranoob said in An "Unlimited Unit Cap" Option:

@sprouto Ok thank you for that. Is there any difference between units and buildings though? It would make sense to me that 500 zthuees floating along are a bigger issue than 500 pgens or mass fabs or whatever. E.g. the 500v500 asf fight that drops sim speeds to -9 clearly is more demanding than units that just sit there, so I'd guess buildings that never move are similarly less demanding to process. If that's the case we could consider adjusting it somewhat, but if not then leave things as is.

To give you another perspective: collision detection between projectiles / units (including buildings). Algorithms can 'cut out' units that are far away quite easily, but if they're all stacked on one another it quickly turns into O(n^2), which is expensive for real time applications. That is why ASF fights can be so demanding, but having various fights in general across the map is fine.

A work of art is never finished, merely abandoned

While the above discussion about performance is an important one, I think it would be beneficial to stay on topic, namely that the unit cap does nothing to improve performance!

I have never once thought "Oh man, I'm close to the unit cap, better stop building units". If I hit the unit cap in team games I just give my ASFs, SAMS, Frigats, Zuthees, or whatever to my teammate, so the total number of units did not even decrease. The only thing the unit cap managed to do was make my game worse!

As do agree with CorvathraNoob that the unit cap impacts about 1% of games, but whenever it does, it is purely negatively.

Why do we accept 1% of our games to be notably worse, if adding a single line of code could change them for the better?

The only time I've hit unit cap in real games was when I had at least 100 obsolete engis or 500 asf which is also kind of never useful (just make 400 and 20flak instead)

@cheeseberry said in An "Unlimited Unit Cap" Option:

Why do we accept 1% of our games to be notably worse, if adding a single line of code could change them for the better?

Who told you it's just a single line ???
If you want to change the unitcap you need to modify:

\lua\ScenarioFramework.lua
function GiveUnitToArmy()
(army brains ignoring armycap on transfering units and re-enable it after doing it.)

\lua\SimUtils.lua
function UpdateUnitCap()
(logic for ShareUnitCap option)

\lua\AI\aiarchetype-managerloader.lua
function UnitCapWatchThread()
(This thread is watching the unitcap for GPG AI and need to be rewritten for unlimited units)
function UnitCapWatchThreadSorian()
(This thread is watching the unitcap for Sorian AI and need to be rewritten for unlimited units)
function GetAIUnderUnitCap()
(AI helper function for UnitCapWatchThread & UnitCapWatchThreadSorian)

\lua\editor\UnitCountBuildConditions.lua
function UnitCapCheckGreater()
(Need a new function that does not need a UnitCap to calculate % of possible units)
function UnitCapCheckLess()
(Need a new function that does not need a UnitCap to calculate % of possible units)

\lua\sim\ScenarioUtilities.lua
function CreateArmyUnit()
function CreateArmySubGroup()
function SpawnPlatoon()
function SpawnTableOfPlatoons()
function CreateArmyGroup()
function CreateArmyTree()
function CreateArmyGroupAsPlatoon()
(AI Scenarios need to know the unitcap and/or switching it on and off.)

\lua\sim\Unit.lua
function OnCaptured
(function need a patch for CampaignMode and captorBrain.IgnoreArmyCaps)

\units\XEB2402\XEB2402_Script.lua (Experimental Satellite System)
function OnCaptured
(function need a patch for CampaignMode and captorBrain.IgnoreArmyCaps)

@uveso Well, it certainly looks like it would be much more complicated to change all of those things...but then the intelligent way to create an ESSENTIALLY unlimited unit cap would be changing the 1500 option to 15000...

@uveso It seems to me that you are assuming that I want to set the unit cap to literally infinity.
As mentioned in my first post, I don't think a literally infinite unit cap is even possible. Finite hardware and all that.

Are you saying that there is not just some global variable or equivalent that one can change from 1500 to e.g. 15000 as Corva suggested?

@CheeseBerry

Yes that's exactly the point. (thats why i also pointed to all related functions)
If you took a look at those functions you will see that an unitcap of 'infinite ' or 15000 will break some AI functions.

There are tactical decisions based on unit count that can't work with extreme numbers like 15000+.

Nothing that can't be fixed, but its not a single line of change.
Its more like 1-2 hour work of coding and 1-2 Days of testing and rebalancing the AI.

I don't think he's concerned about AI at all, he's just talking about pvp games.

@FemtoZetta

I have no opinion on this.
I am only providing information about what is needed to change unitcap in SupCom.

And in case someone decides to implement this, then all should have in mind this change can take a while.
Its not only the GPG and Sorian AI that need to be patched. Also my and all other AI mods need a fix then.

As i said before, its not just a single line to change.
(This shouldn't discourage anyone from asking, it's just a fact.)

Just saw a game with a mod with raised unit cap x4

One good thing about the unit cap is that you can't spam t1 only you need to upgrade to t2, t3, experimentals and other structures etc.

Former Board Member - March 2021 - March 2022

@veteranashe

the mod you mentioned is not changing the game functions.

The mod is patching all units in blueprint.lua like:

Blueprint.General.CapCost = Blueprint.General.CapCost * 0.25

Its changing the need of cap for a unit.

This is the worst way to do it.
Absolutely incompatible with AI functions and every unit count function in the game.
(the cap is only visible for the c-engine not for LUA code)