SetTransmit on entities

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: SetTransmit on entities

Postby velocity » Wed Jan 16, 2019 7:23 pm

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..
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: SetTransmit on entities

Postby L'In20Cible » Wed Jan 16, 2019 8:32 pm

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.
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: SetTransmit on entities

Postby velocity » Thu Jan 17, 2019 12:51 am

I guess you are right, thanks for the optimization it helped a lot.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: SetTransmit on entities

Postby L'In20Cible » Thu Jan 17, 2019 1:43 am

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.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 37 guests