Improving Linear Search Performance Using x86 AVX

Linear search is one of the simplest algorithms for finding a value in a sequence. It has a worst-case time complexity of \(O(n)\), making it asymptotically less efficient than algorithms such as binary search, which performs lookups in \(O(\log n)\) on sorted data. If the data is initially unsorted, however, it must first be sorted at a cost of \(O(n \log n)\). For a single lookup, this preprocessing cost makes sorting followed by binary search slower than a linear scan. Binary search becomes advantageous when the same dataset is searched repeatedly. ...

July 20, 2026 · 18 min · rakitin

Counter-Strike 2: Reverse Engineering The Sub-Tick System

Counter-Strike 2 introduced a new input system called Sub-Ticks, replacing the traditional approach where a user_cmd represented a single game tick. Instead, each command can now contain multiple sub-tick inputs, allowing the server to reconstruct player actions with much greater precision. What are Sub-Ticks? Prior to Source 2, player input was sampled once per server tick. Counter-Strike 2 instead records player actions at a higher temporal resolution by storing multiple sub-tick events inside a single user_cmd. ...

April 2, 2023 · 2 min · rakitin

Counter-Strike 2: Reverse Engineering Ray Tracing

A core requirement of any aimbot is determining whether an enemy is visible or obstructed by world geometry. To answer that question reliably, the game’s ray tracing system must be used. What is ray tracing? Ray tracing is a technique used by game engines to determine whether a line intersects with geometry or entities in the world. A ray is cast from a starting position in a specified direction, and the engine reports the first object it intersects. ...

April 1, 2023 · 4 min · rakitin

Counter-Strike: Global Offensive: Reverse Engineering Valve's P2P Networking System

Overview CSGO’s lobby architecture implements a decentralized peer-to-peer topology, where clients establish direct connections to exchange game state and synchronize player actions. This design exposes the underlying ISteamNetworking interface, which leaks remote peer IPv4 addresses through the P2PSessionState_t structure. This enables trivial IP enumeration of all players in an active lobby. Architecture Analysis Steam Networking Stack CSGO leverages Valve’s proprietary Steam networking layer built atop the Source engine. The P2P system abstracts away NAT traversal through a combination of direct connections and relay servers, exposing the following critical structures via the Source SDK: ...

February 1, 2020 · 6 min · rakitin