Search Unity

Sacrificing features due to hacking/botting concerns

Discussion in 'Multiplayer' started by jc_lvngstn, Oct 29, 2014.

  1. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    First: Thank you UT for creating this forum! I hope it greatly adds to the community!
    Second: I hope this is the appropriate question to ask here :)

    So, in a personal project I'm working on, the server has the final say on many things, especially simple collision detection. Probably like most online games. The default Unity collision detection is handled on the client side, but the server can verify the "core" stuff due to the way things are laid out in the game.

    Client side collision handling for the most part, server handles the narrower, important stuff.
    Let's pretend it is Assassin's Creed. It's not anything like that, but it is a good example. You have basic player movement on the ground, fine. Now, you realize you can add player climbing up buildings. What an awesome feature!
    But it's an online game. How the crap do you verify what is and isn't legitimate movement for players, especially when bots try to cheat by flying you through the air. That sort of thing can ruin a game. If you are thinking "well, I would just allow limited player movement around a block, within X height" then please realize it's not buildings. The movement is much different than that.

    However, I don't see how I can do this without giving the client a LOT more authority over player movement. The server can handle the basic structures, but being able to climb these "walls" would probably involve a LOT more sophisticated collision detection and handling that I may be able to muster. I would love to have this feature...but I don't see how I can do it without giving hackers/bots so much say that it destroys the game. If it were as simple as walls, this probably wouldn't be an issue.

    I've been trying to think of a "balanced" approach. Maybe not catching every thing bots may try to get away with, like being able to completely control player movement, flying, etc. But, maybe I can come up with a "pretty good" approach that covers most situations. I just hate the thought that I might allow something, for this feature, that takes away from the credibility of the game.

    Any suggestions, advice on approaches that you might take on this?
    Thanks all!
    JC
     
    randomperson42 likes this.
  2. nongaming

    nongaming

    Joined:
    Apr 30, 2014
    Posts:
    6
    ill preface this by saying i really dont know anything and this is just how i would go about playing around with it.

    if the player was climbing a wall i would cover the wall with a trigger or series of triggers that would be handled switch a bool or something on the sever?

    for leaping i would do much the same but only on interaction points and it would trigger a timer before checking if grounded or hacking?

    again i dont know how this would work in practice but its how i would start playing with the problem. pretty new to game design and programing so just guessing from what i think i know :)
     
  3. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    This is a good topic for the Multiplayer Networking forum. Consider checking out this thread. Then, feel free to shift your focus and resubmit as a game design question.

    Good luck,
    Gigi
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If you ever get to the point where your game is popular enough to be hacked and botted, then you will have more money than sense to solve it.
     
    Gigiwoo and Brainswitch like this.
  5. nongaming

    nongaming

    Joined:
    Apr 30, 2014
    Posts:
    6
    thats a pretty halfass response from a mod :p lol


    dont worry about hacks ect just wait till its a problem that ruins your game for others potentialy killing it then throw money at it :D
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Really? I thought it was pretty accurate.
     
  7. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    My comment is below this reply, please read it @OP

    I am going to deny your argument, there's smaller games out there that have hackers left and right, and the developers aren't making a penny on them, because the hackers got there before the revenue did. This kills the player base and puts a big red flag on your game.

    Your reply was also irrelevant to the question being asked.

    ----------------------------------------------------------------------------------------


    The way I would personally handle this would not require any more authority to be given to the client, however would require a little more resource usage on the server side, I don't know what you use for a networking solution, but all of my games have always used a in-house 3rd party server that I wrote myself, this being said it doesn't have access to the GameObjects inside of the Unity Scene. I'm sure you'll be able to translate this to your own server, however.

    Basically what I would do when it comes to things such as climbing a ladder, or anything like that, and I wanted to validate it over the server I would first tell the server where all of the positions are for the objects that I can climb up, or down, or whatever. I would then send a special op-code over the network whenever my character was moving upwards due to climbing as well as an ID of the building that you're climbing, opposed to a jump. (You don't have to do this, not doing it will save bandwidth, but you'd have to do more logical checks on the server side).

    Note: Keep in mind that it's always ideal to have things such as a movement speed ( in this case, climbspeed ) variable set on the server.

    Once you receive the packet that states that you're climbing up the building, do some logic on the server-side that does the following:
    1. Checks the player's current position versus the objects position for the ID that you passed through the network using vector math, you would have to have a numeric constant that would serve as a type of leniency for the player, such as (Check to see if the player is anywhere between 5 feet away from the object) this would return a boolean value.
    2. If the boolean value for the distance check is true, you would simply update the players movement over the network like normal, however if it was false you would set the client back at the position he was before he tried moving upwards. This is known as the "Rubberband effect."
    If you'd like an idea of how I would set up the objects here is an example using an OOP approach. (This is Java)

    Code (CSharp):
    1.  
    2. List<Climbable> climbableObjects = new ArrayList<Climbable>();
    3.  
    4. public class Climbable {
    5.    private int objectId;
    6.    private Vector3 position;
    7.    private int height;
    8.  
    9.    public Climbable(int objectId, Vector3 position, int height) {
    10.      this.objectId = objectId;
    11.      this.position = position;
    12.      this.height = height;
    13.    }
    14.  
    15.    public int getObjectId() {
    16.      return objectId;
    17.    }
    18.  
    19.    public int getPosition() {
    20.      return position;
    21.    }
    22.  
    23.    public int getHeight() {
    24.      return height;
    25.    }
    26. }
    27.  
    28. climbableObjects.add(1, new Vector3(0, 0, 0));
    29.  
    You can even go as far as checking the height axis of the player while he's climbing, versus the objects height that he's climbing, so players can't trick the server into saying they're at Y 500 opposed to the top of the object which is Y-20

    Hopefully this comment helped, let me know.
     
  8. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks for the input. I realize the project may never see the light of day, but it's an interesting problem (to me). I'd like to know more about different approaches. Also, I am using my own networking for now, just a fairly simple implementation of sockets in .Net.
    So, if it were a building or a ladder, I could detect player climbing inside the volume of space that it occupies. But what if it's a very irregular object, like a theme park roller coaster, or a giant statue?

    When the player is on the ground, collision is very simple. However, when the player is above ground, it gets more complicated. I've thought about taking an approach like this:

    First, the player must be within a volume of space surrounding the object. If the player isn't, no above ground climbing allowed. If the objects weren't so irregular, I could just stick with this.

    I could create volumes inside the main object volume, like sub-colliders, that the player has to be inside to move around above ground. I may be able to get by with one main volume, and 4-5 smaller volumes inside. This may be "good enough", I'm just concerned about performance. But...honestly, I could have a separate thread that does nothing but check player collision. Hmmm.
    So that sounds like a decent compromise, what do you think?
     
  9. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Oh, quick question. To me, this is not so much about networking or physics, as it is how to design multiplayer gameplay with somewhat complicated collision detection, and how far to go with that to avoid botting but keep the game playable. So...it does seem to be to be more about design, do you not agree? I'm just trying to understand better how to have questions appropriate to this forum.
    Thanks!
    JC
     
  10. atrakeur

    atrakeur

    Joined:
    Jun 14, 2011
    Posts:
    134
    You want to do some creative gameplay things? So let's get creative about anticheat techniques that suit your game!

    One quick example: let's imagine how to caught aimbots in an typical FPS?
    Simple: just make the server spawn a fake player just behind the player, or behind a wall, or in an unaccessible area. Make it so that the player can't see it normaly, but make it look like a real (and shootable) player from the machine pov. If the player shoot at it, then it's probably a cheater.

    Now take 3-4 of this sort of techniques. Test them on each player individualy and randomly. Then when the player trigger one "trap", just increment a counter. When the counter is higher than some arbitrary level, take screenshot, report, or do whatever else to take it down (ie: not just kick it).

    Hackers are creative, so let's be creative to fight them! Don't just stay at the "dumb" anticheat level. And make the cost to cheat (pre-cost like hacking technique reseach, and post-cost like blocking accounts) so high that it isn't worst it.

    Good luck.