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

    About the veterancy system

    Scheduled Pinned Locked Moved Balance Discussion
    88 Posts 35 Posters 6.7k 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.
    • FtXCommandoF Offline
      FtXCommando
      last edited by

      As Softles posted, this topic was looked into a year ago or so and it was found that the vet system has some relevant impact in essentially massive 400 v 400 asf fights and likely resulted in an additional 1 or 2 decrease in sim speed there. The rest of the game didn’t really see much impact from it at all.

      1 Reply Last reply Reply Quote 0
      • ValkiV Offline
        Valki @Jip
        last edited by

        @jip said in About the veterancy system:

        Note that having a combination of the options (e.g., an exception for the commander) will still introduce additional logic each time a unit receives damage or dies.

        Can't you put it on the attacking unit? When you have few units that participate in veterancy. Could it be a weapon property that a weapon increases the attacking units veterancy mass score if it scores a kill?

        1 Reply Last reply Reply Quote 0
        • C Offline
          cablefast
          last edited by cablefast

          I like option 2 the most.

          Didn't see it listed so figured I'd throw out an alternative idea. Unit age = veterancy. As in a unit that lives 2:00 minutes gets it's first vet, and maybe 5:00 minutes is the second vet, and so on.... Seems computational simple and would encourage players to keep units alive.

          1 Reply Last reply Reply Quote 0
          • KaletheQuickK Offline
            KaletheQuick
            last edited by

            Option 2 seems workable.

            Though as FtXCommando mentioned, the impact of veterancy on gameplay in general is so small. A whole force of veterans will beat an equal force of recruits, but TBH that feels like it. That is outside the topic here though.

            You must deceive the enemy, sometimes your allies, but you must always deceive yourself!

            T 1 Reply Last reply Reply Quote 0
            • T Offline
              Tagada Balance Team @KaletheQuick
              last edited by

              @kalethequick said in About the veterancy system:

              Option 2 seems workable.

              Though as FtXCommando mentioned, the impact of veterancy on gameplay in general is so small. A whole force of veterans will beat an equal force of recruits, but TBH that feels like it. That is outside the topic here though.

              Ftx was referring to vet system's impact on sim speed, not gameplay.

              1 Reply Last reply Reply Quote 1
              • JipJ Offline
                Jip
                last edited by

                After some further testing with 200 on 200, 300 on 300 and 400 on 400 ASFs fighting each other I can not reproduce my original results. Currently I have a reliable sim difference of at most 1 with 300 on 300 ASFs and beyond.

                I've also tried to experiment with damage over time using T1 UEF bombers. In the test I had 100 bombers firing at a Megalith. that resulted in a sim computation difference of ~10.2ms at peak (without) to ~10.4ms at peak (with). Three runs for each. It isn't significant, quite minor. In both cases it aligns with what Ftx and Softles stated.

                I'm updating the original post as I consider it misleading at this point. Not sure what happened when I tested before, maybe a background program (World Machine, hurr) interfered with it.

                A work of art is never finished, merely abandoned

                1 Reply Last reply Reply Quote 4
                • I Offline
                  IceDreamer Banned
                  last edited by

                  I designed the current system, and gotta say I like the sound of option 2. Wish I'd thought of that. It's not quite the same, as it means the distribution of damage from units which regen or get repaired shifts, but tbh that is so ridiculously uncommon I was wrong to take it into account. The cost of the table lookups probably isn't worth it.

                  xp = (damageDealt / MaxHP) * massCost should do the trick. Probably doable in about 20 minutes by anyone familiar with unit.lua.

                  JipJ 1 Reply Last reply Reply Quote 1
                  • arma473A Offline
                    arma473
                    last edited by

                    So people would get vet just from popping shots on the enemy commander? Two ACUs trade shots for a while and they both vet?

                    1 Reply Last reply Reply Quote 0
                    • BlackYpsB Offline
                      BlackYps
                      last edited by

                      You could tune down the mass cost of the commander to make that effect negligible

                      1 Reply Last reply Reply Quote 0
                      • JipJ Offline
                        Jip @IceDreamer
                        last edited by

                        @icedreamer said in About the veterancy system:

                        I designed the current system, and gotta say I like the sound of option 2. Wish I'd thought of that. It's not quite the same, as it means the distribution of damage from units which regen or get repaired shifts, but tbh that is so ridiculously uncommon I was wrong to take it into account. The cost of the table lookups probably isn't worth it.

                        xp = (damageDealt / MaxHP) * massCost should do the trick. Probably doable in about 20 minutes by anyone familiar with unit.lua.

                        I'm still running investigations into those table allocations. As indeed, the scenario you describe is rare and it introduces a lot of allocates in some situations.

                        For now it is important to first finish up the profiler in a reasonable state, then we can start looking at what really makes the sim tick 🙂

                        A work of art is never finished, merely abandoned

                        I 1 Reply Last reply Reply Quote 0
                        • I Offline
                          IceDreamer Banned @Jip
                          last edited by

                          @jip Oh, that's easy - The vast lion's share of the compute time is taken up by function calls across the C++/lua boundary. It's about two orders of magnitude slower than anything else. Potential areas for improvement would be to look for areas where the lua makes repeated, unneccessary calls to engine. I worked with a couple of guys to eliminate all the points in the exe which make stupid calls the other way, so that's already done.

                          Other than that, you can try using more local variables in hot code - Intel, collision detection, economy events.

                          JipJ 1 Reply Last reply Reply Quote 0
                          • JipJ Offline
                            Jip @IceDreamer
                            last edited by

                            @icedreamer said in About the veterancy system:

                            @jip Oh, that's easy - The vast lion's share of the compute time is taken up by function calls across the C++/lua boundary. It's about two orders of magnitude slower than anything else. Potential areas for improvement would be to look for areas where the lua makes repeated, unneccessary calls to engine. I worked with a couple of guys to eliminate all the points in the exe which make stupid calls the other way, so that's already done.

                            Other than that, you can try using more local variables in hot code - Intel, collision detection, economy events.

                            Yes - I've been looking into using locals. LOUD applies a similar pattern to optimize functions or to push them as an 'upvalue' which is still better than a global. A wikipedia entry that I've learned from quite a bit: https://springrts.com/wiki/Lua_Performance

                            Do you happen to know about how the garbage collector works in Lua? I've been trying to find informative examples, but came out short.

                            A work of art is never finished, merely abandoned

                            1 Reply Last reply Reply Quote 0
                            • JipJ Offline
                              Jip
                              last edited by

                              Oh - and while I have you - how did you found out about the boundary passing being expensive?

                              A work of art is never finished, merely abandoned

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

                                I profiled the game while it was running and produced a statistical output of how much time was spend in each function, both in engine, in lua, and the time at which the function call was registered.

                                1 Reply Last reply Reply Quote 0
                                • JipJ Offline
                                  Jip
                                  last edited by

                                  Do you still have that profiler?

                                  A work of art is never finished, merely abandoned

                                  1 Reply Last reply Reply Quote 0
                                  • K Offline
                                    Khal
                                    last edited by

                                    option 2

                                    1 Reply Last reply Reply Quote 0
                                    • JipJ Offline
                                      Jip
                                      last edited by

                                      A few months later, there was something wrong with the implementation of the veterancy system: it could hoard megabytes of worth of tables into memory! Read all about it here:

                                      • https://github.com/FAForever/fa/pull/4686

                                      A work of art is never finished, merely abandoned

                                      T 1 Reply Last reply Reply Quote 6
                                      • E Offline
                                        Evildrew @Jip
                                        last edited by

                                        @jip said in About the veterancy system:

                                        o back to the 'on-kill' notion, where the killer takes the mass value of the killee. This prevents

                                        None of the 5 options are optimal.

                                        Option 2 would lead to units vetting while fighting each other, a T1 arty hitting a T2 tank might lead to it vetting, a Sam hitting a Start would vet on 1 volley without killing it. Essentially dependent on the situation you get a restructuring of the balance as some units would by default get more HP during the fight while others wouldn't.
                                        If you implement some kind of time delay to vet up maybe that would prevent this but i imagine it would cause us having to have allocation tables again.

                                        Is it possible to spread 50% of the XP gained from killing a unit in an area defined by a certain size around the unit that got killed, i.e. spreading the XP to an army of units that likely were involved in the fight and giving 50% to the unit who got the kill? This would work for arties and nukes across the map if we really want those to vet and at the same time only give them half vet because if it is an arty war, no xp is received in the area where the unit/buildings are killed.
                                        This should also prevent table allocations and is option 6.

                                        1 Reply Last reply Reply Quote 0
                                        • Chenbro101C Offline
                                          Chenbro101
                                          last edited by

                                          I actually like the idea of units vetting while fighting each other. Sounds chaotic. Imagine a monkeylord fighting a gc. Its gonna vet up way faster than the gc.

                                          1 Reply Last reply Reply Quote 0
                                          • P Offline
                                            Plunder
                                            last edited by

                                            I see that most people are voting for option 2 here, but there are also downsides of giving veterancy to the unit that has not performed a kill yet. For example, you have tele sacu teleporting in your game ender, let's take mavor. They will get veterancy for every shot that they perform. In case of mavor 1 hp costs 28 mass (225K/8K HP). The damage of sera tele sacu is 400 with 400 dps. Which means tele sacu will get an instant veterancy after performing one shot in something very expensive, mavor, yolo, paragon, etc. In the case of the SMD, for example, if you repair it, you will buff the teleporting unit, cause it is gonna get a veterancy as long as you are repairing it. So the teleport is gonna be way to overpowered with an option 2. The same goes for every ACU teleporting into the game ender and not killing them. With an option 2 you are gonna extremely buff the teleport, because the teleporting unit (SACU or ACU) is gonna get a huge buff for every second damaging the target. Therefore I guess the options 3 is better or 4 is also ok. The veterancy should be given for kill, not for a damage delivered. That's my opinion, thanks!

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