So, I’ve been doing a bit of brainstorming about possible theory about the prevention of aimbot programs. This is theory that may help developers consider ways to avoid aimbotting on their games.
This thought was sparked personally, by experiencing how widespread such programs are in the Clans Community. And it’s understandable, you want to win, you ensure a way of winning. But it then becomes a battle of aimbots and not a fun or engaging fight, this is arguably one reason war clans have stagnated.
Now, one of my lines of thought was, how do they work? They only seem to apply once a tool or weapon is equipped, as from videos I have seen it use the in-game systems. It can be assumed, therefore, that the aimbot is not an exterior weapons system and thus, with some server side checking of client items, it could be possible to prevent an aimbot.
From what I have seen, the use of aimbot manipulates either the camera, in first person games, or the cursor in 3rd person games. This can be relatively easy to pick up by a check. Does the mouse consistently keep homed in on a players body part while moving? I mean, I’m no pro-aimed shooter, but I’d say keeping a constant aim on a body part while bunnyhopping or moving a bit fishy.
This could be identified by having the origin, the target, and the player that is being shot, be part of the RemoteEvent. This is an example of the logic:
Client: I fired a gun, this is the player part I want to damage and this is my bullet end relative to the player part.
Server: Cool, seems alright to me, your previous shot is not the same part.
Client: I fired a gun again, this is the part I want to damage and this is my bullet end.
Server: Okayyyy, you hit the same part, at the same position, dont do this again.
Client: I fired a gun again, this is the part I want to damage and this is my bullet end.
Server: Hold up! this was the same part, at the same position. You had the warning. Ban it!
Server BanScript: Ended them.
While this, at first, seems like a good system, it relies on 4 things:
-
It is the same limb.
-
It is going towards the same position as the last shot.
-
There is movement by the shooter
-
The Exploiter is unaware of the system. (Note, this is only if the checks are server side)
If a gun uses a spread mechanic, issues 1 and 2 this could be troublesome. However, a fix to this is to use another ray to pinpoint the point that the cursor is at, as well as the part the cursor is aiming at, and pass this as another element to the RemoteEvent, and use this instead.
3, is the killer issue. If the target is stationary, it makes hitting the same position of the same limb easier, if both parties are stationary, this makes it, nigh on certain, as long as you have a steady hand. Besides, in hopping backwards and forwards, the position and orientation of the limb changes, how, if its based on the user camera, do we extrapolate the “same visual position” of the limb?
4 is a question of server-client relation, from my understanding the consensus is to NEVER trust the client with anything that can effect other players. But some features are not accessible from the server side. Therefore either there needs to be obscure hierarchy of client checks, or some communication from the client that, if tampered, can prompt server side intervention. In this context, storing such monitored systems would be essential to avoid easy identification. But even if it is found, and a workaround created, it could be argued that the aimbot would therefore have to have a specific edit in place for that place.
Another avenue regarding the prevention of aimbots is keeping track of the player mouse, in theory, an organic player has to manually move the mouse, and is likely to trigger many changes in its properties in moving to its destination. Creating a magnitude check system for a mouse could be used to monitor if a player is rapidly switching from player to player, this can also be used in both third and first person games! For third person, its detecting jumps from one point to another on the entire screen, whereas for first person you would only need to calculate shifts from objects shown on the screen to the middle of the screen.
A third possible, and tried method of preventing aimbots, is to write your own camera control script. And to add checks to ensure that organic and legitimate movement is used. After all, having the camera snap to a particular point without it being coded to be able to do that is definitely behaviour that could be indicative of aimbotting.
This is the current composition on the matter, from the replies and my interpretations of scenarios posted, and is by no means conclusive nor is it neccessarily accurate, it would be best to read the replies and interpret them yourselves. If anyone else has other useful logic/code/ideas in regards to this, or even solutions to queries and thoughts in the replies, I am fully open to editing this post for the forseeable future, to help you protect your game.