A (very) short story how I got to write this rant.
Somehow, being in mid-school many years ago (2006-something) I met Christian Chrustev in IRC. Somehow, we decided to make a game.
He is a designer and I wanted to try to code. To briefly describe what the times were, back than I had no idea what recursion was or how to return a result from a function. Every variable being global teached me to keep an eye on everything … But surprise, surprise, somehow we managed to make something – a Flash based game named “Ден за ден”. As a matter a fact, it is played 70k times only in the web site I have attached, has a user score of 4/5 and won a second prize in the “Computer Space 2007” competition.
Fast forward, 8 years later I have a job as a programmer, and he has a job as an artist. And somehow we decided to see if we can make the game experiment again.
So, Adobe Flash being dead, and me being an Apple head, lead to this being an iOS game. I wanted to have more fun, so I decided to not use any existing game engine and do as much by myself, as I can. But I didn’t want to bother OpenGL ES stuff, so I picked the thinest, most supported library which provides drawing API. Apple SpriteKit was just released, so I picked it. What a huge mistake this was.
Developing it was okay-ish. I had no idea how to code for iOS device, but the docs were there and the redundant Objective-C syntax was not a stopper (Swift wasn’t there yet). Surprise, surprise, starting from scratch, working nights&weekends (mainly, weekends), few months later we had F.U.T.
A bunch of friends translated it in 5 languages and the another-title-in-the-appstore-wall was there. So far so good. But here comes trouble.
Last year at WWDC Apple showed the iOS9. And I, as an early adopter with payed dev account decided to install it. Surprisingly, F.U.T. was not working in iOS9. Being in the software industry for a while I decided to fire a bug about that, because I know how important this is.
I’ve waited a while, didn’t get any feedback. So I wrote again a couple more times.
Now, to be clear. I knew that it was some kind of stupid API error in the Apple implementation. I knew that I can found a workaround, but it never was a high priority for me. However, having an iPhone, iPad and Macbook, all of which run a software that is made by the very same guys, not breaking API is a priority. A very high priority. So I wrote a few more times. More than 10 times.
Of course, there was no answer, but this wasn’t new for me. Sometimes people think that when they ignore emails, the problem is gone. It often is. But I’ve decided to keep posting about this every now and then, until it is fixed. Even if I do it for years, even if nobody reads that, I just can’t stop.
But few days ago, Christian got in touch with me. He showed the game to a friends, it wasn’t working. Now, Chris is very diplomatic and managed to make me fix it. So this weekend I did. I found at least three bugs in the iOS9 API causing the F.U.T. issues. If you google for “ios9 sprite kit” you will quite a lot of things, but here is what I found:
- When adding SKSpriteNode, lets say with
it can loose some of its properties if you set the alpha to 0. In my case, I was adding this in the constructor of another SpriteNode, settings the alpha to 0 and changing the name property to something. Later, on touch event the name property was NULL. Changing the alpha to 0.000001f fixes the issue.
- The loaded textures with SpriteKit are flickering with white rectangle during their first load. What I found in StackOverflow, and worked for me was removing all the textures from the Xcode project, adding them again and rebuilding (!). Here is my comment about that.
- The multitouch had stop working. Setting explicitly the property SKView property multipleTouchEnabled fixes the issue.
- I will not even mention bug 18049778 which I reported in 2014. This causes for unknown reason SpriteKit to stop loading textures (!) at some point and crashing soon after that. I’ve even send the app code and assets. It was closed with:
There are no plans to address this.
A different crash report, that I have made was closed with:
That spew is not a change in behavior from the previous OS version.
All of these were working in iOS7 and iOS8 for F.U.T.. The point of using framework from the OS vendor, even if they are more hard to work with, is that it is supposed they to be tested prior to the OS releases.
But, it is okay. I builded the app, update the v1.01 changes and submitted it to the AppStore. Surprise, surprise.
Occasionally I install Xcode beta to see if some of the clang bugs are fixed, so I guessed this was the reason. I was not sure, so I checked.
And compared it to the latest one in the AppStore.
So I guess I am running a beta OS X version … I am not sure if that is the case, but how bad it should be, if you don’t allow uploading apps builded on a beta OS version. It is still broken in the App Store and I have to reinstall my OS to see if this will help.
Bottom line: do not use SpriteKit. Even more, do not use ANY Apple API if you have a choice. They break those, they don’t care, they don’t have plans for “fixing this”, that spew is not a change. And their APIs are even not good at all.
p.s. Last, but definitely not least – every OpenCL on Earth, besides the Apple OpenCL supports array of pointers as argument to a kernel. I know it is not in the standard, but come on! And not having OpenCL working on iOS made me use Metal Compute. Which is fine, I don’t care about APIs, do your vendor locking, I will do my API wrapping. But compiling even simple kernels gives “internal compiler error”. I’ve added this as bug 22026758 … but yeah, this spew is not a change.
edit: After posting this here and twitting it around, including to @clattner_llvm, who seems like a nice guy, I finally got an answer.
I repeat. I. GOT. AN. ANSWER. It took a bit more than 11 months, a blog post and some Twitter power, but 2 days after posting this, I got an answer !
The answer itself is not that important (I got “we have bug in the documentation” answer, but I don’t think thats the case and I will try to get further). Having an answer is what matters here and it comes to prove my theory that sooner or later, even the most hard mail-ignoring people can start answering back. Just don’t give up.