Anti Aimbot??

I’m making a 2D top down shooter(birds view).
The player always faces the mouse cursor.
How can I prevent someone from using/making an aimbot for my game?

I know the hacker can also use dll injecting, is that preventable?

Not without extensive and intrusive checking of the computer. If you inject your own OpenGL .dll into the game you can figure out the XYZ positions of each player from their draw calls. It’s then just a matter of sending mouse input to aim at the enemy players. None of this is easily detectable.

You also might want to take a step back and really decide whether this is really a problem that’s worth your time.

Are people actually using aimbots in your game? Are people playing your game? Is your game finished?

Every hour you spend on this is an hour you don’t spend on actually finishing your game, or polishing your game, or making your game fun to play.

It doesn’t matter if you build Fort Knox, if you don’t have any gold worth protecting.

Even if you have a virtual Fort Knox…is its gold worth protecting?

To extend the previously asked question a bit… does it matter?
From your very little description I assume that your game is either singleplayer or small scale multiplayer.
Do you think that there should really be intervention by the developer at that scale?
If people play the game alone - what do you care about what they are doing? They can only ruin the game for themselves.
If we are talking about the other option, I think it is still better to rely on people to just not play with other people who they realize are cheating - instead of forcing your own rules into everything.

I agree with others about doest it is worth it or not?

Anyway, to answer the first question, well maybe you can try to be creative.

Let’s assume a standard (quake3 style) type of gameplay.
Maybe the server can send to a given player, a fake position of any other player. From client side, the faked client must look 100% legit (so a computer, and a player will see it as a real player).

Now let’s say the faked client is out of view of the player (like behind a wall, or directly behind the player).
Well, a real player will not fire at it, but most of simple aimbots will…

Just be creative. As creative as hacker will be :wink:

You’d be better off being creative making a fun game.

+1 focus on your game.

Having cheaters play your game is a kind of a milestone. You’ll have enough time to think about that when your game will be actually released.

you could check and see if the player’s constantly aiming through the exact same spot on the other player.

  • Step 1: Compile player stats and make them visible to all other players (Accuracy, kill ratio, etc), so superhuman stats stand out.
  • Step 2: Implement a player banning system, be it through popular vote or server admin intervention.

Those things should already be part of your standard development, are easy to pull off anyway, and allow the community to police themselves.

@Oskuro but this is also a bit dangerous… In Crossfire (Free To Play MMOFPS) there is a Gamemode called Ghost Mode. The terrorists in this mode are invisible but you can hear them. Most players did not know how well you can hear them (you can easily aim on them only cause of their sound) and therefore kicked soundplayers…
So ofc it is good to give the community the chance to kick others, but the community often abuses this right…

For a less complicated detection system, you could calculate how off shots are, calculate the standard deviation of this, and say if shots are on average 0.001 [blank] off, with an extremely low deviation, you’d think only a bot could aim that well.

Yeah I know, back in the day when we used to play Return to Castle Wolfenstein in the college dorm, one of the guys had found that, if he managed to keep his score high (by doing mission tasks without actually completing the mission), other players would never vote to kick him out, so he was free to be an asshole and drop airstrikes on his unsuspecting teammates, and whenever another player would criticize him, he’s start a vote and that other player would get banned.

Anyway, anecdote over.

Any system to prevent cheating will have its downsides. The advantage of community voting is that is has low impact on program development, the disadvantage, as mentioned, is that most people are dicks.

So it’s, as usual, a balancing act.