Cross Platform Development is hard.

I guess ‘hard’ may be a bad choice of word (although hey, clickbait titles are soooo in right now). I suppose some better choices would be challenging, demanding and testing. Challenging of my abilities, demanding of my time and other resources, and testing of my capability to learn new stuff quickly and apply it properly to my work (and also testing of my patience!).

I started cross platform development in August 2016, after having 3 relatively successful game launches on iOS in the years before that. After leaving college and going straight into full-time employment I suddenly had a decent amount of free time (yaay for escaping coursework and essay writing!) which I could invest into what I wanted to do – and that thing was games development!

well… it was kinda carrying on what I was doing before, but this time I made it my aim to get Asterun, my personal favourite out of the games I’d made up to that point, released for both iOS and Android from the same codebase. I had looked at starting cross platform development a few years previously, but very quickly ran into issues and decided that I’d leave it for another time.

*quick 5 minute break while I choke on some pineapple juice, and proceed to need many glasses of water for my throat to feel better again. fun times right?*

My breakthrough with cross-platform development, while a eureka moment at first where I suddenly began to grasp C++ code, was dragged out over many months. To begin with, I struggled greatly with getting Cocos2d-x, the game engine Asterun is powered by, set up so I could begin coding. The documentation, while immensely better than when I first attempted to use it a few years ago, wasn’t that in-depth and I ran into issues almost immediately – some necessary steps were missed out in the instructions and meant that I spent a few weeks chasings some issues that were fixed when their (incredibly helpful and friendly) support pointed them out to me. In the end I managed to get everything set up – after reinstalling many times over!

I managed to bring lots of Asterun over from Objective-C very quickly, generally bringing one feature across to C++ every night, with a few days of testing and tweaking as I went along. (I even released one part I ported over, a cross-platform alert view class, on GitHub for anyone to take a look at and use!) This meant that generally what I added was bug-free (ha, I wish) and looked nice and shiny. Progress then slowed as I lost motivation, parts were becoming more complicated so I took a bit of a rest from it all to regain some energy.

Then boom, motivation strikes. Suddenly Asterun begins to take form, and soon after the main game and menus are completed. However, there were various third-party parts left to implement: adverts, analytics, leaderboards/achievements, notifications to name a few. This meant turning to Cocos2d-x’s solution for this: sdkbox.

*shudders*

Now, don’t get me wrong, sdkbox is a good product and actually functions reasonably well, but wow oh wow did it cause some issues!! For those unfamiliar with it, sdkbox allows developers to ‘easily’ integrate third-party libraries for iOS and Android so they don’t have to do crazy bridging between the different versions for different systems. If it wasn’t for sdkbox, I would probably not have moved over to cross-platform development and stayed making games for iOS. In order to install ‘plugins’ (the individual third-party libraries) you run commands in the command-prompt, such as

sdkbox install <plugin name>

It’d then take over and automatically download the plugin, before integrating it fully into the target project allowing you to jump straight into using it. Or, it should do that anyway. It appeared that, as I’d already started working within the project, sdkbox couldn’t handle integrating a plugin I requested and failed the installation. Oh, and corrupted the project build files too, meaning I had to recreate the project. Again. However, I chose to try adding the plugins in immediately on my next attempt (before adding any of my own code) and all of them were added correctly. Success! Finally! As a result, Asterun now looks like this!

2017-01-22-20-20-38

2017-01-25-21-42-37Yeah! Looks neat, eh?

You’re meant to nod in agreement there.

Now I’m in the final stage – adding multiplayer. The leaderboards and achievements have been added and work very nicely, and I was incredibly proud about how somewhat professional it looked (I even did little custom icons for all of the achievements and leaderboards too!). They’re all powered and hosted by Google Play Games, which provides (what I thought anyway!) was the best cross-platform solution for what I wanted to do.  However, I noticed while testing it on iOS that I couldn’t sign in with one of my accounts. The account I used for testing on Android worked, while the one I wasn’t using on Android seemed to fail on log in. The reason for this became apparent after googling for some time – account creation for Google Play Games isn’t actually supported on iOS and it isn’t planned to be supported in the near future. This meant that while I had a fully created Google account, and was presenting a screen which asked for permission for Asterun to access the account, it would not work as the account didn’t have a Google Play Games profile attached to it.

This means that when I release, very few users are actually going to be able to use the leaderboards and multiplayer on iOS.

That sucks. So damn much.

I did consider for a short while not releasing at all for iOS, however I feel it’d be better to release what I’ve got as some will be able to enjoy it, plus it looks so damn shiny on Android now. Android isn’t affected at all, anyone with a Google account will be able to sign in and play.

I suppose this entire rambly post is to show that making Asterun hasn’t exactly been a walk in the park, and while at times being incredibly challenging, has provided a great learning experience which I can now apply to any future projects! I’ve been able to finally learn C++ (by diving straight into the deep end without ever learning to swim first), get to grips with Android development, and further perfect some of my game design ideas (UI design, object pooling, physics code). It’s also inspired me to write some proper documentation for the future so people following in my footsteps won’t suffer the pain I did. When Asterun is released, my next steps are most likely to be investing some time into creating decent documentation for everyone to enjoy.

It’ll be great to write something not quite so rambly.

But today is not that day.

If you enjoyed this post and want to be updated when future ones come out or when Asterun is released, drop a follow over at twitter.com/ryanbourne28! 🙂

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s