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-05-2011 19:16

Accuracy Fix
 
2 Attachment(s)
Description:
One of the least known bugs in Counter-Strike is that accuracy of your bullet is set at the moment you made your previous shot, and how much time you wait has no effect on the bullet you just fired. However it has effect on the next time when you shall shoot. Sometimes players even think that their reg (bullet registration on the server) is off quite a bit. Fortunately this isn't a net code issue, but the actual glitch in accuracy calculation, what this plugin fixes. Also this plugin has few more has few more extra features. Shortly here's everything what it does:
  1. Fixes "use accuracy from last bullet fired earlier" glitch.
  2. Fixes and improves smooth spread transitions when shooting automatic weapons.
  3. Fixes spread cool-down at low fps.
  4. Fixes switched glock burst-fire accuracy of when moving and when standing still.
  5. Improves accuracy drastically, when you aren't moving and your spread is cooled down so to speak. You must stay on ground of course for that to happen. If you crouch, than effect becomes even stronger (in most weapons this scenario makes first bullet dead on center).
  6. One more drastic change is major improvement on sg550 weapon - as you may noticed, normally it isn't accurate at all, and that the spread is simply horrible, especially comparing to terrorist sniper rifle g3sg1.
  7. Last, but not least, when standing scout accuracy is somewhat improved - normally scout is really inaccurate, you must duck to make a shot after what you wont ask yourself "Whaaat??? How did I miss?".

Requires:
FakeMeta
HamSandWich


Additional info:
Tested in Counter-Strike 1.6 with amxmodx 1.8.2. You may also download demos to see for yourself this bugs and how well plugin handles them.


Notes:
Once installed, you wont see no graphical changes in accuracy. This is due to client-side accuracy calculation, what server does not update by default. In order to see actual location where bullet decal appears, you have to type "cl_lw 0" in console. But don't use this setting in actual gameplay, cause it disables client-side fire animations, and forces server-side ones what are delayed due to ping ("cl_lw 0" may and will lead to laggy gameplay).


Credits:
Special thanks to Arkshine for Counter-Strike SDK!


Change-Log:

* 3.0
- Added: Fix for glock wrong movement condition accuracy when in burst mode.

* 2.0
- Added: Fix for smooth spread transitions of automatic weapons.
- Added: Improved smooth spread transitions of automatic weapons.
- Added: Fix for slow spread cool-down of automatic weapons at low fps.
- Added: Smoother transition to maximum accuracy for pistols and sg550.

* 1.0
- First release.

stevenisecko138 09-05-2011 19:32

Re: Accuracy Fix
 
good job

nisam_ja 09-05-2011 19:55

Re: Accuracy Fix
 
very interesting. i will put this in plugins.ini and check it out ...

Ser_UFL 09-06-2011 05:41

Re: Accuracy Fix
 
Wow... I'll test this.

GarbageBox 09-06-2011 08:56

Re: Accuracy Fix
 
Good!
Try later

blanko 09-06-2011 09:04

Re: Accuracy Fix
 
Dude! If this really works, it might be one in the top 3 best plugins ever!!!

MPNumB 09-06-2011 10:00

Re: Accuracy Fix
 
Quote:

Originally Posted by blanko (Post 1549405)
Dude! If this really works, it might be one in the top 3 best plugins ever!!!

Thanks. And it does work. =)

nisam_ja 09-06-2011 12:08

Re: Accuracy Fix
 
works very nicely

exolent where r you. this should be allowed asap

Rossonero 09-06-2011 12:17

Re: Accuracy Fix
 
as impressive as always :) ...

joaquimandrade 09-06-2011 14:43

Re: Accuracy Fix
 
Hello fellow. Your plugin got me curious. First, let me see if I understood right your find: you are saying that the accuracy of one shot alone (let's call it the first shot after spraying) is always calculated as the accuracy of a shot still part of the spray. But, only the first shot and then everything is calculated right. That's correct? Well, correct or not, for what I've read from your description at least one shot calculation is wrong and that surprises me because in a game like CS a single shot makes a lot of difference and I can imagine that in competitions it gets worst. That also makes me curious of how this passed undetected throught years. I would like to ask you to provide more information about this stuff, if you don't mind. Like, more details about how accuracy works in CS.

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.

MPNumB 09-06-2011 18:27

Re: Accuracy Fix
 
Quote:

Originally Posted by cFG (Post 1549716)
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.

Thanks for the words. =)

Yes, I know, a HD video would be much better, however I am not a movie-maker. I could make videos, but they will be quite bad... Anyway, I'll try to find someone who can make those videos. But if someone can offer to make them, I'd gladly accept. =)

Napoleon_be 09-07-2011 08:32

Re: Accuracy Fix
 
Why isn't this plugin approved already? This plugin is just awesome!

xPaw 09-07-2011 10:19

Re: Accuracy Fix
 
Quote:

