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

Correctly predicting mousedx and mousedy in CUserCmd?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-31-2017 , 20:12   Correctly predicting mousedx and mousedy in CUserCmd?
Reply With Quote #1

https://github.com/ValveSoftware/sou...md.h#L164-L165

Those variables are exposed in the OnPlayerRunCmd forward.
I need to figure out how to properly predict the value for them.

What I've tried, and solutions I've been suggested to try - none have worked: (mousex)
1. Delta between the last viewangle's and current's Y axis, divided by m_yaw. < not even close, and I get a float. Results aren't correct even by rounding to floor, ceiling or nearest.
2. The same as 1, but m_yaw is divided by sensitivity.
3. Took the player's m_filter value into account and divided by 2.
4. Solutions found in a cheating forum, won't link for obvious reason. But they don't seem to properly predict this either.

I feel like I'm doing something very wrongly, any help please?
__________________
retired
shavit is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-31-2017 , 23:26   Re: Correctly predicting mousedx and mousedy in CUserCmd?
Reply With Quote #2

I don't believe it's possible to predict accurately. If you look at the source code for where it's placed into the usercmd it's converted to an int from a float and rounded.

https://github.com/ValveSoftware/sou...mouse.cpp#L555

This differs depending on the mouse samples accumulated over the update interval which may be tied to fps. The most accurate thing you can do that i can think of is get an average of large view angle jumps where they should be above 0.5 rounded and compare that to the short value to see if it has any sort of consistency. I'm assuming you're wanting this for an anti cheat detection method. The only time I've seen a public attempt at using this is on TortoiseOrHare's github for nocheatz.

https://github.com/TortoiseOrHare/No...ouseTester.cpp
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-31-2017 , 23:34   Re: Correctly predicting mousedx and mousedy in CUserCmd?
Reply With Quote #3

Quote:
Originally Posted by 1337norway View Post
I don't believe it's possible to predict accurately. If you look at the source code for where it's placed into the usercmd it's converted to an int from a float and rounded.

https://github.com/ValveSoftware/sou...mouse.cpp#L555

This differs depending on the mouse samples accumulated over the update interval which may be tied to fps. The most accurate thing you can do that i can think of is get an average of large view angle jumps where they should be above 0.5 rounded and compare that to the short value to see if it has any sort of consistency. I'm assuming you're wanting this for an anti cheat detection method. The only time I've seen a public attempt at using this is on TortoiseOrHare's github for nocheatz.

https://github.com/TortoiseOrHare/No...ouseTester.cpp
NoCheatZ-4's detection method seems promising. Thanks for linking!
__________________
retired
shavit 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 23:38.


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