Why is this issue increasingly addressed in competitions ? Over the years, gaming peripherals and hardware components are getting faster and more powerful.

In E-sports competitions, hardware configurations are imposed and can’t be modified. Peripherals and softwares however are not, which can give serious advantages if well chosen and configured.

In this article, we will focus on a very simple example to understand what causes latency from a mouse motion made by the player and its way to the game engine. Considering all the subjects that can be covered related to total latency, this article is only a dive into a part of system latency, which are mouse and CPU parts as shown in this NVIDIA schematic1 :

Overview of End-to-End System Latency - NVIDIA

Therefore, this article is not for beginners and comes with prerequisites:

  • Advanced knowledge of kernel and Windows.
  • Basic knowledge of anti-cheat systems, various computer components, game engine, bottlenecks, principle of frequency in computer science.

Before diving into it, it is important to remember that a CPU is considered as a low latency unit compared to a GPU which is a high throughput one. Therefore, our goal is to understand latency issues and how to make our CPU more responsive.2

I - Peripheral latency by comparing two of the most popular competition models

How is a mouse built ? A mouse is essentially a sensor that is tracking the surface underneath. Once the sensor registered the motion, it is sent to the computer.

The sensor quality is one of the most important component to reduce latency, but how to determine if it’s a good one or a bad one ?

Mouse latency can be caused by multiple factors. We will cover the most important ones :

  • Sensor latency (Resolution)
  • Communication latency

We’ll do a quick comparison between the best and the most used gaming mouses in E-sports competitions :

  • Logitech G Pro X Superlight 23
  • Razer Viper V3 Pro4

1. Sensor quality and polling

Mouse resolution, most known as DPI, is the number of measurements per second. In real life, mouse resolution is often related to mouse sensitivity because the more measures the mouse registers, the more mouse cursor moves quickly.5 Here is why :

On this schematic6, a 2x resolution increase results in a 2x more motions registered by the mouse sensor. Here is the difference between a 400 DPI mouse to a 800 one :

Difference between 400 DPI and 800 DPI - Optimum Tech YouTube video

By increasing DPIs and reducing in-game mouse sensitivity, your in-game perceived sensitivity will be the same, but not your mouse latency. Here is a comparison in the Optimum’s video6, using the same mouse :

Difference between Different DPI settings on the Logitech G Pro Superlight - Optimum Tech YouTube video

Blue bars represents mouse latency and orange lines the deviation, the more the bars are small the better. Using this technique, we can save up to 30.3% of mouse latency ! These results are only from 100 to 3'000 DPIs, not up to its maximum (35'000 DPIs). In addition, the Logitech G Pro X Superlight used in his video is a quite old model, released in late 2020.

Most recent mouses are reaching near 35'000+ DPI compared to 25'000 on this one. That’s why most E-sports players are playing high DPI with low in-game mouse sensitivity.

To learn more, watch this Optimum’s Tech video6.

Now let’s compare the two gaming mouses. The CPI tests (also known as DPI) results are very interresting between the two.7

DPI variation and deviation differences between the Logitech G Pro X Superlight 2 and the Razer Viper V3 Pro - RTings

The SRAV (speed-related accuracy variation) is the variation in mouse CPI accuracy observed when moving the mouse at different speeds (represented with dots) where the lines are the estimated curve of that variation.

In this Logitech G Pro X Superlight 2 RTings Graph - CPI8 shows that the mouse did not register about 0.04% of the motions. But the deviation is a bit higher : a 0.34% deviation between different speeds and a 0.51% deviation between different resolutions. That means the mouse registers almost all motions but has a deviation in precision a bit higher, nothing to be worried of.

In the Razer Viper V3 Pro RTings Graph - CPI9 , the mouse did not register about -3.64%, which means the mouse pointer was under from the perfect CPI accuracy motion. Otherwise, the deviation is at 0.007%, which is perfect (the most important factor).

It seems better because of its extremely low deviation but in reality, the error variation of the motion is more important compared to the Logitech G Pro X Superlight 2. That means the Logitech mouse registers in average almost perfect motions, but has a higher deviation than the Razer, which means, the motions are not consistent by changing the mouse resolution.

The Logitech has a little accuracy advantage compared to the Razer Viper V3 Pro even if both do a very good job. Even though, the Razer Viper V3 Pro is preferred from E-sports players because of its consistency (the most important factor).10

2. Data transmission

Once the gaming mouse has registered a motion, we need to send it to the PC, smooth transition to the second most important thing : the communication.11 Too many E-sports players spend money on very light-weight mouses with great sensors but with poor communication speeds.

