Saturday 5 March 2016

Leaderboard integration: GameSparks vs Heroic Labs.

Introduction

In a recent post I give a bird-eye view of Parse alternatives. Last week I integrated leaderboards in Bad Bears using both GameSparks and Heroic Labs. Granted, these guys offer more than just leaderboards - notably, 'cloud' (aka server side) storage, cloud code and analytics.

Other candidates I quickly sidelined:
  • Gamedonia since leaderboards are very much DIY in their case.
  • Not everybody enjoy scrubbing back and forth while squinting at code lines and straining their ears to decode compressed American English audio. Sorry BrainCloud (and no: I don't want your sample project)
Other candidates (see my previous article) may be worth considering. Now that I tried two I might overcome my issues with BrainCloud and give it another try.

GameSparks

GameSparks provide a comprehensive service; I like that logged info includes a player's city and country.

I like the test harness which allows building JSON queries in a sandbox - what this means is that you can 'play your game' against their test server directly, which of course goes way beyond leaderboards.
But then again. This shouldn't be a substitute for a well documented service with clean APIs.

I don't like that I had to use a JSON parser just to get a player's rank. Their APIs feels stuffy at best (You got a namespace named Api? Give me a break...) and I found myself juggling between documentation pages, API docs and admin panels to patch my code together.

Support exists though I'm not liking it yet.

I spent 4~5 hours setting up and integrating.

GameSparks was founded in January 2013.

Heroic Labs

The Unity SDK integration is nice: just drag and drop a dll and you're ready to code.

Docs are shiny, with a comprehensive, top to bottom document explaining (with to-the-point code snippets) how to integrate their features with your game.
Still, the docs sometimes wander off topic, and put business talk in a separate document?

On the down side, you get less 'out of box'; for example I wanted leaderboards ranking players according to their latest score, which requires (yet to be written by me) custom code.

Support is good.

I spent 2~3 hours setting up and integrating.

Heroic Labs were founded in October 2014.

A note

Something that most providers (including these two) seem to go with in their sample code: anonymous functions. Beginners will be confused by this - they won't even know when the code executes.
Also, I'm guessing that these will go away when structuring my code, keystroke saving all on their end not mine.

Session logs

I'm not sure how informative this is. But anyway that's how I used my time testing these APIs.

GameSparks

7:19 - Oh my, I already have an app setup.
7:23 - Don’t understand “Segment Configuration“.
7:29 - They say they have a package but they don’t. Oh wait… bad presentation of their SDK intro.
7:37 - This cockup with the sample proj. versus package (since I enterprised to frankenport the package in my project on my own), now that caused GUID errors.
7:42 - Don’t get it. I mean, they were trying to make me enter the API key and secret or whatever but this part was way too verbose, got lost.
7:54 - Duh, imposing your puny singleton pattern upon me?
8:10 - Can authenticate. Really dislike these implicit functions.
8:21 - One thing that bothers me is that it looks like their SDK needs to asynchronously perform some kind of init before I authenticate. I would expect that waiting for an all-clear event before authenticating would do it but meh. So I hooked my authentication to the start game button (since I used device authentication ). How unsightly.
8:34 - Already created a leaderboard.
8:35 - Off to the test harness I guess we’re testing how to submit scores. So I will create a user John.Doe with display name John and password ******. Works.
8:40 - I go to LogEvent and “submit a score”. They say “since the event is attached to the leaderboard“ but I don’t remember doing that. Seems to work though.
8:50 - When they say "numbers” they mean integers.
9:05 - Looks like I should use “LAST” for my event.
9:14 - Good time to submit scores is when a player win or lose. got hooks for this.
Ah well. One good thing is the test harness. I’ll be able to validate my notions about how to setup the event and leaderboard using that. So, I can post scores. I need to do rankings and leaderboard requests too.
10.38 - Anyways. I don’t have a JSON API handy. Yea yea JSON is easy to parse but what if you did NOT want to parse?
Now, I want to get the player’s rank first thing when entering the game. Means I need to authenticate as fast as possible.
11:03 - Seems like they didn’t want Unity users to get any callback after initialising their API.
11:07 - Displaying their data in my widgets
11:26 - What the heck is preview mode?
11:56 - Setup live environment. 
12:05 - CLEAR
Two days later
2:05 I want to silence their logs. I don’t mind logs as long as I can control them
- Well. I’ll just hack PlatformBase. Oh, and they use a very interesting pattern here. Gistbox!
2:15 - CLEAR

Heroic Labs


6:18 - Creating my account
6:22 - Creating a leaderboard.
6:23 - Heading over to Client SDK docs
6:30 - Installed, copied API key to my sample code.
6:33 - Ran; encountered an error. Mailed Support.
6:40 - Deleting their SDK dll.
6:43 - CLEAR.
6:54 - They seem to be looking into it.
Two days later
1:52 - Logging (note: links are not extremely visible, like here: https://heroiclabs.com/docs/guide/unity/)
2:11 - inserted my API key. 
BREAK
2:23 - So mmh. Apparently NOT receiving a message means we are okay. No news, good new, eh?
2:40 - Not sure why they are caching the session client. Where is the overhead really? Also, did they forget to paste the code showing how to serialise the session client before deserialising it?
2:54 - Nickname cannot contain profanity? Grrr(*)
And I’m guessing that, though it looks there is a callback for it, it's not being called?
3:05 - Adding client code to get leaderboard and submit scores.
3:08 - Leaderboard.Entry should be GameUp.Leaderboard.Entry. Well I got my own Leaderboard class.
3:21 - I wonder if I can submit decimal values to leaderboards?
3:24 - Now, their service won’t log me in. Well, actually there is a weird inspector(?) bug that causes my API key (the public field in my custom class) to get deleted. No wait, *I* keep renaming this. My bad.
3:31 - Unity died on me. RIP. Also, it's not restarting wtf.
3:52 - They don’t allow spaces in nicks either… ?
3:57 - Their API makes it easy to get updated ranks. Just need to wire this up.
4:08 - Another freeze. Not sure if it comes from their API, GameSparks or running the two side by side. Eh.Something else entirely.
4:27 - Just need to sort my board using the latest scores. Can it do that?
5:00 - CLEAR
(*) A common feature of not so clever profanity filters is that they reject actual names, like "Tito" or "Titus". Not allowing spaces is more of a bummer, something that our players won't be jazzed about.

1 comment: