Jezza wrote: velocity wrote:
That's because it's unclear what you want to do with the PassServerEntityFilter. For example, the reason this is fast
is because it's practically just doing a lookup. But if you want to use Entity, Player, etc. to do other processing, please provide that code.
I'm not doing any other processing, other than making checks on who should collide with who, just like in SourceMod script. I have learned from past mistakes, that game-oriented attributes like player.dead could overflow the var. I'm doing less than the script, because right now I'm trying to isolate the lag, so it's just two EntityDictionary lookups for address1 and address2. What I might have failed to mention, but is evident, is that speeding up functions like this helps compensate the additional processing of SetTransmit, which is also required to make it work fully, which can also be seen in the .sp. On top of this, not to mention OnPlayerRunCmd for 'other server stuff'. So, I think it is only an advantage that the hook of these functions is as optimized as possible.
Jezza wrote:I also did a quick measurement of the amount of PassServerEntityFilter calls (32bots + 1player), and it seems that on average the PassServerEntityFilter is called 250 times per tick.
I have just implemented the new optimizations L'In20Cible combined with urs (Address -> Entity) etc... So I cannot confirm what I'm about to say: I tested with 20 bots and var didn't seem that off, but I have my suspicion regarding the actual impact of bots based solely on their movement. For example, if you stand still the PassServerEntityFilter almost doesn't fire at all, after 15 seconds it's like 100 calls, but if you move around the calls are much more frequent. On top of that, if two players are 'grinding' each other, or when an entity is colliding with another entity is where the function gets an insane amount of calls. So I would like to test out with real players, as well, before concluding (just hard to get 20 players xD).
L'In20Cible wrote:Latest commit works for me on CS:S and CS:GO, and also add support for CollisionHash.
Nice, what is CollisionHash? Is CollisionHash Jezzas py implementation in c++ for faster look up when using OnEntityCollision?
I really want to try these things out! I have a small request, if possible, can your branch be merged with Cookstars branch implementation of(don't know if that's you Jezza) SetTransmit. So I can try them combined and see if the server can handle it? I know there are disagreements with the implementation of SetTransmit, but either solution is better than hooking SetTransmit with EntityCondition, at the moment. Also a build for Linux/CS:GO.
This thread got longer than expected, and I appreciate the time and effort, so I would like to take a moment and thank you guys: L'In20Cible, Jezza, and Ayuto for your suggestions and general insights for speed optimizations etc.
On the occasion of this, I want to shine some light on this post again: viewtopic.php?f=9&t=2036&p=12854&hilit=donation&sid=7857ff58a2aedd0f39f20ee65a3d50c8#p12854