It’s time to introduce polling rate, which is the number of times per second data is sent to the PC.12 In a graphical perspective, here is how to represent it13:

Polling rate differences in a graphic - Optimum Tech YouTube video

As we’ve seen before, mouse resolution increases the number of points registered during motions. If cursor resolution is too high, data is lost because communication methods are too weak to send them.12

Most of the gaming mouses have 1'000Hz or 2'000Hz polling rates, but last generations ones are capable of sending at 8'000Hz wirelessly. However, communication speed is not always a way to reduce latency. By enabling such polling rates, your system can be overwhelmed, we’ll cover it in the kernel section.14

The following image shows how different polling rates are displayed on a 240Hz screen13 :

Polling rates differences on a 240Hz screen - Optimum Tech YouTube video

If we take our two mouse competitors, the Razer Viper V3 Pro communication latency is crazy fast with an average of 1.2ms15. The Logitech G Pro X Superlight 2 on the other hand is a bit higher with an average of 1.6ms16 using them wired and wirelessly (with Wi-Fi 2.4GHz technology). See the difference in the following RTings graph17 :

Polling rates differences between the Logitech G Pro X Superlight 2 and the Razer Viper V3 Pro - RTings

As you can see, both mouses in E-sports are very close in communication latency and using them wirelessly does not affect significantly their performance. Bluetooth however can reach only 125Hz, and not recommended for E-sport gaming.

For further reading, see

II - Interruption at kernel and processor level

Once data is received on the PC, the Kernel’s job is to give user inputs to application to be treated (the game engine in our case). As Windows is mainly used in E-sports competitions, we’ll cover it here.

1. Example on Windows kernel

During your game, the kernel generates an interruption when a user input is received from the gaming mouse. The number of interruptions per second is defined by the mouse polling rate previously mentioned. With a polling rate of 1'000Hz, the kernel is interrupted 1'000 times per second that is overwhelming it of interrupts. That’s why increasing the polling rate of your mouse can drastically increase your latency. You must find the sweet spot depending on your CPU configuration before setting these options.12

During the interruption, the game engine is entirely frozen, waiting for kernel to return the user input and send it back to userland where the game engine is sitted. Here are the main layers crossed22:

Schematic of the Windows Kernel Architecture - Wikipedia

In this overview of the Windows kernel, the hardware interrupt is handled by the Hardware Abstraction Layer, which are software functions that are called when specific events (like our hardware interruption event) are triggered. Then, the kernel mouse drivers transfers it to the executive section of the kernel, by crossing kernel mode drivers layer.22

The top kernel services, also known as “executive layers”, are often considered as “abstraction layers” :

  • Object Manager that translates the mouse key press event from driver into a generic object understandable by the user mode application.22
  • I/O Manager which set the object to a I/O one and fill fields to send it back to the game engine, running in user mode. It’s like an API for user mode applications to call kernel mode operations.22

It is important to notice we are not covering the Windows Defender VBS (Virtualization Based Security) layers in the kernel that can boost by 5% your in-game performance.

If you want to learn more about it, see this YouTube video : No, Windows 11 Does NOT Ruin Gaming Performance (Don’t Disable VBS) - ThioJoe23.

2. Scan of the anti-cheat system and its place within the kernel

However, these abstraction layers are usually used by anti-cheats softwares to prevent cheaters because they were “easy” to develop and cheap. Over the years, cheaters found more sofisticated methods to bypass these security layers, with dynamic libraries or softwares running in kernel mode as fake drivers.

As a consequence, Game studios developed new anti-cheats systems that are launched directly with ring 0 privileges within the kernel. Which means that they are integrated into the kernel to allow anti-cheats to detect deeper cheats in hierarchy and to scan even more thinner.

These access rights are not appreciated by most of players because of security concerns. Having an application that is running with full access to all of your system can be very harmful : remember 2024 CrowdStrike-related IT outages24.

For example, Vanguard anti-cheat system was highly criticized when kernel mode has arrived, mainly because of its place within the kernel but also its requirements.

As a reminder, Vanguard must be running to play Valorant. To be launched, RIOT’s anti-cheat requires secure boot and overrides HAL functions to be sure no cheat is injected this way. In addition, it has its own drivers and adds its own abstraction layers to check at each stage (statically or dynamically) if no malicious software or library are added.25

Here are few articles you can read if you want to read more about it:

That being said, Windows kernel has many abstraction layers and some can be modified or added while playing (like Vanguard anti-cheat) that may causes latency issues on low end PCs.

III - Taking input into account in the game engine

At this stage, we’ve covered briefly the mouse input registration, transfer and the main layers of the Windows kernel crossed. Now, let’s see how the game engine takes into account the input.

