[Plugin] AntiAimbot - Artifical Intelligence

Started by Kalcor, SA:MP, Aug 08, 2023, 07:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kalcor, SA:MP

[Plugin] AntiAimbot - Artifical Intelligence

AntiAimbot



Version: E1 (experimental version)



DISCLAIMER:

- the plugin is still experimental and has undergone rigorous testing on artificial servers but hasn't been tested on a real server with a large player base

- works for M4/AK47/MP5 only



AntiAimbot is an aimbot detector which uses a combination of empirical methods and artificial intelligence to accurately identify players using any form of aim assist. Empirical methods such as high ratio on moving players are used to efficiently suspect players of using aimbot. The samples of players suspected of using aim assist tools are forwarded to a combination of AI machinery consisting of mainly deep neural networks and support vector machines for further detailed analysis. The AI machinery investigates the samples and decides if the feat achieved is humanly possible or not by analyzing how quickly the aim moves, how synchronized the aim was with the motion of the victim, how fast the player reacts to changes and many such features.



Overview:



The entire process can be divided into two sections based on the type of technology used: empirical methods and artificial intelligence methods. The empirical methods are used to quickly suspect the possibility of an aim assist software being used while the artificial intelligence based methods are used to analyze the suspected samples more rigorously.



The AI-based detectors are trained to identify possible use of aim assist accurately when possible, i.e. they give negatives when they aren't sure. Given enough time, they will mostly detect the use of aim assist.



Usage:



building plugin from source (Linux):
  1. install gcc-8, g++8, gcc-8-multilib, g++-8-multilib, cmake

  2. clone the sampml repository

  3. change directory to `examples/anti-aimbot/plugin`

  4. create and enter `build` directory

  5. generate build files using `cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8`

  6. build plugin using `cmake --build . -- -j <number of threads>`


building plugin from source (Windows):
  1. clone the sampml repository

  2. open `examples/anti-aimbot/plugin` directory in Visual Studio 2017

  3. click on CMake->Build


installing:
  1. move the plugin binary to the `plugins` directory

  2. create a new directory `anti-aimbot` in the `plugins` directory

  3. create a new directory `models` in `plugins/anti-aimbot` directory

  4. copy three model files from `examples/anti-aimbot/training/models` to the models folder

  5. [optional] create config.cfg in the `anti-aimbot` directory


configuring the plugin:

namedefaultdescription
thread_pool_size 4number of threads that can be used for detectors
rf_model_fileplugins/anti-aimbot/models/rf_classifier.datnumber of threads that can be used for detectors
svm_model_fileplugins/anti-aimbot/models/svm_classifier.datnumber of threads that can be used for detectors
dnn_model_fileplugins/anti-aimbot/models/dnn_classifier.datnumber of threads that can be used for detectors

Example `config.cfg`:


Code:

thread_pool_size 2
dnn_model_file plugins/anti-aimbot/models/dnn2_classifier.dat

submitting a shot vector:




Code:

stock CollectDataOPWS(data[E_SHOT_VECTOR], playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
native submit_vector(playerid, data[E_SHOT_VECTOR]);


Code:

#include <aimbot_dc.inc>
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
        new data[E_SHOT_VECTOR];
        CollectDataOPWS(data, playerid, weaponid, hittype, hitid, fX, fY, fZ);
submit_vector(playerid, data);
  return 1;
}

obtaining results:




Code:

forward OnPlayerSuspectedForAimbot(playerid, Float:probabilities[3], time[3]);


Code:

#include <aimbot_dc.inc>
public OnPlayerSuspectedForAimbot(playerid, Float:probabilities[3], time[3])
{
    /* results are sent after a few seconds; hence, check if the player is still connected */
    if(!IsPlayerConnected(playerid))
        return 1;

    static enum {
        COLOR_RED = 0xFF0000FF,
        COLOR_GREEN = 0x00FF00FF,
    };

    new str[144], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));

    /*
    ** there are three independent detectors
    ** - random forest
    ** - support vector machine
    ** - deep neural network
    **
    ** `probabilities` contains the outputs of the detectors in the aforementioned order
    ** `time` contains the CPU microseconds used by each of the detectors in the aforementioned order
    **
    ** the average of the probabilities can be used to get an overall estimate
    ** choose a cutoff above which the result is considered to be an aimbot sample
    ** the code below sends a message for all samples
    */

    const Float:cutoff = 0.6;
    new Float:avg = (probabilities[0] + probabilities[1] + probabilities[2])/3;

    format(str, sizeof(str), "%s(%d) >> RF: %.2f (%dus) SVM: %.2f (%dus), DNN: %.2f (%dus)",
name, playerid,
probabilities[0], time[0],
probabilities[1], time[1],
  probabilities[2], time[2]);
 
    new color = ((avg > cutoff) ? COLOR_RED : COLOR_GREEN);
    SendClientMessageToAll(color, str);

    format(str, sizeof(str), "Average: %.2f (%s)", avg, ((avg > cutoff) ? ("MOSTLY USING AIMBOT") : ("MAY NOT BE USING AIMBOT")));
    SendClientMessageToAll(color, str);
}

Links:

GitHub Repository



Contributing & Support Requests

discord server for:

- research & development

- support requests

- contributing



[outdated] Detailed Demo (18th December 2018)

- the latest version is significantly more accurate than the results shown above

Source: [Plugin] AntiAimbot - Artifical Intelligence