Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity3D and Cheat Engine

Discussion in 'Editor & General Support' started by sultanwalid, Jun 28, 2011.

  1. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    Hi All,

    We just created a small AdverGame for a Brand on Facebook so that's mean : WebPlayer.
    It's an FPS where you have to kill the maximum of flies and mosquitos in 1 minute. You can also have a extra time by shooting a Bonus object spawned randomly.

    Everything was ok till we found some enormous Scores, we thought on a SQL injection or something like that. But in the end it was due to Cheat Engine.
    Simple :
    - Open the game on the Browser
    - Search for the browser process (or the plugin container for Firefox)
    - Enable Speed Hack and slow down the process

    Our scoring system is based on :
    - Amount of killed flies and mosquitos
    - Accuracy
    - Played time

    So you can imagine that with 5fps you can kill everything and have an accuracy of 100%

    Do you have any solution for that ?

    Thx for the help,
     
    Last edited: Jun 28, 2011
  2. saymoo

    saymoo

    Joined:
    May 19, 2009
    Posts:
    850
    Remove the enormous scores, which are not possible in the timewindow played.
    Also warn the user, about this activity being not tolorated.
    If user continues, ban account based on ip address and account name.

    You could program in a hit detector, if more than x hits are 100% without one blank shot (miss), it might indicate a cheat being running on the background. Once the detector thresholds the max amount of 100% hit, end the game on the client, and remove stored scores for that client.
    (thresholds on various game elements during play is done by many anti cheat techs, the tech looks for patterns of gameplay and such things.)

    Also
    Maybe you could check (don't know how btw), for plugins active, and disable them.. or won't allow playing with a certain plugin/addon active.
    (triggered through javascript check?, dunno)
     
    Last edited: Jun 28, 2011
  3. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    We already removed all the Enormous Scores and all the scores with 100% of accuracy.
    thx for the answer but a "code" aswer will be better.

    Thx anyway
     
  4. ar0nax

    ar0nax

    Joined:
    May 26, 2011
    Posts:
    485
    hmmm chek Time.deltaTime and Time.time for each frame.

    if Time.deltaTime << Time.time(current frame) - Time.time(from previous frame) or something similar.

    PS: new to unity and I am not sure this will work since the webplayer is running in the plugin container of firefox, and maybe even Time.time will be slowed down with that hack, but this might be a start.
     
    Last edited: Jun 28, 2011
  5. spinaljack

    spinaljack

    Joined:
    Mar 18, 2010
    Posts:
    984
    You can check for consistent fps and make fly movement based on real time so that low frames don't affect fly speed
     
  6. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    Already Done, in fact Cheat Engine affect the Process of the browser and not the game it self !
     
  7. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    The problem exist in all the unity webplayer Games !!!
     
  8. i3DTutorials

    i3DTutorials

    Joined:
    Aug 26, 2010
    Posts:
    564
    Have you contacted Unity Tech and ran this by them? This is a very serious problem, and I'm surprised there aren't more topics about this on this site.
     
  9. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Didn't know cheat engine affects so many game. And i just googled and i found out that detecting cheat engine is not that easy and i think they would have their own in-house programmer think of something to counter this because web-games (flash/unity) do no have build in cheat engine detection so you do need to perhaps like what the rest suggest check which player gets 100 percent in such short time and ban their ip and run them not every second but maybe after every game.
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    cheat engine stuff works by a before and after thing, if you set a boolean then update the score at a random point after, it may be able to beat that sort of behaviour.
     
  11. cannon

    cannon

    Joined:
    Jun 5, 2009
    Posts:
    751
    The only way to get around time hacking is to have an external reference point for time.

    Have your web server output the current time (or use NTP if you have a library availble). At the start of your game ask the web server for the time as well as locally storing it. Before you submit the score, compute what you think is the elapsed time locally and ask the web server for the time again, and see if the two times are approximately equal. Any deviation greater than 15% is highly likely to be due to a cheat.
     
  12. cannon

    cannon

    Joined:
    Jun 5, 2009
    Posts:
    751
    Probably a more effective idea than warning the client about cheating:

    1) If a cheat is detected during submission, set a local flag that the client is cheating
    2) Submit the score, but flag it as a cheat score
    3) When retrieving scores, send an extra flag if the request is from a cheating client; for cheaters, send the entire high score table. For normal players, remove the cheaters' scores

    This way, cheaters will think they've cheated when they check the scores, while normal users will be totally unaffected.

    Plusses:
    1) Harder for cheaters to ensure that their cheats are actually working and undetected.
    2) When cheaters brag to normal users about their scores, normal users will check the high score table and not find them there and conclude that their friends are crazy.
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    An additional plus is if you make a mistake and its a genuine score, the user isn't robbed.
     
  14. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    In fact our Solution now is to detect anormal kills/second. More than 2 kills/second during a game is probably a cheat.
    We also thought about an external Time verification and we are searching for the greater solution.

    Thx all for replying but i want also an official reply from Unity. HiggyB are you there ?? :D
     
  15. Pia

    Pia

    Joined:
    Feb 16, 2009
    Posts:
    78
    There is no way to 100% differentiate between cheaters and just very good players. No matter what threshold you set, it's either to high (meaning that cheating is still possible) or too low (which means that legit players are flagged as cheaters).

    Online games which are about competition basically need a game server, which verifies every game relevant action of the player. That would be the only real solution. In a client-only game, you can only make cheating more difficult, never prevent it.
     
  16. spinaljack

    spinaljack

    Joined:
    Mar 18, 2010
    Posts:
    984
    You can use System.DateTime.Now to get the system time and try to match it to game time.
    You could also just stop the game if it drops below 20fps and pop up a message to say your system is too slow or stop other processes to free up processing power.
     
  17. Pia

    Pia

    Joined:
    Feb 16, 2009
    Posts:
    78
    Local system time can be modified easily. Checking the fps would maybe prevent the simple speed hack, but keep in mind that you can change anything with CheatEngine. For example you can change the speed or the life time of any ingame object, so the game would run @60 fps for example, but the enemies would still not move or whatever. Easiest way would probably to directly modifiy the score without playing at all.
     
  18. nadimtrissur

    nadimtrissur

    Joined:
    Aug 5, 2014
    Posts:
    1
    I have once tried to use this cheat engine. But I could not learn how to use it. All I learnt was that they used a system which tries find the value in a game (i.e. numbers) and using the value, find the address and change the value. So this could be prevent if you do not show the score anytime but show it at the end.
     
  19. cosperda

    cosperda

    Joined:
    Oct 11, 2016
    Posts:
    36
    I know this is a old post, but you can detect cheat engine running, and force quit the game, i have been looking into trying to stop cheat engine abuse, and unfortunately the only way to do it via code is to detect something opening your handle(which i have no clue how to do), or to do a scan of active processes to look for cheat engine.