Raised This Month: $12 Target: $400
 3% 

Solved How is PVS ( Potentially view set ) calculated for an origin ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2022 , 13:10   How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #1

I am trying to check if an origin can be in a player's potenially view set so far i've made this, but its buggy, because it create entities.

PHP Code:
// Is Origin in player's potentially view set?
bool:IsOriginInPlayerPVS(const id, const Float:fOrigin[3])
{
    static 
iEntnextFloat:fEntOrigin[3];

    
iEnt create_entity("info_target");

    if( 
iEnt )
    {
        
engfunc(EngFunc_SetOriginiEntfOrigin);

        
next engfunc(EngFunc_EntitiesInPVSid);

        while( 
next )
        {
            
pev(nextpev_originfEntOrigin);

            if( 
xs_vec_equal(fOriginfEntOrigin) )
            {
                
set_pev(iEntpev_flagsFL_KILLME);
                
dllfunc(DLLFunc_ThinkiEnt);

                return 
true;
            }

            
next pev(nextpev_chain);
        }

        
set_pev(iEntpev_flagsFL_KILLME);
        
dllfunc(DLLFunc_ThinkiEnt);

        return 
false;
    }

    return 
false;

Edit: Looking through Xash3D engine i found out this native Mod_GetPVSForPoint but i couldn't locate its function.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-21-2022 at 17:25.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-18-2022 , 14:27   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #2

Check this out: https://github.com/dreamstalker/rehl....cpp#L763-L804
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2022 , 17:41   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #3

Alright i set up a new function to find if the origin is in player PVS but now i am having problems with getting signatures

PHP Code:
// Is Origin in player's potentially view set?
bool:IsOriginInPlayerPVS(const id, const Float:fMessageOrigin[3])
{
    static 
Float:fvPlayerOrigin[3], leafnummaskbitNumber;

    
leafnum OrpheuCallSV_PointLeafnumfMessageOrigin );
    
mask OrpheuCallCM_LeafPVSleafnum );

    if( !
mask )
    {
        return 
true;
    }

    
pev(idpev_originfvPlayerOrigin);
    
bitNumber OrpheuCallSV_PointLeafnumfvPlayerOrigin );

    if( ((
mask |= ((bitNumber 1) >> 3)) & (<< ((bitNumber 1) & 7))) )
    {
        return 
true;
    }

    return 
false;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-18-2022 , 17:54   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #4

HLDS / reHLDS? Version?
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2022 , 19:31   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #5

I found a simpler way to do it using SV_ValidClientMulticast.

PHP Code:
// Is Origin in player's potentially view set?
bool:IsOriginInPlayerPVS(const idFloat:fMessageOrigin[3])
{
    static 
leafnum;
    
leafnum OrpheuCallSV_PointLeafnumfMessageOrigin );

    return 
boolOrpheuCallSV_ValidClientMulticastidleafnumMSG_PVS );

all i need are the signatures ReHLDS latest version REHLDS_v311-776
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-18-2022 , 23:57   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
I found a simpler way to do it using SV_ValidClientMulticast.

PHP Code:
// Is Origin in player's potentially view set?
bool:IsOriginInPlayerPVS(const idFloat:fMessageOrigin[3])
{
    static 
leafnum;
    
leafnum OrpheuCallSV_PointLeafnumfMessageOrigin );

    return 
boolOrpheuCallSV_ValidClientMulticastidleafnumMSG_PVS );

all i need are the signatures ReHLDS latest version REHLDS_v311-776
Dumb question, you've tried it, I haven't tested it so I can't confirm.

PHP Code:
bool:IsOriginInPlayerPVS(const idFloat:fMessageOrigin[3])
{
        static 
leafnum;
        
leafnum SV_PointLeafnum(fMessageOrigin)

        return 
boolSV_ValidClientMulticastidleafnumMSG_PVS );

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-19-2022 , 06:26   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #7

Here are the signatures for
SV_ValidClientMulticast ( the linux signature could not work, because I found just a reference from this function, not it's offset ):
PHP Code:
{
    
"name" "SV_ValidClientMulticast",
    
"library" "engine",
    
"arguments" :
    [
        {
            
"type" "int"
        
},
        {
            
"type" "int"
        
},
        {
            
"type" "int"
        
}
    ],
    
"return" :
    {
        
"type" "bool"
    
},
    
"identifiers" :
    [
        {
            
"os"    "windows",
            
"mod"   "cstrike",
            
"value" : [0x550x8B"*"0x510x560x33"*"0x570x8B0xF9]
        },
        {
            
"os"    "linux",
            
"mod"   "cstrike",
            
"value" : [0x4D0x55"*"0x540x490x430x410x530x54"*"0x200x450x20x72"*"0x720x200x250x640x21]
        }
    ]

and

SV_PointLeafnum:
PHP Code:
{
    
"name" "SV_PointLeafnum",
    
"library" "engine",
    
"arguments" :
    [
        {
            
"type" "float"
        
}
    ],
    
"return" :
    {
        
"type" "int"
    
},
    
"identifiers" :
    [
        {
            
"os"    "windows",
            
"mod"   "cstrike",
            
"value" : [0x510x8B0x150xB0"*""*"0x040xE8]
        },
        {
            
"os"    "linux",
            
"mod"   "cstrike",
            
"value" 0x6A6B4
        
}
    ]

Tested on windows and linux ( but with the problem mentioned above for 'SV_ValidClientMulticast' )
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Old 06-19-2022, 06:34
HamletEagle
This message has been deleted by HamletEagle. Reason: Nvm
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-19-2022 , 11:16   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #8

Anyway to get the address of SV_ValidClientMulticast ? i already found a ref tho but i don't know how to use it to find the actual function.

Can anyone disassemble the engine using linux OS. ?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-20-2022 at 06:38.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-21-2022 , 17:22   Re: How is PVS ( Potentially view set ) calculated for an origin ?
Reply With Quote #9

Solved: Using the first method in post #1 but creating the entity once and never removing it also moving it around for players prediction.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-21-2022 at 17:26.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 03:58.


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