• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Game Mechanics Detecting if cheated by time?

T

The Green Dev

Guest
So I want to make a leaderboard type thing where you can see how fast players beat a level, but of course, people will just cheat to make it like 1 second or something (cough cough sonic adventure 2 cough cough). So I want to make it so that if the time is too low than it detects it as a cheat, but how would I get the lowest time, I mean I doubt I would get the fastest time or anything so is there anyway to do this?
 

jazzzar

Member
Well, lots of professional games couldn't even stop cheating, i would say nevermind this thing, it will take lots of your time and it's not worth it, you cannot stop cheaters if they wanted to cheat, but hey, in the end, who are they cheating? Themselves and no one else, Good luck :)
 

Yal

šŸ§ *penguin noises*
GMC Elder
The fastest possible time should be <maximal movement speed under any circumstance> * <straight-line distance from start to goal, no matter how the level's layout actually looks>.
 

Surgeon_

Symbian Curator
Why not just encrypt the whole leaderboard mechanism? I mean, who's gonna cheat if the data is written in non-human readable format and then scrambled with two, three layers of encryption?
 
T

The Green Dev

Guest
^ I'm talking about like hacking their speed and going through walls and stuff
 

Bukmand

Member
What I did in my old online game to avoid that, is checking for collision with inside walls, or checking room_speed or the FPS.
and if they do not meet then send them a message 'You cheated, and close the game'.

Edit: if you want more complex stuff. (Didn't test just my opinion) BELOW:

use if statement a lot for checking for game cheaters and don't save their ini and add a encrypted file ini that they cheated Counting++.
if that variables reaches 3 then give them a perma ban or do something
 
U

umetnik

Guest
If you are afraid players will change clock on their devices while playing the game, you could have a separate counter and increment it by delta_time in each step while the game is being played and then calculate the total on your own. If you would like to protect the high scores saved on disk from modification, it would be best to use (proper) encryption like @Surgeon_ already suggested. If you are thinking about players actually hacking game binary, you should know that while it is possible, it is hardly unlikely someone would have skills and take time to go through such pain unless she would really want to prove her point. HTML5 is probably another (easier) story.
 
D

Drewster

Guest
Well, lots of professional games couldn't even stop cheating, i would say nevermind this thing, it will take lots of your time and it's not worth it, you cannot stop cheaters if they wanted to cheat, but hey, in the end, who are they cheating? Themselves and no one else, Good luck :)
I disagree a little bit with Jazzzar -- on one hand, detecting and stopping cheating can be a lot of work. But if you have a shared leaderboard and the top 50 people always have a ridiculous score, it does take some of the fun away, so blocking some cheating is worthwhile in my opinion.

I think he's talking about someone cheating by adjusting the clock. Ie, start the game, play through until just about the end, then set your clock backwards to the moment just after you started the game, then complete the level. I think you effectively block this one pretty easily using alarms. GM alarms operate in room_speed ticks (steps) so use those to count your seconds rather than calculating elapsed time from the system clock. For example, do alarm[10] = room_speed; to count a single second, or just add 1/room_speed for every step in the game to county seconds. That should give you a real count on playing time.

Or if you want to DETECT time adjustments, then do something like that as well -- track the number of seconds using alarms or steps, then when you're done, calculate the elapsed time on the system clock. Compared this elapsed time to the number of seconds you tracked with alarms or steps. Allow a small grace period and flag cheating when there is a notable discrepancy. The one issue with this is if the game is paused -- for example, on a mobile device, if you switch to another app and then come back.

If you're talking about running on the PC and someone at runtime is hacking your speed to make it something that would not be allowed, Yal's solution is a good one -- basically figure out the quickest it could theoretically be completed and call them a cheater if they somehow went faster than that.

To help prevent cheating by hacking your save or ini files, don't use ini file for anything important. Instead use ds_map_secure_save and ds_map_secure_load to save and load your game status or save games. They work well, and well not insanely secure they will stop almost everyone from hacking save game data. This is also minimal effort to implement.

Oh yeah, to help prevent fraudulent IAP purchases -- make sure the user clicked your IAP buy button before a purchase is registered.
 
Top