An "Unlimited Unit Cap" Option
-
Personally, I'd totally spend a weekend working on this.
It might not improve FAF by a huge amount, but compared to the ridiculous number of man hours already put into this project, it also doesn't take a huge amount of time.Sadly though, I can't implement and test everything on my own. While I am a semi-competent programmer, I have no clue about the inner workings of FAF, or any of the AIs.
Therefore the question is: Who's help do I need and how do I get their buy-in? (Seems like talking to you is a good start)
-
Well, you could join us on our AI-Development Discord:
https://discord.gg/ChRfhB3There you can talk to all AI devs.
-
Not to be that guy, AI discord is good. But this is one of the reasons Great Discord Intergration happened. To have these discussions there too for players. (That AI Discord is great. Just we shouldn’t forget that tbere are places for AI discussions now on faf discord too!)
-
@CheeseBerry @Uveso
Btw, fwiw, I just made a simple 'No Unit Cap' mod that allows every army to ignore the unit cap via SetIgnoreArmyUnitCap. I tested it with both regular AI's and Sorian AI's, and they both built above the unit cap with it enabled. It's on the vault if you want to try it. -
@Emperor_Penguin
i have downloaded your mod and tested it.
well, there are some functions you maybe want to check.
https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/AI/aiarchetype-managerloader.lua#L106
UnitCapWatchThread will kill units if the unitcap is reached (ignoring it will not help here)https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/AI/aiarchetype-managerloader.lua#L142
UnitCapWatchThreadSorian is same as above but also killing T3 units on caphttps://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/AI/aiattackutilities.lua#L127
function GetBestThreatTarget() unitCapRatio is used for threat calculationlocal unitCapRatio = GetArmyUnitCostTotal(aiBrain:GetArmyIndex()) / GetArmyUnitCap(aiBrain:GetArmyIndex()) # if we have no threat... what happened? Also don't attack things way stronger than us if myThreat <= IgnoreStrongerTargetsIfWeakerThan and (myThreat == 0 or enemyThreat / (myThreat + friendlyThreat) > IgnoreStrongerTargetsRatio) and unitCapRatio < IgnoreStrongerUnitCap then continue end
https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/editor/UnitCountBuildConditions.lua#L906
https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/editor/UnitCountBuildConditions.lua#L915UnitCapCheckGreater and UnitCapCheckLess are called 248 times inside the AIbuilders in 15 files:
https://github.com/FAForever/fa/tree/deploy/fafdevelop/lua/AI/AIBuilders
they all need to be checked!
Example:
{ UCBC, 'UnitCapCheckLess', { .8 } },
(thats the part that will cost the most time)
not related to AI:
In case you ignore the unitcap you need to tell the player brain that you do so.
brain.IgnoreArmyCaps = true
You usedSetIgnoreArmyUnitCap(i, true)
but you need to call this funtion:
IgnoreArmyUnitCap()
https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/aibrain.lua#L932So at the moment these functions are failing:
https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/ScenarioFramework.lua#L226
GiveUnitToArmy is disabling the SetIgnoreArmyUnitCap and would only reenable it if brain.IgnoreArmyCaps is set to truehttps://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/sim/Unit.lua#L789
Unit:OnCaptured() is also disabling the ignore for the unit transfer on capturehttps://github.com/FAForever/fa/blob/deploy/fafdevelop/units/XEB2402/XEB2402_Script.lua#L152
The Experimental Satellite System has a hook for OnCaptured and is also failing on capture
As i posted above, just increasing or disabling the unitcap is not working.
-
@cheeseberry said in An "Unlimited Unit Cap" Option:
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..
That's just to punish people who haven't kept up to date since engi-mod
-
But we alredy have unlimited unit cap. Dont know if its related to a bug but i see quite a lot my unit cap beung displayed as 0/0 or smh like that and it never ends even uf i do 2k units.
-
Cannot delete
-
If you rich 1.5k then i believe you have around 300 useless engineers on map. And it's only engineers, what about t1 units? T2 units?
-
Cannot delete