pac3 icon indicating copy to clipboard operation
pac3 copied to clipboard

Expression2 "pacSetKeyValue" update rate is very slow?

Open Ek-Videogames opened this issue 8 months ago • 6 comments

As of the last update, it seems like every keyvalue updated using the 'pacSetKeyValue' function only updates on a global 1 second interval - which pretty much wrecks alot of responsiveness of timing or rendering or computational stuff controlled with E2.

Is this intentional optimization or a bug, and is there some new setting to alter this that I am missing? Out of curiosity I already tried turning off Pac's E2 update rate limiter to see if that was blocking it, but that didn't work.

  • Just to clarify, I am fairly certain this isn't an issue with the specific chips either, debug output values are updating at normal speed. I can see the values updating in pac3's editor slower. Even ended up making a really basic outfit to double check, which was pretty much just an entity speedometer, still the same 1 second update lag issue.

Ek-Videogames avatar Apr 16 '25 05:04 Ek-Videogames

They are networked functions which can be spammed to disconnect players from the server, so the limiting is necessary, but that seems really slow. You tried pac_e2_ratelimit_enable 0 and that didn't work?

thegrb93 avatar Apr 16 '25 05:04 thegrb93

I think this byte limit might be what you're running into since pac_e2_ratelimit_enable doesn't turn it off and it updates every second.

https://github.com/CapsAdmin/pac3/commit/1d338cae824281d80658977ec4b58116a8530993

thegrb93 avatar Apr 16 '25 05:04 thegrb93

Try increasing pac_e2_bytelimit and see if that helps?

thegrb93 avatar Apr 16 '25 05:04 thegrb93

I think this byte limit might be what you're running into since pac_e2_ratelimit_enable doesn't turn it off and it updates every second.

1d338ca

Oh... right it is breaking before checking if the convar is false.

Try increasing pac_e2_bytelimit and see if that helps?

Increasing the byte limit to max has improved it somehow, but it's still overflowing - is the "global ID" is something that's included in the byte limit and being sent every time? Because otherwise I don't see how it is still able to overflow so easily from say, 4 keyvalues updating on a 60ms function timer.

Will try to do a bit of testing in more controlled variables to get a better metric of what exactly seems to be going on...

Ek-Videogames avatar Apr 17 '25 03:04 Ek-Videogames

The bytes is computed from the length of 'global_id' + 'key' + 'value', so if you got 64 bytes for those, x4 is 256 bytes, every 60ms is 4266.666 bytes/s. At every 16ms, you'd have 16000 bytes/s.

thegrb93 avatar Apr 17 '25 03:04 thegrb93

The bytes is computed from the length of 'global_id' + 'key' + 'value', so if you got 64 bytes for those, x4 is 256 bytes, every 60ms is 4266.666 bytes/s. At every 16ms, you'd have 16000 bytes/s.

Yes the global ID's are quite long - as suspected that seems to be what's eating all of the network traffic.

Ek-Videogames avatar Jun 27 '25 03:06 Ek-Videogames