Some thoughts about the pitfalls, fun and happy moments of developing an iOS labyrinth game from scratch using SpriteKit.


LɅBYRINTH

After a big (= multiple years) pause, in the past few weeks I had the chance to work on an iOS SpriteKit game again. I'm pretty happy with the initial results, you can purchase the finished product from the app store for FREE. 😉

LɅBYRINTH on App Store


Have a great idea 💡

So how to start things? Do you want to make a board game, an action game, or a beautiful 3D space opera? My advice is that you should sit down, think through the idea that you'd like to see on your phone, tablet whatever. Pick the route that you'll take instead of having multiple usually dead-end possibilities. Be picky and do some estimations if needed, you don't want to pack every feature into your first version.

Minimum Viable Product (MVP)

You'll find yourself having lots of good ideas, even during the development phase, but if you made a specification first, you should stick with that no matters what happens. The same thing was true for us during the creation of our circular labyrinth game. We had so many new things coming up in our minds, but we had to say no for every upcoming idea to keep us on track for the schedule. 😢

Specification

Write one. Even if it's a short one, just please write down a few sentences. Seriously. If you are a microentrepreneur (aka. one man indie game developer) a specification will help you to keep your sanity. Human mind is a creative one, so staying focused is one of the hardest tasks you'll ever face during developing a game. 🗒

Goals

Set your main goals, and stick to them no matter what happens. For example you might find that a level that you're working on is getting more and more boring, but that's just your point of view. That's because you've seen the exact same scene like a 100 times, but for someone new that can be an entirely different experience. Also give your game development project a proper schedule. ⏰

It's done when it's done

is a BAD POLICY, even John Carmack admits it.

Prototype & validate

Also before you start developing anything, you should prototype and validate your idea. This can be done with pen and paper or using static screenshots, whatever it takes. You can save a LOT of time if you prototype first.

Validation is as important as prototyping, you should show your idea to a few people. It's even better if they're not your close friends just acquaintances they'll tell their honest opinion more likely. Don't be afraid, if you idea sucks, just restart. Remember you did not write a single line of code yet! ⚠️

It's also worth to mention that sometimes you shouldn't listen to the others. If Apple'd listen to their customers, macbooks would still have floppy disks. If you can say confidently that you have a genius idea, go with it, no matter what others say, but self-validate yourself for example by market research first. 🔍


Start implementing the idea

Coding your game should take about one third of your overall time. Choosing the right toolkit is one of the most important things. If you're trying to create your own physics engine you can waste lots of precious time. 👾

Choose the right toolkit!

There are lots of frameworks provided by Apple, here are a few that you can use for your next game development project. Also there is Unity3D and many more 3rd parties, but Unity is the most popular cross platform game engine.

  • GameKit

Create experiences that keep players coming back to your game. Add leaderboards, achievements, matchmaking, challenges, and more.

  • GameplayKit

Architect and organize your game logic. Incorporate common gameplay behaviors such as random number generation, artificial intelligence, pathfinding, and agent behavior.

  • SpriteKit

Create 2D sprite-based games using an optimized animation system, physics simulation, and event-handling support.

  • SceneKit

Create 3D games and add 3D content to apps using high-level scene descriptions. Easily add animations, physics simulation, particle effects, and realistic physically based rendering.

  • Metal 🤘🏻

Render advanced 3D graphics and perform data-parallel computations using the GPU.

  • MetalKit

Build Metal apps quicker and easier, using far less code. Render graphics in a standard Metal view, load textures from many sources, and work efficiently with models provided by Model I/O.

So we had the idea that we're going to create a circular 2D labyrinth game using SprteKit. However Unity is extremely widely used, everyone from the team had some SpriteKit experience, but zero Unity. That's why we went this way. 🤷‍♂️


LɅBYRINTH

Our SpriteKit game development process

Before we made a single line of the game, we created two prototype apps (one UIKit app to test the user control mechanizm, one SpriteKit playground to check labyrinth variations) to see if the idea can work or not. After these two little experiment, we made a decision that we're good to go. However we also had to solve a few challenges (we realized them later on) in order to make our game work, here are a few pain points that needed to be issued during the actual coding phase. ⌨️

Labyrinth level generation

In the beginning we thought that it'd be the best to make levels by hand. After we realized that this requires lots of work we wanted our game levels (rings) completely random generated, however this approach had a few problems too. Finally we made a compromise between a half manual half automatic solution. This way the gameplay can stay infinite, but we can also deliver custom levels in the future if we want. 😅

Physics are not so precise

SpriteKit physics sucks. I already knew this, but I wanted to give the system another chance to prove that I'm doing something wrong. It turned out that it really does not matters what I do, if it comes to relatively complex physics tasks with paths SpriteKit physics behaviors are odd. 🤔

Pause / resume

Pausing & resuming a SpriteKit scene is still a problem, you need an extra property to manage things, plus you have to watch app lifecycle notifications. Here is a sample code that I hade to use again like in my previous game in order to tackle it down.

Music player detection

Another little issue was that we had to watch the built-in music player's playback state in order to mute every sound & music inside the game. This is relatively easy, but you have to deal with some delegates & async methods.

These are just a few somewhat "annoying" examples that we had to deal with, but our overall experience with SpriteKit is quite satisfying. There is still plenty of room for improvement for Apple, but with the introduction of GameplayKit and Metal, I believe that they're on the right path. We also had our fun moments, with top secret ideas, I can't say more, but it's gona be awesome if they come true! 🤐


The final test

So after more than a month of development we were able to finally test our product. We've run tests for 2 weeks with multiple candidates. Those test results helped us to fix a significant amount of potential bugs. 🐛

Also we've received important feedbacks about the gameplay, visual elements and many more. We made some refinements based on those thoughts to make the gameplay even better.

As always we used Bitrise for continuous integration service, we're still in love with that service, you should definitely try it out. A pleasing surprise was that the fastlane + testflight integration just works, after you made your provisioning struggle, so we could deploy test versions with just a single terminal command. 🤓


Marketing & conclusion

After you publish your game to the App Store the real work is about to begin. You have to promote your application on every platform / medium that you can.

You have to do everything to get some attraction.

Nowadays marketing is necessary, because even the App Store is redesigned, I personally believe that's not helping indie developers to get discovered at all. It's a shame that most of the time only top hit apps are inside the Today's view.

LɅBYRINTH langing page


Anyway, do what you can, share your app on social media, contact various web portals, review sites with cold emails, go to linkedin search for app store marketing people, or write a blog post about how your game was made. 😛

We've learned a lot from this indie game development process, we had lots of new ideas, inspiration and fun during the creation. I can say just one thing in the end: make your own game, it's worth it! Also try out ours. 👍 😅

LɅBYRINTH on App Store


External sources