Raised This Month: $32 Target: $400
 8% 

TR_TraceRayFilter Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 08-19-2018 , 09:17   TR_TraceRayFilter Help
Reply With Quote #1

I have a plugin I am working on that makes use of the 'TR_TraceRayFilter' feature. I have it setup to poll every player every 0.5 seconds using OnGameFrame(). I am having some crash issues since I started using it, only when the server starts to get busy it happens. I have even looked at the crash dump (Linux OS), and the only hint I can get about the issue is a line:

IVP_OO_Watcher::hull_limit_exceeded_event()

The code below are the only two events I am using with the 'TR_' based functions, I want to make sure I am calling them right. The plugin works correctly but something is certainly amiss, I just want to make sure I have the trace portion setup right so I can debug the rest. Do I need to use a TR_TraceRayFilterEx instead with a handle/close handle? I am not sure if it is possible to get too many Traces going at once leading to an eventual crash. Any input is greatly appreciated.

PHP Code:
stock float GetEyeDistance(int clientint MASK_TYPE) {
    if(
IsClientValid(client)) {
        
float fEyeAngles[3], fTraceStart[3], fTraceEnd[3];

        
GetClientEyeAngles(clientfEyeAngles);

        
GetClientEyePosition(clientfTraceStart);

        
TR_TraceRayFilter(fTraceStartfEyeAnglesMASK_TYPERayType_InfiniteTRDontHitClientsclient);  

        
TR_GetEndPosition(fTraceEnd);
        if(
TR_DidHit(INVALID_HANDLE))
        { return 
GetVectorDistance(fTraceStartfTraceEnd); }
    }

    return 
0.0;
}


stock int GetEntityAtCrosshair(int client) {
    
float fStart[3], fEnd[3], Ang[3];

    
GetClientEyePosition(clientfStart);
    
GetClientEyeAngles(clientAng);
    
TR_TraceRayFilter(fStartAngMASK_SHOTRayType_InfiniteTraceRayDontHitSelfclient);

    if(
TR_DidHit(INVALID_HANDLE)) { TR_GetEndPosition(fEndINVALID_HANDLE); }
    return 
TR_GetEntityIndex();    
}


public 
bool TraceRayDontHitSelf(int entityint maskany data
{ return (
entity != data); }


stock bool TRDontHitClients(int entityint maskany data) {
    if (!
IsClientValid(entity)) { return true; }
    return 
false;
}


stock bool IsClientValid(int client)
{ return (
<= client <= MaxClients && IsClientInGame(client)); } 
__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 08-26-2018 , 08:32   Re: TR_TraceRayFilter Help
Reply With Quote #2

Is there any limitation to the TR_TraceRayFilter and/or TR_TraceRayFilterEx functions? Is it possible to have too many traces at once or before a map change causing an overflow or something (similar to how an edict overflow crash)? As I said before I have had zero issues until the server starts filling up with more players and then the crash happens. Very odd, hope someone can shine some light on this. Thanks in advance.
__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-26-2018 , 17:42   Re: TR_TraceRayFilter Help
Reply With Quote #3

As far as I understand a trace happens in real time.

Meaning TR_TraceRayFilter starts the trace and calls all the filter callbacks and by the time it's done and returns the trace is complete.

With this being said I dont think it's possible to even have two traces running at once.
__________________
Neuro Toxin is offline
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 08-27-2018 , 11:25   Re: TR_TraceRayFilter Help
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
With this being said I dont think it's possible to even have two traces running at once.
Thanks for the reply and info Neuro. What if two separate plugins fired a trace at the same time? I wonder if that would cause issues, I do have another plugin that fires traces. All speculation of course, but it is definitely a weird crash. I am still not sure what is causing it.
__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-27-2018 , 15:30   Re: TR_TraceRayFilter Help
Reply With Quote #5

As SM runs on a single thread it's impossible for two traces to run at once.

I suggest you install accelerator to help with debugging the crash.
__________________
Neuro Toxin is offline
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 08-28-2018 , 10:21   Re: TR_TraceRayFilter Help
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
As SM runs on a single thread it's impossible for two traces to run at once.

I suggest you install accelerator to help with debugging the crash.
Thank you for clarifying, I appreciate it. I might have a look at accelerator; are there any sample outputs from it somewhere to see if this is something I want to use?
__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT
scorpius2k1 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 08-29-2018 , 03:04   Re: TR_TraceRayFilter Help
Reply With Quote #7

https://crash.limetech.org/onlmsgo4gxfd

If you're on CS:GO it might give less friendly output, but post it here anyway and some gurus may possibly be able to help you diagnose the issue.
hmmmmm is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 08-29-2018 , 23:53   Re: TR_TraceRayFilter Help
Reply With Quote #8

Quote:
Originally Posted by scorpius2k1 View Post
if(TR_DidHit(INVALID_HANDLE)) { TR_GetEndPosition(fEnd, INVALID_HANDLE); }
return TR_GetEntityIndex();
[/PHP]
You want to get the entity ID. And if there is no Entity at the end point?
tonline_kms65 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode