High Scores are almost a must these days for flash games. Players want to be able to compete for the highest score and compare it with friends and players around the world. While it’s nice that High Scores have become such a big part of the flash game industry, it also means that there are programs out there that will hack into your high scores system and allow players to cheat. Here are some tips for protecting those precious scores.
- Name your score variable something that no one would think of. The way most games are hacked is by using a program that will look through your variables. If you have a variable like ‘score’, it should take no time at all to find it and beat the system. So make sure you name it something odd to throw them off track. Make it as you would make a password; using uppercase letters, lowercase letters and numbers.
- Know the max score possible for your game. If you know this, you can easily compare the score of the player to it. If the player’s score is higher than the max score, you just reset their score to zero. Or, you could be even trickier, and let them think they’ve got you beat. Just flag them as a cheater once your code realizes they are cheating. Then when they finally beat your game, or lose, you will direct them to a “You cheated” screen instead of the high scores screen. There’s plenty more options than this (spawning pop-ups, rendering the game screen invisible, or anything else you may think of).
- When it isn’t possible to know the max score (an endurance mode or another game mode that can go on forever), just calculate roughly the average max score that a player should be able to get in a minute or so and compare the players score to that. If their score is higher, reset it to zero (or any of the previously explained methods.)
- Protect your leaderboard id. If the hacker knows it, you can be hacked. Whether this means splitting it up into strings and reassembling when needed or any other type of mangling you want to do, it’s up to you.