• 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!

leaderboard

T

teamrocketboyz

Guest
hello all, Im wondering how easy/hard it is to implement a leaderboard where at the end of the game
GML:
global.gamescore
is uploaded. both offline and online and including the option to input your name.
 

kburkhart84

Firehammer Games
Locally...its pretty easy. Online...you are asking for lots more effort.

Locally...Its just about creating a file that stores the list, loading that in, and modifying it. You can store the list in arrays, or a different data structure if you choose. Then its a simple comparison of the current score with the ones in the list, and asking for a name, etc... and resaving the file when the scores change.

Online...You will need a server to store the information, on top of local storage(for if the scores are good enough for the list but the PC is offline currently). You will then need code to make a connection to that server, download the list, and upload a score if it is worthy(last part could be handled on the server instead of the client). Despite this paragraph not being very big, when you actually take a look at the thing, there are many more complications involved.
 

Binsk

Member
As has been implied by @kburkhart84, It is not nearly as simple for online leader boards.

This is what you would need to get it working:
1. A server.
2. Knowledge of accessing and modifying a database (like MySQL) on a server
3. Knowledge of PHP to interface w/ your database as well as your game
4. Knowledge of how to use HTML POST requests and the like to interface with the PHP code on the server from GameMaker

If you know these already then it isn't that bad but if you aren't familiar with them it is a fair amount to learn. If you want to teach yourself then look into XAMPP, it basically is everything you need to set up a local server on your machine so you can test things and learn how to implement the systems without actually having to mess with a live server.

I also have a free extension that handles top-10 high-score boards and stores things on my own server if you are just planning on playing around.
 
Top