2

I want to know, is there any way to detect within our game against speed hack applications like game guardian?

I searched all over the internet but I didn't get a satisfying answer.

pyknight202
  • 1,415
  • 1
  • 5
  • 22
iman_sh
  • 420
  • 1
  • 8
  • 22
  • You should make general anti-cheat like: detecting debuggers, creating threads, loading dlls, detecting memory change from external process etc... – Segy Dec 02 '18 at 16:47

4 Answers4

5

The solution is not more software on top. The solution is not being vulnerable to this from the start.

Example:

If you allow your users to send your server their coordinates on the world map ("I am the blue player and since I moved my full allowance, I'm now at 156/467"), it's trivial for somebody to write a teleport cheat. Just send different coordinates, boom teleported. Kids play.

If you only allow your users to send messages of intent to your server ("I am the blue player and I intend to move my full allowance in the direction of 156/467") and let your server figure out what that means (is the player allowed to move, what is his allowance, how far will the blue player get in one unit of time) and send the result back, you will never have that problem.

Do not trust client input. First rule of video game security: The client is in the hands of the enemy.

There is little point in shoving more and more software on top of your client if you keep trusting your client. Just stop and design your game so the client can send intent and the server determines outcome.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • 1
    "Do not trust client input" applies not only for games but for all possible types of applications. If there's a way for something to break, users will certainly find it. Intentionally or accidentally. – tsvedas Jul 24 '18 at 13:53
  • so in this solution, server must check all players position and calculate their movement and it is very expensive for server performance ! @nvoigt – iman_sh Jul 24 '18 at 15:28
0

It depends on your game, but you can try detecting speed hacks by simply checking player position every frame.

  1. Determine maximum possible move distance per second and put it in constant, so that the player wouldn't be able to change that at runtime.
  2. Cache current position.
  3. On next update, check the distance the player travelled and multiply it by the Time.deltaTime.
  4. If the player travelled more than maximum allowed, the player must have cheated.
  5. Return to step no. 2

It will be framerate independent checking as you will be using maximum allowed distance per second.

tsvedas
  • 1,049
  • 7
  • 18
  • Tank's for answer but i tested this way before and it is not the solution. the calculation of movement player when he hacked or not is same ! and game can not recognize it unfortunately. in this way they are hack device time i think . – iman_sh Jul 24 '18 at 15:20
  • This not work. Because time is hacked. So this calculation look like proper, because game time not same as in real world. So you need external timer which can not be spoiled. – Enyby Aug 14 '18 at 21:25
  • This isn't sufficient as packet loss, and latency allow for single frames where perhaps 2 packets come in at the same exact moment and show near infinite speed. False positives will happen a lot. – Rusty Parks Feb 08 '22 at 15:06
0

If the server has all player positions at all time and your problem is with speed hacking the solution is not that hard (assuming player position is being sent to server constantly).

Please do the following, first before updating player position check if the distance between current position and old position isn't too big

  var distance = Vector3.Distance(old.position, currentposition);
if(distance<=alloweddistance)
...

and if it is avoid updating position\set player to old position\kick player. A better solution to even that, is to not allow players to send their current position to server, rather send direction they are moving and speed. The server should change their position with the direction and move speed, not client.

SpoocyCrep
  • 604
  • 7
  • 23
0

I found Solution for my own project that is online multiplayer and it works for any online game.

For solving this problem just we need to calculate time in server. for example we can use stopwatch and doing this in client side... and in an specific situation we can compare them over network and if there was any difference between them, (some thing like more than 3 second) then becomes clear that player is used speed hack.

I tried this method in my game and it works fine.

iman_sh
  • 420
  • 1
  • 8
  • 22