Page 2 of 2

Re: SetTransmit on entities

Posted: Wed Jan 16, 2019 7:23 pm
by velocity
Definitely an improvement, but it still lags with too many people (after 6 real players, bots apparently take it more nicely) and especially if you are making a plugin that tries to hide everyone because then you have to do same (make_object again) with edict = CheckTransmitInfo._obj(args[1]).client and index_from_edict etc..

Re: SetTransmit on entities

Posted: Wed Jan 16, 2019 8:32 pm
by L'In20Cible
velocity wrote:Definitely an improvement, but it still lags with too many people (after 6 real players, bots apparently take it more nicely) and especially if you are making a plugin that tries to hide everyone because then you have to do same (make_object again) with edict = CheckTransmitInfo._obj(args[1]).client and index_from_edict etc..
Yeah well, like I said earlier, the performance of make_object are acceptable and you really don't gain a lot by not using it. I just responded to your concerns about the possibility of optimizing it. If your server lags with 6 players, then that is definitely not caused by make_object. Also, _obj is as fast as it can get; it simply cast the address and return it.

Re: SetTransmit on entities

Posted: Thu Jan 17, 2019 12:51 am
by velocity
I guess you are right, thanks for the optimization it helped a lot.

Re: SetTransmit on entities

Posted: Thu Jan 17, 2019 1:43 am
by L'In20Cible
velocity wrote:I guess you are right, thanks for the optimization it helped a lot.

I've been running some tests locally with 19 bots by running the code you posted on GitHub and while the net_graph was bouncing red sometimes, I didn't notice any "lags" whatsoever while playing. I've also joined some of the most populated servers and some of them were very high but the game-play was still very smooth:
ImageSo my question here is, do you notice lags that are disruptive to the game-play or your concerns are solely based on the net_graph? If the later, I assume the net_graph itself shows red based on what the game would expect to run at without mods, etc.

A hook to set_transmit is brutal, to be honest. After some testing, on de_nuke with 19 bots and myself playing normally, the hook is called ~1300 times every frame. When we say that tick listeners are hungry, this is like having 1300 of them in the same plugin.

There are a lot of way you can optimize your implementation. Just to name a few; caching, learning, and exiting early. I can help you to find and implement better approach assuming you are willing to share very specific details of what your goal is.