Anti-cheats are a lie, they don’t belong on your computer, and I’ll prove it in this 10min read

I have gathered from many sources and many game developers, including myself, what the supposed purpose of anti-cheats, how it’s implemented, and how it should actually be implemented. This is regarding the client-server networking model for multiplayer games.

The following will be discussed:

  1. How it looks
  2. What it means to cheat in a multiplayer games.
  3. Why is almost every multiplayer game implementing anti-cheats THE WRONG WAY
  4. What anti-cheats actually look like
  5. The solution and examples

CLIENT = the player, on their own computer, using their own copy of the player-side of the game SERVER = hardware game server used to host some parts of the multiplayer side, depends on the implementation of multiplayer CHEATER = the CLIENT who manipulates or otherwise exploits their own side of things, their own computer, on which the game and anti-cheat reside. HACKER = the person, who used many skills to illegally infultrate the SERVER, and therefor have (probably UNLIMITED) access to everything that’s on that SERVER, including everything game-related.

1. How an anti-cheat looks like in most games In most multiplayer games, an anti-cheat looks like this: an entirely separate software on the CLIENT’s computer, that checks the computer, the game for any changes in number of sophisticated ways, but this is a very bullet-prone vest, and it’s proprietary, it can’t even, really be open source.

2. What it means to cheat in a multiplayer games. This means bypassing the anti-cheat (if any) and editing variables or functions in memory to whatever the CHEATER wants to. How can a CHEATER - a player, in a multiplayer game even influence the entire game that is hosted on another computer (SERVER)? The simple answer is - they can’t. They don’t affect their abbilities and entire multiplayer game on/from the SERVER, they do it ON THE CLIENT, on their own computer!! How can that even be possible?

3. Why is almost every multiplayer game implementing anti-cheats THE WRONG WAY I don’t know, they dumb? Perhaps they don’t how programming works? Or they just think that’s how it works and they don’t question it or they’re ordered to do it the way everyone else does?

4. What anti-cheats actually look like Anti-cheats should just be what they’re meant to do: prevent any CLIENT from exploiting the game, in other words: stop the CLIENT from changing the values which they shouldn’t have power over in the 1st place! The actual anti-cheat isn’t some separate proprietary piece of shit program, it’s the way the entire game is implemented and logic that checks I/O.

A multiplayer game in a CLIENT-SERVER networking model (not peer-to-peer, for example) which is what most games are using - should be doing this: Since the SERVER wants the game to be fair and for all CLIENTs to play according to SERVER’s rules (think of walking speed, the weapons you have, your health, etc.), the SERVER in this networking model HAS TO be authoritive. The SERVER HAS TO dictate to every CLIENT what they should do, not the other way around.

5. The solution and examples In the past and sometimes even today - without a game engine, the developer had to implement their own networking for the game to get maximum performance out of it, have it customized the way they want to, or game engines simply didn’t exist yet. This was done by serialization and deserialization of data received by CLIENT/SERVER, the 1st variable extracted was usually the number, which was then correlated with a list of functions - each function was assigned a number.

None of that is necessary today, really, because some game engines have good implementations of networking (such as Godot, I think).

Okay, how about we make a few examples which will be the solution: So let’s take movement and rotation of the player for example: var position: Vector3(x, y, z) and var rotation: Vector3(x, y z)

The way CLIENTs walk around a map isn’t by telling the SERVER where they’re at, it’s by spamming the SERVER with inputs from the user (WSAD, mouse). Then the SERVER decides many things actually, before doing anything with that information:

  • is the CLIENT a legit connection and stuff?
  • is the CLIENT sending a number that correlates with any function (if custom networking implementation)?
  • is the CLIENT sending data that’s of valid type and value?
  • is the CLIENT alive?
  • is the CLIENT allowed to move? ( the following can be implemented in various ways, this is one of them )
  • okay, then move CLIENT that’s a copy on the SERVER, in that direction at the speed and velocity the SERVER dictates *this already eliminates possibility to teleport, speedwalk and clipping trough walls and the entire map
  • anything that the CLIENT collides with, run corresponding collision logic, triggers, signals, etc.
  • send the new position and rotation and exact time to ALL CLIENTs
  • the CLIENTs interpret this new message at that exact time, then CLIENTs can use interpolation and extrapolation to smoothly move and rotate to the new position and rotation directed by the SERVER (not the CLIENT)

This is uncheatable if done correctly. You know some of world biggest and most expensive games such as Battlefield 6 still don’t understand this. This, what you read, is worth more than the entire worth of Battlefield which is probably many millions of $$$. Why instead not create a better game?

Even AAA games such as Battlefield 6 don’t do this, they have anti-cheat spyware they put on your computer, just like most games do.

