FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    An "Unlimited Unit Cap" Option

    Scheduled Pinned Locked Moved Suggestions
    32 Posts 16 Posters 5.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CheeseBerryC Offline
      CheeseBerry @Uveso
      last edited by

      @uveso

      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)

      1 Reply Last reply Reply Quote 0
      • UvesoU Offline
        Uveso
        last edited by

        Well, you could join us on our AI-Development Discord:
        https://discord.gg/ChRfhB3

        There you can talk to all AI devs.

        1 Reply Last reply Reply Quote 1
        • Dragun101D Offline
          Dragun101
          last edited by

          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!)

          I’m a shitty 1k Global. Any balance or gameplay suggestions should be understood or taken as such.

          Project Head and current Owner/Manager of SCTA Project

          1 Reply Last reply Reply Quote 0
          • Anachronism_A Offline
            Anachronism_
            last edited by Anachronism_

            @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.

            pfp credit to gieb

            1 Reply Last reply Reply Quote 3
            • UvesoU Offline
              Uveso
              last edited by

              @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 cap

              https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/AI/aiattackutilities.lua#L127
              function GetBestThreatTarget() unitCapRatio is used for threat calculation

                      local 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#L915

              UnitCapCheckGreater 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 used SetIgnoreArmyUnitCap(i, true) but you need to call this funtion:
              IgnoreArmyUnitCap()
              https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/aibrain.lua#L932

              So 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 true

              https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/sim/Unit.lua#L789
              Unit:OnCaptured() is also disabling the ignore for the unit transfer on capture

              https://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.

              1 Reply Last reply Reply Quote 2
              • J Offline
                jcvjcvjcvjcv @CheeseBerry
                last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • LunyshkoL Offline
                  Lunyshko
                  last edited by

                  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.

                  "Good luck and a safe landing commanders!"

                  1 Reply Last reply Reply Quote 0
                  • I Offline
                    iamscope
                    last edited by iamscope

                    Cannot delete

                    1 Reply Last reply Reply Quote 0
                    • Eternal-E Offline
                      Eternal-
                      last edited by Eternal-

                      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?

                      Profile | Eternal MOD pack | Check new client

                      I 1 Reply Last reply Reply Quote 0
                      • I Offline
                        iamscope @Eternal-
                        last edited by iamscope

                        Cannot delete

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post