etlegacy icon indicating copy to clipboard operation
etlegacy copied to clipboard

team_maxAirstrikes/team_maxArtillery does not work correctly

Open x0rnn opened this issue 1 year ago • 8 comments

https://www.mediafire.com/file/e82puftaupztlp6/szkqm5.mp4/file

team_maxAirstrikes "2" should allow 2 airstrikes per minute, as per the video it happened 4 times per minute.

x0rnn avatar Feb 28 '24 19:02 x0rnn

Streamable link, should be available 90 days I think: https://streamable.com/ts368r

x0rnn avatar Feb 29 '24 22:02 x0rnn

In scenarios where team_maxAirstrikes or team_maxArtillery is set, the way air support limits are calculated is following (example with airstrike, artillery is same):

  • airstrike counter is incremented by 60000 / team_maxAirstrikes value when an airstrike is called (so in case of team_maxAirstrikes 2 = 30000
  • each frame, airstrike counter is decremented by server frametime (1000 / sv_fps)
  • the check if airstrike is available is determined by checking if airstrike counter > 60000, if it's less, then airstrike is available

Given this, setting the limit to 2 will always allow initially 3 airstrikes to be called, because as soon as the first airstrike is called, the counter is already decremented by one frametime, so the check for airstrike counter > 60000 will be false, and the airstrike goes through.

Looking at the clip, the airstrikes are called roughly at the following timestamps:

  • first airstrikes ~10:05
  • second airstrike ~9:48
  • third airstrike ~9:36
  • fourth airstrike ~9:07

Give or take few seconds of error since I'm judging just from the video without actually seeing the exact times where airstrikes are thrown, there's nothing wrong with this clip and it's working as expected.

  • 1st airstrike called = counter is at 30000
  • 2nd airstrike called = ~10-15s passed since first airstrike
    • counter has decreased to ~10000-15000 = counter is now at ~40000-45000
  • 3rd airstrike called = ~30s passed since first airstrike
    • counter has decreased to ~10000-15000 = counter is now at ~40000-45000
  • 4th airstrike called = ~1min passed since first airstrike
    • counter has decreased to ~10000-15000 = counter is now at ~40000-45000

Whether or not the method for limiting makes sense is another question, but the current limitation method works as expected.

Aciz avatar Feb 29 '24 23:02 Aciz

So setting it to 1 would allow 2 per minute... Not very intuitive, but at least I figured out why it was way more spammy on the server since we migrated to legacy.

x0rnn avatar Mar 01 '24 07:03 x0rnn

FWIW ETPro seems to limit air support in similar way, there's not explicit cvars for it but the limiting seems to work the same way.

Aciz avatar Mar 01 '24 12:03 Aciz

On ETPro there is just g_heavyWeaponRestriction, which in itself worked better. Having it the same value on legacy didn't work, there was still more HW spam, that's why I enabled team_maxAirstrikes.

x0rnn avatar Mar 01 '24 13:03 x0rnn

Yeah the math works out a bit different, legacy has separated airstrike/artillery limits as separate limits, whereas etmain (and probably etpro) use the same limit for both.

Aciz avatar Mar 01 '24 13:03 Aciz

Since we have a cvar for both of them we should also probably have a "combined" one, meaning that we might allow 2 artilleries and 2 airstrikes, but also limit the spam to 3 of either per minute in total.

jackeri avatar Mar 01 '24 13:03 jackeri

Yeah, something like team_maxAirsupport which if set, would override both team_maxArtillery and team_maxAirstrikes.

Aciz avatar Mar 01 '24 13:03 Aciz