Search Unity

Lets talk Competitive Online games and Hackers.

Discussion in 'Multiplayer' started by voltage, Oct 22, 2016.

  1. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    So I've been practicing with Unet for a year now and I feel as though I'm ready to make a commercial online product. Not saying it's going to be great, but I'm feeling optimistic. So with that being said, I'm very worried about hackers. Competitive online communities are plagued with cheaters and they ruin the game. One of recent memory is Reign of Kings:

    http://store.steampowered.com/app/344760/

    Loved this game to death, put 250 hours of gameplay on it - but the hacking is horrendous.

    So, I hear a surefire way to deal with hackers is to change all variables Server side. Does this work for privately hosted servers? I'm not hosting any myself. It sounds like a daunting task based on my current Unet experience, but basically everything must run through a [Command], am I correct? Your info is very much desired and appreciated.
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Use the server for all the logic and the client only to receive input and send requests to the server. Any logic that happens on the client side will be hacked sooner or later.

    For example, the client could check for the Space key being pressed for a jump. The client then sends a 'CmdRequestJump' to the server. The server checks if the player is alive, if he is not already jumping, etc. and then starts the jump. The server then sets a SyncVar like 'jumping' to true. The client then gets notified about it automatically.

    You might need some tricks to avoid the packet sending delay for movement, e.g. client side prediction, rubberbanding, etc.

    If you want to take a shortcut, you can do some logic on the client and protect your client from reverse engineering with packers, virtualization, etc. It all depends on how important your server logic is. In Minecraft it doesn't really matter too much if someone figures out how to walk through walls. In an MMORPG however it could destroy your whole economy. I remember this one game where people used wall hacks to skip a really big dungeon and kill the end boss directly, getting the rarest item in the game every few minutes.
     
    Last edited: Oct 25, 2016
    voltage likes this.
  3. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    Thank you for your insight vis2k. This was very informative and exactly what I needed to see. I hear obfuscating your work rarely keeps hackers outside for long, but worth looking into as well. I suppose I should work on a game less competitive as a first go-around. That way hackers won't matter as much - like you stated with Minecraft.

    A nearly hack proof game could be a fun test project for the future, but for now I want to get something on the market. I'll take your advice.
     
  4. Ziron999

    Ziron999

    Joined:
    Jan 22, 2014
    Posts:
    282
    to put it simply, the more you have server side the more secure it is...but the more bandwidth that is needed too. So it costs more basically to be more secure.