Would you like to have a leaderboard tool/API?

0 favourites
  • 10 posts
From the Asset Store
A small template showing how to build a firebase ranking
  • Hi Guys,

    I've planned to make a leaderboard module for MoModth, but I went a step further with my plans and I'm thinking about to make a universal tool for it.

    I know there are Google Play etc. leaderboards that you can use but this is platform specific. When you want to make your own leaderboard dedicated for your game and platform independent then currently you have to make it on your own server right? I mean create (for instance) MySQL database and write a PHP code to cover your API. It's pretty much of work as for one simple feature.

    What I'm thinking about is to make a tool where you would set up your leaderboard on the web page app (something like in Scirra Arcade). I mean here the name of the leaderboard, fields (score, player name etc.), should it be sorted ASC or DESC etc.

    Once you set up everything, you recieve very easy API to use it in your app.

    Examples:

    Send score

    http://topscore.com/api.php?action=add_record&value=48375&username=john&email=john@gmail.com&api_key=@#4#@TgdfGT$#%Tg'$[/code:2kvbolwa]
    This one will save score to the system.
    
    [b]Load leaderboards[/b]
    [code:2kvbolwa]http://topscore.com/api.php?action=get_leaderboard&output=json&api_key=@#4#@TgdfGT$#%Tg'$[/code:2kvbolwa]
    This one will return a C2 JSON dictionary data with your current top scores
    
    Of course this is only some trivial example, but you know what I mean. So the simple steps which you would have to do in order to have your leaderboard working would be:
    
    1. Set you leaderboard on the site
    2. Add one event using AJAX object to save score
    3. Add one even using AJAX and Dictionary to load leaderboard
    
    Then just generate output in your game with Text Object or Sprite Fonts. That's it. But this can be also covered by some C2 code snippet.
    
    I will do it for myself anyway in the simple form. But if you also find it useful then I'll create a whole site with admin panel etc. so you could use it easily as well.
    
    Just let me know what you think.
    
    Cheers!
  • if you load and download the leaderboard with ajax every time, isn't it so, that the browser will always popup a message, asking for down and upload confirm?

  • Nope, there's no popup for JSON data.

  • Ah ok, I somehow was really sure about that. Well I think that sounds like a cool idea. Did you manage to build an try it for yourself?

  • I've built several of those leaderboards for my customer's games but haven't built the universal module yet. I'm quite bussy recently but it's surely on my TODO list. Will post it on the forum once It's done.

  • Wouldn't a node.js based webserver be faster than php at handling requests from users? Especially when you'll be hosting the webserver yourself, you wanna squeeze out all the performance you can

    I personally wouldn't do it, too much trouble for you, and you'd have to handle scaling the app and paying monthly fees for nothing in return if this thing gets big. Unless you plan on charging for it, in which case, I'd go for bigger, potentially more robust company-based leaderboard apis

  • Backend part for such a tool is really nothing fancy. If you make it with some lightweight framework (or even just some libs) and cache it with APC for instance then you can handle pretty anything. It's lightning fast on an average server with some decent amount of Apache forks available, so I wouldn't worry about the PHP.

    Thanks for your opinion by the way .

  • What about making a leaderboard online code generator and giving people a simple tutorial on how to setup the code on popular paas' like Heroku and Openshift

    Just the opinion of one man, Disregard xD

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here are 2 solutions of leaderboard

  • rexrainbow I did not download your plugins yet, but I will when I come back from work. These plugins sound great, I read the descriptions and that is definitely something I was looking for. Thank you for pointing them out for me. I'm using some of your other plugins and they are all very helpful!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)