GPGS? No thanks. I use a simple REST API to manage my online scores (and generate GUIDs).

Hi,

Looking through this forum’s posts I noticed a lot of issues with people who have developed a super simple game and want to provide an online scores facility so their players can see how they match up against the competition.

The first thing many people do is turn to GPGS: then spend the next week or so trying to get it to work.

I also looked at GPGS to provide a Leaderboard for a simple game I had developed but found it would take more work to fill in the GPGS forms and integrate it than it took me to develop the game in the first place!!! So I didn’t bother.

Anyway, when they say “it’s free to use”, you just know it ain’t: they are data mining you, your game, and most worryingly of all, the people who innocently play your game.

And what if I wanted to develop the game on a platform that GPGS doesn’t support? You are right back at square one again, looking for another service that can handle that platform. Then you have a delta on your game project and you now have to manage two development streams!

All I want is an online leaderboard…

Fortunately, my background is in developing business services, and I’ve written one or two RESTful APIs in that time, so, I took this experience and wrote my own online Leaderboard.

It uses a simple RESTful API. That means it is platform agnostic. It doesn’t matter if you wrote it for Android, iOS or a game console, as long as you can perform a POST call, you can use it.

With my service I can upload a score and download a JSON data-set of scores (filtered by date, and choose how many rows/scores to return).

The data-set includes:

  • the high-score
  • the gamer-handle of the person who uploaded the score
  • the scores position in the list, and if the call is from a gamer who’s high-score isn’t in the “top-xx” list, then an extra row is provided just for them with their score and position
    • a Boolean flag on each score row so you know when the row belongs to the current gamer, that way you can uniquely format that row to make it “pop” in the table.
  • Several date columns of increasing scope providing a score’s upload date’s:
    • Year
    • Year/Month
    • Year/Month/Day
    • and, Year/Month/Day/Time
  • So I can format my Leaderboard to show the “All Time Top-10” scores as well as “This Months Top-10” scores.

The service also provides a means to upload and verify a gamer’s handle (short-name). The service also checks the validity of a gamer’s handle each time they submit a score.

Finally, the service also has an API call that returns a real Globally Unique Identifier (GUID).

But why, you may ask???

When I was developing business apps, I needed a unique ID for each device. Normally, you would assume that the “DeviceId” reported by the mobile operating system would be the value to use? Wrong. That value can change with a major update of the operating system (e.g. iOS). Therefore, the “DeviceId” cannot be trusted.

So instead I choose to use a Globally Unique Identifier.

After looking at several methods of generating a GUID on the device itself, I decided to write a simple API call to do just that. Now when my game is installed a newly minted GUID (I call it an “Instance ID”) is stored against it that I trust, and can use to uniquely identify the device on the service.

Example code:

local function recordNewInstallationListener( event ) if ( event.isError ) then print("-----------------------------------------------------------------------------------------") print( "Network error: ", event.response ) else print("-----------------------------------------------------------------------------------------") print ( event.response ) end end local function recordNewInstallation() local headers = {} headers["Content-Type"] = "application/json" headers["Accept-Language"] = "en-GB" local body = {} body.gameId = gameId body.api\_key = api\_key local params = {} params.headers = headers params.body = json.encode(body) network.request( fgs\_url .. "RecordNewInstallation", "POST", recordNewInstallationListener, params ) end -- Call function recordNewInstallation()

Response:

{"status":0,"errMsg":"","instanceId":"0ab1cd01-01a0-0a0a-01ab-a01a5abc0123","gamerHandle":"PLAYER74"}

After I wrote this service for myself, I thought it could be used by other game developers, so over several weeks I developed a web-site to allow other developers to sign up to consume my API, and I loaded it with coding examples to help my fellow developers get up to speed with it quickly.

[Personal note: This service and web-site took me a lot longer than it took to develop my simple Corona game - it felt like I had gone down the rabbit hole on this one! All I wanted was to give my players the opportunity to see how they compare to the other gamers!  If somebody had told me in January that by the February I would have developed an Online Leaderboard with it’s own web-site for a game platform I had only started to use a few months earlier - I would have dismissed it out of hand. But you know, having an online Leaderboard in a game should be really, really simple to implement, and when I saw it wasn’t and you also lose your privacy in the process, I took it upon myself to put this right.]

The service is hosted, and that costs, especially if there’s a lot of traffic, so I charge a nominal fee (and it’s volume priced, so the more calls made, the lower the price).

You only pay for what you use, and it’s free to develop and integrate it; you only pay when you put your game into production, so if you develop it but decide not to use it, that’s OK, it wouldn’t have cost you anything, and I don’t ask for any personal or financial info (In fact, I use PayPal, so I do not store any personal or financial data at all).

So in summary:

  • Online leaderboard
  • Gamer-handles - what’s the point in uploading a score if no-one knows IT’S YOU?
  • Super simple RESTful API calls returning JSON formatted data
  • Cross-platform: games running on Android, iOS, Windows, Mac, can all access the same service and data through the same API
  • I don’t data-mine and I don’t collect personal or financial data on you, or your players.
  • A Globally Unique Identifier (GUID) generator!

And, finally…

