CS:GO

Bug In CS2 – Incorrect Processing Order For Inputs


I wanted to add additional information and confirm the findings by Visible_Shelter9028. I discovered the bug back in May and the summary of my findings are below. Click the link at the bottom of the post to see a PDF for complete write up. It is about 11 pages and looks into the scenarios where input accuracy is confirmed.

I am in the process of creating a webpage of all bugs I have found. However, life gets in the way and writing the reports takes time (checking and then double checking results) so I created a PDF of the report to show and confirm the results by Visible_Shelter9028.

TLDR:

When mouse movement and mouse1 (left mouse button) click occur within the same frame, the engine processes the click before the movement. For example, if you move the mouse 100 pixels in one frame and then clickmouse1 to fire a weapon in the same frame, the game will register the weapon fire first before updating the player's position, even though the inputs were ordered in such a way as to move the crosshair first and then fire. This bug will affect flicking and spraying, and it impacts players with a high effective DPI and/or low frames per second more severely. However, players with high frames per second and low effective DPI are also affected, albeit to a lesser degree.

Additionally, I've noticed some comments suggesting that sensitivities differ between CS2 and CSGO, but this does not seem to be the case. When comparing results with the sensitivities set to the same value, the bullets landed in the same position in both CS2 and CSGO when the input order was followed correctly.

More In Depth Summary:

In CS2, an issue has been identified concerning the order in which inputs are processed, particularly involving mouse movement and weapon firing. When mouse movement and mouse1 (left mouse button) click occur within the same frame, the engine processes the click before the movement. This results in the bullet being registered at the player's position from the previous frame rather than the current frame.

To investigate this issue, a bot was utilized to generate mouse movement and input commands using the Windows api. Cython, a superset of the python programming language, is used to access the Windows api and create the functions necessary to conduct the test in a high performance manner. The test scenario involved issuing two mouse movements of 100 pixels each in the positive x-direction (to the right), followed by pressing and releasing mouse1. Various tests were conducted with different hold times between each mouse movement and firing action. For example, with a 1-millisecond hold time, the first mouse movement would occur at 0ms, the second at 1ms, and the mouse1 press and release at 2ms. To ensure inputs occurred within the same frame, the game was set to an fps_max of 100.

In CS2, with a 1-millisecond hold time, 78 out of 100 trials resulted in the shot being fired before any movement was registered, 8 times the shot registered after the first movement, and 14 times the shot registered after both movements. To confirm the bot's accuracy, the same timings were tested in Microsoft Paint, where 100 out of 100 attempts resulted in a red dot being placed at the final mouse position after both movements. Similarly, in CSGO, 100 out of 100 attempts also placed the shot at the correct position. This behavior was consistent across various timings and is detailed below.

Does this issue affect players in real game-play, or is it restricted to this specific test scenario? The bug certainly affects players. It is common to move the mouse and click simultaneously, especially during flick shots or spray control. The impact varies based on individual settings within CS2 and mouse configurations. In CS2, any mouse movements within a frame are combined and then processed at the end of the frame or the start of the next frame. For instance, if the two 100-pixel movements mentioned earlier occur within the same frame, they are added together and then multiplied by the user's sensitivity to determine the final distance moved. Players with a higher effective DPI (mouse DPI multiplied by in-game sensitivity) may register more movement within a frame. Additionally, lower frame rates or higher frame times (including spikes) can lead to more inputs occurring within a frame. Consequently, high sensitivity players with low frames per second will be most affected by this issue,though players with higher frames per second or lower sensitivities are not exempt.

Sample Results:

Below is a plot of the results at varying hold times. In CSGO and Microsoft Paint 100 out of 100 tests were green for which the shot registered after both mouse movements. In CS2, there is variation for which there should not be.

https://preview.redd.it/6bqlncfk3ftd1.png?width=2560&format=png&auto=webp&s=502e20f8e6f5947de0d63c662e258cc10ecbaabf

Link To PDF:

https://www.dropbox.com/scl/fi/0xuzl3xw7wcxs4vofj5ce/Document-5.pdf?rlkey=87pvq9pwljxb0zor87d0y5fky&st=yybka6a0&dl=0

1 Comment

  1. mawin007

    GaBeN : fix bug ? that can make me Revenue ?? come on kids buy Armory pass and play for skins

Write A Comment