Originally Posted by Napoleon_be (Post 1549941)
Why isn't this plugin approved already? This plugin is just awesome!

Having awesome plugin doesn't get it approved withing first days of release.

Arkshine 09-08-2011 09:16

Re: Accuracy Fix
 
Quote:

Originally Posted by Bugsy (Post 1549711)
:: awaits quim or arkshines magical orpheu fix ::

Actually Orpheu won't help really here. Since you need anyway to do things before and after a Fire function. I don't see an advantage, maybe more reliable.

Quote:

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(...)".
You can use this method : https://forums.alliedmods.net/showpo...02&postcount=7 ; based on virtual functions to get the address directly of the Fire function. So, basically, you don't need signatures.

BeasT 09-09-2011 13:18

Re: Accuracy Fix
 
This is an awesome plugin. But not sure if players will like the idea of their skill being influenced by some plugin. Because in mixes this bug won't be fixed. You know, bugs that are not being fixed for a long time, become a part of the gameplay. Ahh if only valve would fix this.

O šiaip, dėkui už puikų pluginą.

MPNumB 09-09-2011 16:12

Re: Accuracy Fix
 
Well, thing is that players don't like fixes of the bugs, usage of what they can make to their advantage. This bug only gives disadvantage, so I truly don't think that people will dislike it.

Nera uzh ka. :)

Bugsy 09-09-2011 16:20

Re: Accuracy Fix
 
Most people have been playing for a long time and will need to adjust how they play, which may be annoying to some. I haven't used this yet so I have no idea how it impacts play. I'm sure many will use it as their go-to excuse when they get owned..if they are aware it is running of course.

MPNumB 09-09-2011 16:28

Re: Accuracy Fix
 
Well, I wouldn't say that this plugin will work for the bad, cause... Cause I'm actually fixing, so bullets would go in the crosshair (where people expect them to go), and not in some random spot. Cause I would like to note: this isn't weapon recoil - it touches nothing in recoil. It fixes accuracy compared to the crosshair what has nothing to do with the recoil.. Accuracy itself is something what is randomized in the engine, and it cannot be learned. In other words, this type of accuracy is exactly the same random as firing bullet with awp while in air and without zoom, except case scenario with awp has a higher value length through what it can choose a random number.

FOUTA 09-10-2011 00:02

Re: Accuracy Fix
 
very good job and very useful, it sure took quite some time to make it
thank you dude :D

b0n40 09-14-2011 03:42

Re: Accuracy Fix
 
My FAV PLUGIN for all times :) !
gameplay is much better!

Rossonero 09-15-2011 15:45

Re: Accuracy Fix
 
maybe I should have made a demo or a photo or something, but...
as you can see in the demos from the main post, in the one without the plugin installed, when NumB shoots with the scout at distance, it does not hit the target

well it happened to me too, same thing tried at the ts spawn with the scout, and it hit slightly off

all in all, it is an important improvement, most of them didn't know anything had changed, but having talked to just a few players, the said it's better

still using it, ever since first heard of it
respect MPNumb, fix it more, we like it :)

FOUTA 09-16-2011 21:58

Re: Accuracy Fix
 
OMG after seeing the demos, i understood what you meant
:shock:
excellent job, i think ur the best at this :D
waiting for more of your plugins ....

Arkshine 10-02-2011 14:26

Re: Accuracy Fix
 
Reminder for me : the hardcoded value should be checked one day.

Meanwhile, code is correct.

Approved.

gOOdRich 10-05-2011 10:20

Re: Accuracy Fix
 
Excellent :up:

Automatic 10-15-2011 06:07

Re: Accuracy Fix
 
http://www.youtube.com/watch?v=yVYCDfR0F44

in this video a shot placement bug is present, was this fixed with your plugin?

this bug happens at random, or so it seems, no movement or firing determines when it happens, it just falls on a cycle or something and decides to miss, something that never happens on a lan game.

you can only see it happen with cl_lw 0, but you can feel it happen no matter what while playing live.

kream1g 10-17-2011 13:02

Re: Accuracy Fix
 
So you need ur own server with amx mod for this fix to work right?

xPaw 10-17-2011 13:37

Re: Accuracy Fix
 
Quote:

Originally Posted by kream1g (Post 1577682)
So you need ur own server with amx mod for this fix to work right?

You're joking, right?

kream1g 10-17-2011 13:39

Re: Accuracy Fix
 
Quote:

Originally Posted by xPaw (Post 1577698)
You're joking, right?

im dead serious lol. do you?

xPaw 10-17-2011 14:21

Re: Accuracy Fix
 
Quote:

Originally Posted by kream1g (Post 1577701)
im dead serious lol. do you?

http://gm4.in/i/lj.png

Arkshine 10-17-2011 14:26

Re: Accuracy Fix
 
You can still make a metamod plugin and you won't need amxx. :twisted:


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

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