The web-site gives coding examples showing how to issue POST calls using LUA (and C#, Jquery, etc…).

I’m thinking of writing an article (or series of articles) on how I consume this service in a Corona game, particularly the generating and storing a games GUID, managing the online high-scores and uploading new ones, formatting the scores table, and capturing, validating and storing a gamer’s handle.

Let me know if this maybe useful to you.

My service can be found here:

https://games.foliagos.com

1 Like

You may not know this but playfab does this for free?  Free up to 1k MAU.

1 Like

Hi,

I think his point is that he doesn’t want to rely on 3rd party systems. I am the same way personally, that’s why I created https://www.coroniumcore.com/ - It is your own system.

UUIDs can be generated without use of a server as well; https://marketplace.coronalabs.com/corona-plugins/uuid (though not sure if marketplace is still operational).

Congrats on your API.

-dev

1 Like

When I could not find an “Online Leaderboard” service (this one did not come up on Google), I wrote my own.

But after posting this I’ve now been told there are other “free” services out there. Thanks for letting me know about this one as well. Maybe a “Freemium” model is the direction I may head in as well with my service.

The service you flag up is another “all-singing-all-dancing” one. You can get lost in the options and concepts. I just wanted a Leaderboard for my game.

I still believe there is a market for the simplicity of interacting with a service through HTTPS POST calls.

It’s been a while (2020 was definitely a year to forget!), and I thought this topic had been lost in the move across to solar2d!!! But now I have found it again! :grinning:

I took some time to absorb what people had said in the thread and I worked on my API and the commercial aspect of it.

First off, I’ve expanded the service from just High Scores to now include Achievements and Collectibles tracking, and a simple Gamer Score system (based on a value you apply to an Achievement).

Next, I performed a pivot to a different pricing model:

  1. You can now use the API for free when you call it with a Developer API-KEY.
  2. You can also use the API for free when you call it with a Live API-KEY (the one you would use with the published version). You will be charged a small fee when the number of calls a game makes goes above a certain limit.

I’ve written an interface to display the calls being made by a game to each service API (using Developer or Live API-KEYs), so a developer can see how the game is performing and will be able to guesstimate if, or when, a call threshold will be met.

You can see the call thresholds and the pricing on the web-site.

The service can be found here: https://games.foliagos.com

I’ve set up a YouTube channel and put a fair few hours into generating content that explains what the service is and how it works. That channel can be found here:

I expect most of the games that consume my services will not trigger any billing by keeping within the monthly API call limits; and that’s OK!
But I do hope that if a game does become successful the developer wouldn’t begrudge me the opportunity to benefit a little bit from it! :innocent:

It costs nothing to join the service (just a working e-mail address), and I don’t ask for any financial details.

As always, feedback is welcome!

1 Like

This is almost exactly what I have been researching and implementing for my new game, so thanks for this validation of the idea.

However, here are the things I was struggling with internally (before I saw this post) which still nag at my forebrain…

  1. The GUID concept is great, and could even be applied to the scenario where a single mobile device might be used by more than one person (by handling multiple local profiles on the device itself)… but what happens when a user/player wants to play on a new device (or upgrades their device). Without a ‘real’ account somewhere (meaning a login AND a password or similar), wouldn’t they basically be starting over?

  2. Even though I have already nearly finished writing my own implementation, I am interested in both the foliagos solution and the CoroniumCore solution, but that leads to a few more questions:
    a) Is CoroniumCore still active and supported? I ask because when I go to the website, I get a stern warning from my browser and can see that the SSL appears to have expired on 9/28/2021.
    b) Assuming that CoroniumCore is still going strong (which I’m sure it is), what are the potential issues with me running a service of my own like that without much real-world Ubuntu experience? I mean, I’ve spun-up AWS and Digital Ocean servers before, but it was always for experimenting or learning. I’m a bit worried about creating a service on my own box like this and then finding out that I missed some simple security setting or practice and screwed everything up. Any advice there?
    c) For the foliagos solution, this also looks pretty cool… do you support US customers? What sort of traffic can you support in the event that a game or app explodes in popularity (asking because this is the same sort of thing I’ve had to think about for when rolling my own solution). Are you still in beta? (asking because I just noticed that the site says ‘Login (closed-BETA)’

Thanks for any and all feedback!

Apologies for being radio silent for the past few months. We’ve spent the time adding and testing more services. Games Studio now offers the following:

• Online Player Accounts and Player Pages (login/password - the service can distinguish a player moving between devices and also more than one player on a device - when a different player logs in the system sync’s that device with the last uploaded data-set).

• Analytics

• Online Game Save Data

• Online Achievements and Gamer Scores

• Online Collectibles

• Online High Scores

With Google Play Game Services, you get an all singing, all dancing system that can support the needs of AAA game titles, that due to it’s scope and depth has an UI and API implementation that can appear daunting and over engineered to the hobby/casual game developer.

This is where, we hope, Games Studio comes in. By contrast our web-site’s UI and REST API is more focussed on making it easy for a hobby/casual developer to get up to speed quickly to add online game saves and high-scores, for example, to their games, and there are lots of videos explaining how to use each service.

And now we are looking for hobby/casual and small game developers (our starting target market) to sign-up for our BETA-test.

The BETA tests aims are to flush out bugs, gain real-world insight into how people use its services, and also allow us to measure performance and resource usage to better understand the capacity requirements and configuration to reduce bottlenecks and make the service as fast and reliable as it can be.

It also allows us to further develop our customer-facing functions. We already have set up subscriber forums, where people can recommend new features, publicise their new game/app and pass on tips about using the service, and a dedicated support-desk where bug reports can be raised and tracked.

The service is available globally (we are hosted in the UK, but could expand into other territories if necessary), we invoice in UK Pounds so they’ll be an exchange-rate element for non-UK subscribers.

If you, or you know someone who would want to help us improve Games Studio, please visit: www.foliagos.com for information on joining the BETA!