OBS plugin for Overwatch enemy detection using OpenCV and CUDA.
- Detects enemy hulls in 1.3 - 3.0 ms.
- Detects enemy polygons in 2.1 - 6.1 ms.
At 120 FPS, the total delay between mouse movement recognized by the system (DirectInput) and new enemy positions recognized by the plugin ranges between 1.3 and 14.4 ms.
This is a hobby. I write cheats for games once every few years.
Usually, there are two types of cheats.
-
Internal - when the game process is hooked and executes your code.
An example for CS:GO can be found here. -
External - when the game memory is read by an external process.
An example for Overwatch that uses a system driver can be found here.
There are ways to detect both approaches, even if anti-cheat software fails to do so.
This project falls into a separate category that uses image processing to detect enemies on the screen and external hardware that simulates a mouse for input.
Detecting this solution without limiting the use of legitimate software like OBS is much harder and nobody has done this yet.
Short summary of what this plugin does.
-
Registers itself as a filter plygin in OBS and receives captured frames.
-
Converts each frame to the HSV colorspace.
-
Searches for colors that match enemy outlines and copies the data to system memory.
-
Uses CUDA to mask and remove pixels that are likely player names, special effects, etc.
-
Uses OpenCV to detect the remaining outlines as contours.
-
Groups contours that likely belong to the same target.
-
Creates convex hulls as target representations.
-
Uses CUDA to reduce the hull shape until it roughly matches the outlines.
-
Creates polygons as target representations.
Hitscan characters with a narrow weapon spread use target polygons.
Hitscan characters with a wide weapon spread use target hulls.
This is a simple demo and many things can be improved. The following features will be added in the future when I have time.
- Filter out world ping icons.
- Use names and health bars to group contours.
- Track targets and their movement in 3D space.
- Train a neural network to categorize the targets.
- Calculate distance based on target category and polygon size.
This software is fully compliant with German law.
No reverse enginering, inspection or modification of commercial software was performed during the development and operation of the software.
The published code only demonstrates methods and possibilities of high performance, low latency image recognition. The mouse input injection code is private and won't be released.
This software cannot be used to gain an unfair advantage in a competitive game.
This project will be deleted if I move to a different jurisdiction.
This repository exists for demonstration purposes only. Build instructions are for the author's convenience.
- Install OBS-Studio to
C:\OBS
. - Extract OBS-Studio source code to
C:\OBS\src
. - Install CUDA Toolkit to
C:\CUDA
. - Install Python 3.
- Install Conan.
pip install "conan<2.0.0"
- Install Visual Studio with C++ and CMake support.
- Clone project. Use
x64 Native Tools Command Prompt for VS 2022
.
git clone git@github.com:qis/horus C:/OBS/horus
cd C:\OBS\horus
git submodule update --init --depth 1
- Install dependencies.
conan install . -if third_party -pr conan.profile
- Build OpenCV in
x64 Native Tools Command Prompt for VS 2022
.
cd third_party\opencv
cmake -B build --preset default
cmake --build build --target install
copy release\x64\vc17\bin\opencv_world470.dll C:\OBS\obs-plugins\64bit\
Configure OBS-Studio and Overwatch according to settings.md.