AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Accuracy Fix (https://forums.alliedmods.net/showthread.php?t=166648)

MPNumB 09-06-2011 16:25

Re: Accuracy Fix
 
As I understood you are interested in the main purpose of this plugin (fix accuracy calculation). I didn't really understood this part "always calculated as the accuracy of a shot still part of the spray.", but I do understand what question you are asking. I cannot answer "yes" or "no" to that, but the way it works is this: Your current shot uses accuracy of your previous shot. However most of the guns after switch or reload have accuracy of first shot as it meant to be. But if you don't reload or switch your weapon, you wont ever have bullet as accurate as the first one. Some amxmodx coders as far as I know, have been aware of this for years. However mathematical calculation of in what vector bullet is heading is still unknown (as far as I know). Known is only existence of how accuracy value is changed during shooting and other factors.

As far as I am aware, I noticed this bug back in CS1.5 times, but I thought back then it was a reg glitch. My m4a1 bullet went like half a screen away from the crosshair (though I was runing then). That also was one of my most remembered moments of CS - made a headshot. :D

But back to topic. First I found out about this bug when I first got my eyes on amxx coders attempt to create a read-only cs-sdk. I remember clearly, I wanted to inform exolent and/or arkshine that this can't be right. I don't remember did I or didn't, but that's not important now, cause that code so far seems accurate.

This glitch didn't stay long in my head, until in steam Counter-Strike Source forum I found a thread with "discussion" (so to speak - more like trolling actually) about css having the same issue. It had some youtube link to it, which unfortunately I cannot find any longer - that video showed the same issue as in 1.6. After that for the first time I decided to test it myself, and guess what - this bug exists after all... Back then I remember first had the idea of making this plugin, but decided not to. Some weeks ago I found out about release of "Counter-Strike: Global Offensive", what I was quite interested in, but later how always got disappointed in VALVe. However during that time I made my research and CSS Pro players who beta tested the game, mentioned that first bullet was always dead on center. That reminded me about this plugin idea once again, but like before I thought "not worth the time". And the thing what finally forced me to do it was... I have a friend in steam who is also a really good friend in life, once told me that I suck with ak47. That I should try training with it. He personally is an ak47 pro in my opinion - more than 50% of kills are headshot. So he tried to train me and always kept telling "aim for the head, aim for the head!". I was doing exactely that, but with no luck - my bullets simply were going anywhere but in the middle of the crosshair. That's when I said "ok, that plugin seriously needs to be done, cause this s*cks hard...". Two days later I made a beta version of the plugin, and invited him, he confirmed, that game now felt more like he expects it to be (expects where the bullet should fly). After that I invited some more people from my friends list to also confirm this, and they all said that it's much better - more factor of skill, and less factor of luck. After I just wrote comments on the top of the .sma of what this plugin is designed to do, changed name from "test" to "Accuracy Fix", and same with .sma file, uploaded it, and here we are having this discussion. :)

// EDIT:

And answer to your question how accuracy works in CS: There is a variable what engine uses to determine how accurate comparing to crosshair position bullet is heading (even with punchangle [when spraying]). By logic this variable should be calculated before the shot is actually made (in the same moment, but few lines above the actual code when bullet gets fired). However it isn't - it's calculated after the position where it needs to be... And that's why we are having this glitch.

Arkshine 09-06-2011 16:49

Re: Accuracy Fix
 
Your answer makes sense. I did not understand fully before.

By the way :

- Please factorize your code, really. You can reduce drastically the whole code and would be less pain to review.
- I'm the author of cssdk and there is no credit. Without that, this plugin would not have existed. Please fix it.

MPNumB 09-06-2011 16:52

Re: Accuracy Fix
 
Quote:

Originally Posted by Arkshine (Post 1549665)
Your answer makes sense. I did not understand fully before.

By the way :

- Please factorize your code, really. You can reduce drastically the whole code and would be less pain to review.
- I'm the author of cssdk and there is no credit. Without that, this plugin would not have existed. Please fix it.

Ok, I'll give credit. However about factorizing the code, I must disagree. Almost every weapon has a different calculation. Code would be somewhat shorter, however, it would use much more variables with cells and/or much more "if's" and I don't want to do that on event what happens so often as weapon shooting.

Arkshine 09-06-2011 17:03

Re: Accuracy Fix
 
How stubborn ! But it's ok. I will kill you another time.

MPNumB 09-06-2011 17:22

Re: Accuracy Fix
 
Quote:

Originally Posted by Arkshine (Post 1549681)
How stubborn ! But it's ok. I will kill you another time.

:D Yes, I know, everybody hates to read my codes. But hey, they work and use less resources. :)

Also added the credits, and re-uploaded the plugin, with credits. Didn't change the version, cause there was no change in the functioning code itself (is just a few lines below, that's all).

Personal record: 78 downloads reset.

joaquimandrade 09-06-2011 17:48

Re: Accuracy Fix
 
Ok, so I had understand wrong and the bug is bigger than I thought. Congratulations for finding it and thanks for the post.

MPNumB 09-06-2011 18:00

Re: Accuracy Fix
 
Thanks, and you'r welcome. :)

Also, may you guys comment on new description? I tried to make it a bit more clear - did it work?

Bugsy 09-06-2011 18:02

Re: Accuracy Fix
 
:: awaits quim or arkshines magical orpheu fix ::

MPNumB 09-06-2011 18:06

Re: Accuracy Fix
 
Yes, at the beginning I was thinking about using Orpheu myself, but than I realized, that it's still isn't used by server admins as much as HamSandWich is. So I improvised. :D Plus if I remember right, not all of the functions related to weapon fire can be hooked/triggered as Arkshine once told me. I think the specific function was "FireBullets(...)".

cFG 09-06-2011 18:10

Re: Accuracy Fix
 
Damn man, if this work as you posted in description, your plugin - as someone said before - 'll be #1 installed and most important/demand for gameplay.

I appreciate your work, good job!

It'll be good to provide those videos on youtube instead of downloading 'em - easier to compare the results before installation and after.


All times are GMT -4. The time now is 10:28.

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