Would you like to have a leaderboard tool/API?

Discussion and feedback on Construct 2

Post » Mon Apr 18, 2016 11:49 pm

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
Code: Select all
http://topscore.com/api.php?action=add_record&value=48375&username=john&[email protected]&[email protected]#4#@TgdfGT$#%Tg'$

This one will save score to the system.

Load leaderboards
Code: Select all
http://topscore.com/api.php?action=get_leaderboard&output=json&[email protected]#4#@TgdfGT$#%Tg'$

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!
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Jul 26, 2016 3:20 pm

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?
B
18
S
8
G
6
Posts: 35
Reputation: 4,764

Post » Tue Jul 26, 2016 3:36 pm

Nope, there's no popup for JSON data.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Jul 26, 2016 7:28 pm

@BackendFreak 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?
B
18
S
8
G
6
Posts: 35
Reputation: 4,764

Post » Tue Jul 26, 2016 8:32 pm

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.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Wed Jul 27, 2016 2:52 am

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
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Wed Jul 27, 2016 10:02 am

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 :).
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Wed Jul 27, 2016 1:38 pm

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
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Wed Aug 24, 2016 2:27 am

Here are 2 solutions of leaderboard
- New grounds, which provided by newgrounds.io
- backendless, which is a general database service.


@Mario4President
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Wed Aug 24, 2016 3:07 pm

@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!
B
18
S
8
G
6
Posts: 35
Reputation: 4,764


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests