Thursday, October 10, 2019

Itch.io achievements.

I got a couple of requests for Hexa Trains to be available from itch.io and not just Steam. At first glance, that should be easy enough, I've published stuff there before.

But with Hexa Trains there is a complication in the fact that the end-goal of the game, is to unlock the Steam Achievements. And without achievements, that goal would be missing.

Itch.io has no Achievement/Leader-board API. More than that, it does not even have the concept of User IDs, nor logging in via the game. So what would achievements on an Itch.io version look like?

I thought "Can you do leader-boards without a log-in system? And then I quickly remembered the 1980s. Getting listed in the leader-boards by writing your three letter initials.

So at the very least, something like this is possible. But in modern times, there is more to record than just a single number for the high score. All sorts of statistics are tracked between sessions. For instance, in my game, the number of rail sections laid down.

So, we still have the problem of tying a player to the statistics. But do so without adding the hurdle of a log in step. And tying the player to a name should be optional, like it was on a PacMan Arcade Cabinet.

Thinking about this problem made me want to see if I could write my own Open Sourced Achievement/Leader-board system. So let's start with the requirements.

  • No log-in stage.
  • No user id.
  • No email address.
  • Name/Initials optional.
  • API similar to existing frameworks (Game Center, Steam, Google Play.)
  • A server to keep track of progress and scores.
  • Don't track between different game titles.

I think something like that could work. Step 1 would be to generate a random number to be used as a unique ID to identify a player for this specific game. All subsequent launches of the game title, should use this ID when reporting scores and achievement progress. There will be no name/initials associated with this ID, until the player chooses to do so.

To preempt any pranksters wanting to be obscene, racist, or otherwise, the optional name should come in the form as 3-letter initials. It is too hard to be obscene in English, using just three letters. (You can be in Dutch, though. But meh.) This removes the need for moderation by humans. (Duplicate initials is not much of a problem. Stats are tracked separately via the ID.) Also, Latin-alphabet only would be a safe choice with respect to obscenities as well. Less expressive means safer.

I also think it would be a good idea to be as lightweight as is conceivably possible. And it doesn't get much lighter-weight than single-UDP-packet fire-and-forget communication. Stat updates could conceivably get lost, as could scores. I think we should just ignore that. If stats are reported in absolute values, it will get corrected in a future report. If it is reported as deltas, meh.

Note that achievements could be a purely local thing. No need for a server. Only high-scores would need to be shared. But for sake of symmetry and versatility, both via a server could have benefits.

There is still the issue of presentation. The player needs to be notified of unlocking an achievement. How? Put that burden 100% on the game developer? A nice thing about Steam/iOS/GooglePlay is that you don't have to think about that as a game developer. You report the stats, the system will tell the player if it is appropriate. But how would you do this without having control over the game's window?

Let me conclude with: what are your thoughts on this? Leave a comment!

No comments:

Post a Comment