Last thing to cover in this article is the reception of the information into the game engine. Then the optimizations you can do in your game and your peripherals softwares.

1. Input reception and management in the game engine

Once object is sent from kernel, game engines uses asynchronous callback functions which can be associated as event listeners functions. Once our mouse key press object arrives from the kernel, the game is interrupted and goes into this callback function.29

The first method game engines implemented at the very beginning is to handle the key press directly into the callback function. It worked because games were not very complicated at first, but over the years, new suitable methods were invented. In fact, some games could freeze if a lot of inputs were done simultaneously.

The most used one today is quite clever : the callback is in a dedicated thread and is only adding the event into a queue. Another thread dequeue the events to process them “simultaneously”. Its called the hybrid method.30

In competitive multiplayer games, latency is crucial as we’ve seen, but sometimes, servers, clients and network are not well synchronized. Servers must use lag compensation, which is a technique to save historical events (within milliseconds ranges) to know which event must be taken into consideration before others. For example, in a competitive shooter game, if a player has 45ms of network latency and an other player 50ms, the lag compensation methods consists of registering positions seen by the two players, then determine which one fired the first from their view (even if a player does lag !).31 Here is a exagerated view to understand32 :

Lag Compensation in Online Games Representation - Netduma's YouTube video

These days, it needs to be used on top of the hybrid method to be able to run online multiplayer games as if it was run locally. We are not going to talk about it because it’s not the aim of this article but if you want to learn more, see this introductive YouTube video32 or read this article31.

Once information has been received and taken into account in the game engine, it is then sent to the GPU to render the actions from the event queue.

We previously talked about mouse polling rate and in-game sensitivity. It’s now time to do some software adjustments.

2. Impact on CPU performance

To reduce CPU charge, a lot of settings can be changed to keep your game running smoothly with a very stable responsiveness.

We previously metionned the in-game sensitivity optimization, which is set to a factor 1 by default. If you want to keep your in-game sensitivity but reduce latency, simply divide by 2 each time you multiply by 2 your polling rate.6

Some examples :

Difference between  - Optimum Tech YouTube video

As we’ve seen before, CPU is the main component that is concerned to reduce latency. If our GPU is the bottleneck, our CPU is chilling thus our latency will be high. However, if our CPU is our bottleneck, latency will be lower because CPU will give all power to the game.2

That’s why “competitive in-game parameters” are ugly : screen resolution is low (720p or 1080p, sometimes 1440p theses days), graphics has no shadows, no detailed textures, no screen synchronization technologies such as V-Sync, FreeSync, G-Sync even if it is sometimes disputed as in this techless’s YouTube video33 (we are going to talk briefly about NVIDIA Reflex later). Our GPU needs to not be the stressed component. If you want the most optimized settings possible in all your competitive games, I highly recommend this Optimum’s YouTube video34 or Capet’s YouTube channel35, a former professional player.

Be careful, that being said, it doesn’t mean you need a weak CPU with a strong GPU or the opposite ! This way, you will have heavy lag spikes and feel some freezes during your game, which is not the desired behavior ! See this quite old The Lowest Input Lag PC Specs - Optimum36 YouTube video, it explains perfectly how to chose you PC components to reduce your PC latency. As mentionned in the introduction, in some E-sports competitions, PC configurations are imposed.

Disable most of “useless” settings in Windows (such as animations, shadows, background processes, etc), disable all running software with high CPU impact, enable hardware acceleration in supported apps (to not let the CPU do all the work and to run the game smoothly) have very positive impacts on your system latency, the more you disable, the less will be the latency.

If available, turn on low latency modes in your AMD or NVIDIA driver application, it can help a lot to reduce your latency. A couple of tutorials are available on the internet, but I recommend Capet’s ones37 because he also explains the different settings for beginners.

We’ve covered the essential from the mouse input to the game engine, let’s sum up and see what’s next.

Conclusion

In this article, we’ve seen that latency can be reduced drastically and why system latency can have a direct impact on a team’s victory, where milliseconds are counted in certain intense moments. Without talking about “total system latency” (peripheral latency + PC latency + display latency) as shown in the following screenshot, choosing the right component, optimized settings, and reducing the number of processes during the game has a direct impact on the latency between the peripheral and the engine.

Overview of End-to-End System Latency - NVIDIA

What’s next ? How can we improve even further our input lag ? Here are some subjects where it is possible to get crazy lower latency.

NVIDIA Reflex has been introduced in 2023 and it aims is to reduce render queue. Render queue is like the event queue we’ve covered but for sending images to render to the GPU. See this Optimum’s YouTube video24 mentionned before to understand what problem is raised.

Here are some articles from NVIDIA to learn more and setup on your compatible NVIDIA GPU:

Screen latency is a latency that is progressively disappearing because of OLED screens that has near 0.1ms of latency, compared to LCD screens that can have a latency of 1ms, 10ms or more !41

Before ending this article, it’s important to notice that latency is mainly due to the player, not the equipment. The player is still the bottleneck in the pipeline, even with trained players that have lower response times to act. If you are curious, read this PubNub - How Fast is Human Reaction Time? Human Perception & Tech42 article.

So, if you have the perfect PC configuration and settings, it may be a skill issue. :)

References


  1. NVIDIA - Understanding and Measuring PC Latency ↩︎

  2. LayerStack - CPU vs GPU: Which Processor is Right for You? ↩︎ ↩︎

  3. Logitech - LOGITECH PRO X SUPERLIGHT 2 ↩︎

  4. Razer - RAZER VIPER V3 PRO ↩︎

  5. Wikipedia - Mouse Speed (DPI) ↩︎

  6. YouTube - Why Gamers are Switching to High DPI - Optimum ↩︎ ↩︎ ↩︎ ↩︎

  7. RTings - CPI Graph Comparator - Logitech G Pro X Superlight 2 vs. Razer Viper V3 Pro ↩︎

  8. RTings - Logitech G Pro X Superlight 2 RTings Graph - CPI ↩︎

  9. RTings - Razer Viper V3 Pro RTings Graph - CPI ↩︎

  10. ProSettings - Best Gaming Mouse ↩︎

  11. Wikipedia - Mouse Communication Protocols ↩︎

  12. ArchLinux Wiki - Mouse Polling Rate ↩︎ ↩︎ ↩︎

  13. Youtube - Before you upgrade to higher polling rates. - Optimum ↩︎ ↩︎

  14. Akko - Mouse Polling Rate: How It Impacts Gaming Performance ↩︎

  15. RTings - Razer Viper V3 Pro Graph - Click Latency ↩︎

  16. RTings - Logitech G Pro X Superlight 2 Graph - Click Latency ↩︎

  17. RTings - Click Latency Graph Comparator - Logitech G Pro X Superlight 2 vs. Razer Viper V3 Pro ↩︎

  18. RTings - Our Mouse Control Tests - Click Latency ↩︎

  19. RTings - Our Mouse Control Tests - Sensor Latency ↩︎

  20. Reddit - How accurate are RTINGS click latency tests ↩︎

  21. YouTube - Mouse Wired vs. Wireless Latency: Final Answer - Optimum ↩︎

  22. Wikipedia - Architecture of Windows NT ↩︎ ↩︎ ↩︎ ↩︎

  23. YouTube - No, Windows 11 Does NOT Ruin Gaming Performance (Don’t Disable VBS) - ThioJoe ↩︎

  24. Wikipedia - 2024 CrowdStrike-related IT outages ↩︎ ↩︎

  25. Reddit - The insanity of EA’s anti-cheat system by a Kernel Dev ↩︎

  26. TheVerge - Track Hackers with Kernel level anti-cheats ↩︎

  27. GitHub article - Stop playing games using Kernel level anti-cheats (problems using them) ↩︎

  28. ARS Technica - Has RIOT anti-cheat gone too far ? ↩︎

  29. Reddit - Understanding Game Engines - How is it connected to the game itself? ↩︎

  30. Yuki’s Blog - Input Handling with Entity-Component-System Architecture ↩︎

  31. Medium - Beginning Game Development: Lag Compensation and Prediction ↩︎ ↩︎

  32. YouTube - Lag Compensation in Online Games Explained - Netduma ↩︎ ↩︎

  33. YouTube - You are using G-Sync wrong (probably) - techless ↩︎

  34. YouTube - Unbeatable Input Lag + FPS Settings (Frame-cap, Reflex, G-Sync) - Optimum ↩︎

  35. YouTube - Capet ↩︎

  36. YouTube - The Lowest Input Lag PC Specs - Optimum ↩︎

  37. YouTube - OPTIMISATIONS WINDOWS 11 - Capet ↩︎

  38. NVIDIA - How to optimize System Latency ↩︎

  39. NVIDIA - Understanding and measuring Total PC latency ↩︎

  40. NVIDIA Article - How does NVIDIA Reflex work ? How it reduces global system latency ↩︎

  41. YouTube - OLED vs IPS – 3 Months Later. - Optimum ↩︎

  42. PubNub - How Fast is Human Reaction Time? Human Perception & Tech ↩︎