Charge and GameKit

So this week I also wanted to have a quick chat about the foundational tech that Charge is built upon.

Quick history lesson: This isn't my first stab at this game. In fact it's more like my... fifth attempt? Its a game I've wanted to build for almost as long as I've been working in the games industry. Getting the core gameplay has been relatively easy each time, moving units around, rolling dice, and all that jazz, pretty simple stuff. No the hard part has been multiplayer.

So this is my first multiplayer game. It'll also be my first released turn based game. I'm also a solo indie dev with... lets be honest, not a ton of cash behind me. This leads to a stringent set of requirements:

There's a ton of multiplayer options out there, from Unity's own inbuilt one, through to several third party options through to writing my own server for it. The catch is nearly all of these options require both ongoing maintenance as they continue to improve / get sunsetted, and often they'll also require fees to maintain the games servers, and more often than not those fees scale with the game's concurrent player count.

The first shot I tried was play by email, way back in 2015(?). I had only just discovered C#'s email functions and thought AHA! The early prototypes failed to run at all (due to my lack of coding experience, I'd only been coding for a year or two at that point) and it was shelved within a week or so.

The second attempt was using Googles Firebase. That was a lot more promising, I actually had a couple games with my brother online. Again though, riddled with bugs, barely worked, and I realised during that time that it would end up costing in the long run.

Third and fourth attempts were with an amazon product and some third party thing I found on the asset store. Same issues.

Then last year, Apple announced this cool thing called Apple Unity Plugins. Effectively they just expose a bunch of stuff that's built into the various apple OS's to Unity. One of those things was an older system I hadn't heard of called GameKit which oh guess what has a Turn Based Multiplayer system just built right into it. And this is how it fits into my requirements:

Basically it literally ticks all the boxes. Apple handles the accounts (via iCloud), so theres never a sign in screen. It's a service available to all developers on apples platforms, so it doesn't cost me anything more than my dev account, and from what I understand if I for whatever reason decide to shut down my developer account, then the game still kicks on. Matchmaking is built into it, so it's easy to find a random to play with, the code is literally just an async turn.send(byte[]); and an onTurnRecieve(byte[]) callback.

And would you know it.. It just works.

It's got other limitations sure, like a maximum turn size of a whopping 64kb, a requirement for players to be logged into iCloud/Gamecentre to play online, etc. But they're not so bad.

Honestly the one limitation that bothers me the most is....

The fact that it's tied to Apple's ecosystem.

If i wanted to release the game on say.. PC? Console? I'm back at square one. Fortunately I've developed the game in such a way that it allows for multiple multiplayer backends, (for now, just for local, pass and play), and I honestly think that if I'm going to go down that route I'll end up just having to write my own super lowfi server solution. Something I can host on a potato somewhere and pay next to nothing to maintain.