Just me, or SpriteKit in GMs terribly broken?

I've updated to ElCap GM, XCode 7GM, and iOS 9GM and a project I'm working on seems to be broken at every turn.


  • Atlases don't work properly
  • Atlasses in Asset Catalogs don't work properly
  • still getting PKPhysics* types in methods expecting SKPhysics* types
  • the Actions editor is buggy as **** and doesn't properly handle image references
  • sizing of physics bodies based off of textures seems to not work right...


I've filed bugs where possible (way back in early betas), some of these issues are intermittent or difficult to track down... but it certainly doesn't seem to me that SpriteKit is anywhere near ready for release. Am I doing something just fundamentally wrong?


At this point, my project is so full of kludges to avoid crashing left and right, I don't know if I'll every be able to release it 😠

Replies

Hi Karim, can you post the bug numbers for these issues (either that you filed or became aware of)? I'd like to look into each problem further.

Dear Bobjt,

I can definitely confirm that SKCropNodes with maskNodes set are now invisible in iOS9.

I have filed radar #22669900 - I have attached screenshots and a very simple project that demonstrates the issue completely reproducibly, both on devices and the simulators.


Please, if at all possible, do not let SpriteKit ship in this broken state with the iOS9 release - this is a major and clearly reproducible malfunction to an essential component of SpriteKit's functionality.

Not just you.


My game has been running happily under all the XCode 7 beta's.


It now freezes at random points - I suspect that it's related to SKEffectNode as it's not really working as it should :-(

Hello Karim,


It's not just you. My Spritekit based game is running fine under iOS 8 but does not work at all using iOS 9. I can see two major issues:


1.) Something goes wrong with the Game Center authorization, the app might crash here for an unknown reason.

2.) When the Game Center authorization worked (at least using the sandbox it does work sometimes), the game runs with a poor performance and stops working soon when running some SKActions.


At the moment I dont see any way how to fix this! Maybe I will remove my app from the store until these issues are solved.


Best regards,

Jürgen

I saw a severe degradation in physics performance from beta to GM.

There has never been a release of spritekit that was this broken imho. Something must have gone terribly wrong during QA?

same thing here. my games were fine and all was good till i tested them on Xcode 7 GM. nothing works. sprites sometime show up and then they fliker and disappear. non of the elements are in the position that they are supposed to be. and most of the actions that are hard coded through SKAction aren't firing up at all.

also the screen size which used to be managed through xcode with autolayout and using resize classes now doesnt work at all. i am wondering if this gets fixed. if not then i have to hard code everything and have two or three sets of code for each screen resolution. this is awful. if anyone finds a fix for this please offer the solution.

So after many hours of trial and error, I've managed to isolate a large number of atlas- & Actions editor-related issues down to two things:

  1. some images in my atlases which have dots (.) in their filenames.
  2. Xcode does not seem to like me having both old-style .atlas folders and Asset-catalog-based atlases in the same project.


After replacing the dots with dashes and migrating my old atlas folders, many of those issues are resolved. Is there some prohibition of "." in image filenames in texture atlases documented somewhere that I missed? Also, was there somewhere that stated not to combine old-style atlas folders and new asset catalog folders?


However, I'm still getting crashes due to PKPhysicsBodies instead of SKPhysicsBodies. I've managed various kludges to work around these, but there's one crasher that is just absolutely egregious:


I have an extension on SKPhysicsBody which provides a convenience initializer: convenience init(ovalOfSize: CGSize).

When I call this from my swift code:

let physicsBody = SKPhysicsBody(ovalOfSize: node.size)


I get the error: [PKPhysicsBody initWithOvalOfSize:]: unrecognized selector sent to instance 0x7f8a40660c40


I mean... WTH? I'm explicitly initializing an SKPhysicsBody... why should I get an error from PKPhysicsBody?


I'm also, like others, getting SKTextures which occasionally don't load. So, I have several sprites which have the same texture (in fact, they are configured identically). Some of them simply don't load, while others are working fine.

I have some problems to.
Especialy with touches event and rotations.


So many hours wasted and I still dont have any solutions, this seems very odd knowing that the GM is already out...


So no probs on iOS8, wierd behaviors on iOS9...

As a followup on the SKCropNode issue, I have managed to find a workaround. I have updated the filed radar with this info in case it helps diagnose the problem, but wanted to post it here just in case anyone runs into the same issue as a short-term "fix".


The trick, I found, was to set the maskNode property of the SKCropNode instance at the next event loop - i.e. inside a dispatch_async call for the main thread (even though the calling code IS in the main thread) For some reason, this gives SpriteKit the ability to add and "prepare" the node in some way, so when the maskNode is set, it is taken into account (while otherwise it seems to mask everything instead)


For instance in the code below, if you remove the dispatch_async block, it will simply not show anything under iOS 9 GM, while the way it is now will work.


SKCropNode *crop = [[SKCropNode alloc] init];

[crop addChild:[SKEmitterNode nodeWithFileNamed:@"MyParticle"]];

[scene addChild:crop];

dispatch_async(dispatch_get_main_queue(), ^{

crop.maskNode = [[SKSpriteNode alloc] initWithColor:[UIColor whiteColor] size:CGSizeMake(200, 200)];

});


I wonder if any of the other issues mentioned here may be similarly solvable by something like this - perhaps the regression in SpriteKit under the GMs is an optimisation that has gone wrong and gets the scene processing order confused. A few key dispatch_async blocks may help "nudge" it in the right direction perhaps. In any case, this certainly works around the issue for the broken SKCropNode, both in the sample radar project and the game I was working on as well.

There is also this bug 22672700 which I have filed about sknodes having nil parents when added inside a block.


Basically, when you remove a node and add it to a new parent in a block, it doesn't transfer touches (as child nodes should do) and it has a nil parent, even though it appears on the scene.


No current work arounds except to have a hack routine for iOS 9. Very upset about it...

Visskiss, I've seen a similar issue before that was worked around by adding the node to the parent within -update instead. To do that, I set a flag in the block, then move the node shuffling code to update after checking for that flag. Use properties, like an a array to hold the node(s) that need to be shuffled within the node hierarchy.

As a further follow-up, this seems to be fixed in iOS9 release (as opposed to GM) - i.e. version 13A344. Please note that Xcode 7 in the App Store has 13A340 in the simulators, so it persists there, but on devices it seems to be fine now.

I am completly busted , was ready to publish, in the polishing phase, assets not loading, partical effects missing, and more. I asume there will be an update asap. 😢 You are not allone.

Same here. App runs smooth on all iOS8.x but with iOS9 it crashes all the time... mostly when collision/contact is detected.


Wanted to publish the game this week but now I have to wait for Apple to fix this SpriteKit problematic...


I asume there will be an update asap.

SpriteKit is indeed VERY broken in iOS 9.


Just a quick example :

Loading a Sprite Node through imageNamed: doesn't always work, in both Texture Atlases and Image Assets. As for the Texture Atlases, it's intermittent.

My game on the App Store is very much subject to receive bad reviews because of this.