You can follow a game I’m creating, it will not be some slop put together under a overlord boss at a evil slave corporation, here: https://blorpblorp.xyz/home/c/my_life_game@lemmy.dbzer0.com

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    4
    ·
    7 hours ago

    This post is nigh unintelligible, but I think the tl;dr is that you should only need to validate what the client tells you.

    Which is incredibly naive. How do you identify wallhacks server-side, for example?

      • frongt@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 hours ago

        Fair enough, if you want to do all those visibility calculations on the server side all the time.

        How about highlighting? For example, Counter-Strike, where a barely-visible character might be off in the distance, in shadow, or behind a smokescreen. How do you prevent a malicious client from highlighting a teammate in blue or an enemy in bright red?

        • Voytrekk@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          4
          ·
          4 hours ago

          Not to mention footsteps or noise that they can make off screen. The server needs to be able to tell the client which direction the sound is coming from so your audio device can process it.

          • frongt@lemmy.zip
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 hours ago

            Few systems support true directional sound, so you could get close enough with “footstep 60% volume in the left channel, 10% in the right”.

            Again, if you wanted to do all those calculations server side. It’s expensive enough doing it for one, but in a large deathmatch?

  • CameronDev@programming.dev
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    1
    ·
    9 hours ago

    Sending player inputs over the network would use a lot of data, and make the server do significantly more work.

    Latency would make server side movement horrible to play on, any dropped packets would cause the player to not move. You’d also have issues with handling late packets.

    Server side movement also doesnt solve wall hacks/esp, unless you want to render every client to determine what they can see before sending the player positions to each client. Also doesnt solve trigger hacks, or any modern aim assist that moves the mouse in a sane way.

    There is a reason this isnt done server side, its not as simple as you think it is.

    • tabular@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 hours ago

      To avoid man in the middle attacks we should first encrypt those inputs. A server could also be cheating, so each client should verify each other’s clients’ positions.

      • CameronDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        6 hours ago

        Encryption further adds latency,degrading the experience even more. And mitm attacks are still very possible, you just drop the traffic, or route it poorly

    • missingno@fedia.io
      link
      fedilink
      arrow-up
      5
      ·
      9 hours ago

      Sending player inputs over the network would use a lot of data, and make the server do significantly more work.

      Inputs are very little data, literally just a few bytes per frame. And many game genres are already doing this, look at rollback in fighting games for example.

      • villainy@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 hours ago

        Delay and rollback are both examples of client-side prediction which has been a core component of any fast paced online game since Quake 1/Quakeworld. Pushing that to the client-side allows online games to work with internet latency at all but also makes client-side cheat detection more important.

        • missingno@fedia.io
          link
          fedilink
          arrow-up
          1
          ·
          8 hours ago

          By having each client calculate the game state independently, any attempt at cheating simply results in a desync.

      • CameronDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 hours ago

        Then you wrap those inputs in headers and it adds up. There is 16ish mouse movements between two frames at 60fps, for a 1000hz mouse. And in OPs model, every one of them needs to go to the server for validation. Compared to sending the players current location and view, ~16 mouse inputs plus a couple of keyboard inputs each frame is going to be a lot more traffic.

        Fighting games are typically 2-5 players right? So completely different scale to a 64+ player server, they can get away with doing things differently.

        • missingno@fedia.io
          link
          fedilink
          arrow-up
          1
          ·
          8 hours ago

          If you’re calculating sub-frame inputs, those can be batched. Even if we multiply a few bytes by 64, that’s still not much.

          • CameronDev@programming.dev
            link
            fedilink
            English
            arrow-up
            3
            ·
            5 hours ago

            Batch the inputs breaks OPs anticheat, the server has to tell the client what the result of every input was. So if you batch them up, the client is frozen until the server responds, and for mouse inputs that would result in crazy rubber banding.

            And if your gonna batch them, why not just send the resultant new location? The server can still validate that the position hasn’t moved too far

            • missingno@fedia.io
              link
              fedilink
              arrow-up
              1
              ·
              4 hours ago

              As long as each input is timestamped, rollback can work the exact same way it does in a 60fps game, the actual tickrate doesn’t matter. There’s no need to freeze either, the point of rollback is to run ahead independently.

    • Gigatron@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      8
      ·
      9 hours ago

      I just literally disproven the necessity of anti-cheats even being on your computer. Every other game is just ignorant about this. I’m sorry

      • terabyterex@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        edit-2
        9 hours ago

        No you didnt. You have a gross misunderstanding of 1)how multiplayer games work and 2) how cheating works.

        So, one popular cheat is to highlight where other players are. This has nothing to do with talking to the server at all. You can have your client not render any walls so you can see through everything.

        Heres another. The client automates everything. Bullet comming your way well you step to the side. Your client tells rhe server you mkved last second to dodge it. Server tells client that the player you are shooting at is moving right, ok now lets move the cursor to the right and shoot. Thats called auto aiming.

        • CameronDev@programming.dev
          link
          fedilink
          English
          arrow-up
          6
          ·
          8 hours ago

          OPs solution protects against a single type of cheat, movement speed/teleportation. Its also the only cheat that no one actually uses…

  • MagicShel@lemmy.zip
    link
    fedilink
    English
    arrow-up
    3
    ·
    9 hours ago

    Way back in the day, games used to be peer to peer with one acting as server. Being the client sucked because you would warp all over the place as your computer anticipates following your key inputs, but it finds out 400ms later that those commands didn’t make it to the server in the same time and order. You run towards a gap and leap over it and keep runn— nope you fell down the cliff and died. You sneak up from behind and knife the enemy from stealth— nope, you’re done some kind of dance in front of— nope he killed you three seconds ago.

    Making all players experience the client side of this just leans the game sucks for everyone. You would not have AAA games because they would all suck for multiplayer.

    I’m against anti-cheat but my solution is just not to play games that require it.