Error when adding a new game
The most common reason for an error when adding a new game with all fields filled out is the game title. Game names must be unique and if you are trying to use a name that has already been published on here, it won't allow you to use it.
What if my game relies on lowest score instead of highest?
The score system is designed to track the top 20 highest scores. If your game relies on having the lowest score for first place, there is a possible solution. When submitting your scores, make them negative. This will make the scores closest to zero as the highest winners. When you pull your scores from the server into your game, flip them back to positive. The end-user will never know the difference.
Why would I need multiple hi-score tables per game?
Today's modern games typically span multiple platforms and sometimes different platforms have different controls or environments which the game must be adapted. This allows you to keep track of scores for only those players using Android devices, iOS devices, or PC. You don't have to separate your platforms but the option is there if you need it.
Is there a limit on the size of the score?
Yes, there is. Each score is stored in a signed 4-byte integer and thus the highest score you can submit is 2,147,483,647.
What if my scores aren't integers and contain decimals?
There is a way to work around this. If you have a score of 32.17, multiply it by 100 to get an integer value of 3217 and submit that score. Then divide by 100 when you retrieve your scores.
Errors when submitting scores
- Unknown error
- Score submitted successfully
- Username was greater than 32 characters
- Invalid gamekey
How to submit and retrieve your scores
First thing to do is create a secure HTTPS connection to purpletoken.com. Then assign
your variables. If you're retrieving scores, all you need to supply is the gamekey.
If submitting a score, you must supply player, score, and gamekey.
Then finally, send the request to this file: update/index.php.
Some systems, such as Windows, don't require you specify the index.php, but others such as Android can fail if you don't. So it's best if you just always include it.
For retrieving scores using AGK:
http = createHTTPConnection() r = setHTTPHost(http, "purpletoken.com", 1) vars$ = "gamekey="+gameKey$ sendHTTPRequestASync(http, "update/index.php", vars$)
For submitting scores using AGK:
http = createHTTPConnection() r = setHTTPHost(http, "purpletoken.com", 1) vars$ = "player="+player$+"&score="+score$+"&gamekey="+gameKey$ sendHTTPRequestASync(http, "update/index.php", vars$)
You can view a complete code snippet here.