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 😠

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.

Converted from iOS8, Xcode6 and Swift 1.2 to iOS9, Xcode7 and Swift 2 last night.


Had these issues and worked around most of them as follows (it was a late night).....


(there are some language changes that broke my Swift 1.2 code but I'm cool with that and fixed those)


SKLightnode perfromance is horrrific

-> currently disabled light nodes - no work around as yet


self.size of a node returns a negative width if you set xScale to -1 (to flip the sprite).

-> Changed code to use self.frame.width which returns a positive value


-Multi-touch was not working in touch events

-> Had to manually enable multi-touch on the scene object, which made sense, but didn't I have to with iOS8?


-When my game resigns to the background, when I re-open it, the app restarts from the beginnning. In iOS8 I had it was working fine restoring my game where it left off.

-> Need to look at this tonight.


-On another released app, I noticed that the texture are all getting squished and strectched. It looks like the sprite size isn't sizing with the texture anymore.

-> Not loaded that code up to look at yet.

I updated iOS9 and opened my (live) app to find all sprites whose images aren't in a texture atlas failing to display, sometimes replaced with white boxes. Also much reduced performance.


Apparently, sprites loaded with 'imageNamed:' need to have the .png extension. Alternatively, you can remove and re-add them to XCAssets, but I haven't tried either yet, as waiting for XCode 7 to dl.


Also to combine atlases with images in the new XCAssets, and set build target to iOS9, but this makes your app non-backwards compatible with iOS8.


Can't believe that SK is so broken. This will no doubt affect countless apps and users??

And another weird one that I'm currently digging into—as of yet can't isolate it:


I'm seeing weird behaviors around collisions, where if a node's physics body (A) is in collision with another physics body (B), it can sometimes pass directly through an adjacent physics body (C) despite A & C registering collisions with each other.


Its intermittent, but as soon as I can isolate it, I'll file the bug. Anyone else seen this one?

I should update with some more info from my original findings...


-I've filed a bug for self.size returning negative values if xScale is set to -1


-SKLightNode perfromance is *really* bad in iOS9. There appear to be no work arounds, so I've disabled them all and hopefully these will be fixed in next iOS update. I'll file a bug report for this.


-Multi-touch appears to be disabled by default in projects now. So if you use multi-touch make sure you set the option.


-My app lrestarting when re-opening I found only happening on iPads. It turns out it is the new mult-tasking in iOS9. I just needed to set a new option, so that my game app only runs full screen. This sorted it.


Hope this helps anyone with similar issues.

Bug tracker: 22416124

Sprite Kit Scene Editor bug with Sprite Atlases in Assets Catalog


Basically I used the same process than DemoBots and even in DemoBots this bug exists.


Case 1: You made: @2x, @3x, ~ipad & @2x~ipad and put it on Asset Catalog Sprite Atlas. Xcode 7 puts every image right in place. Drag and drop to SKS Scene Editor and editor creates an SKSpriteNode with the ~ipad image in the texture field. Build and Run on iPad and error: image ~ipad does not exists. Build and Run on iPhone, image blank and no error.

But, when you change manually the texture name to primitive name without any ~ipad or something, sprite change to @2x from iPhone, smaller, and display correctly on iPhone but in iPad is blank square.

Case 2: You made @2x~iphone, @3x~iphone. ~ipad & ~2x~ipad and put it on Asset Catalog Sprite Atlas. Xcode 7 puts every image right in place. Drag and drop to SKS Scene Editor and creates an SKSpriteNode with the ~ipad image in the texture field. Build and Run on iPad and error: image ~ipad does not exists. Build and Run on iPhone, image blank and no error.

But, when you change manually the texture name to primitive name without any ~ipad or ~iphone, sprite works perfectly in editor and works well on iPhone but in iPad makes a blank square.


How I fix it: not using the new Asset Catalog. I use exactly the same files, but in .atlas folder using the older method. If you prepare the files exactly like the new assets catalog needs, but uses the old .atlas folder, everything goes well. When you make a drag & drop to the SKS texture name is ~ipad, but there's no error on any device and images works perfectly.


Please, Mr. Bobjt, we need to use the new App Slicing but we can't do it. By the way, if you use only Universal Assets @1x, @2x, @3x everything works well.


Thanks in advance for your tremedous effort and new incredible features for SpriteKit. Hope this bug will fix it soon.

I just tried my ready-to-go app on an ios9 device and EVERYTHING is broken.


freezes, framerate drops, stuff goes invisible/comes back etc.

So what are you guys going to do? Even if Apple fix all of this in 9.1, some users will remain on 9.0 and the bugs will reflect badly on the developer.


Admitedly I have not tried to go through all the bugs yet, or the work-arounds in this thread. Guess I'm a bit deflated having to deal with this so close to releasing an app.

I'm seeing this as well, but only on devices below the iPhone 5s.


iPhone 5, iOS 8.4 - everything works great.

iPhone 5, iOS 9 - Nothing that's in the asset catalog appears anywhere.


iPhone 5s and higher, iOS 8.4 or iOS 9 - this works fine.


I'm not sure what I'm going to do about that...

For me, "luckily" I'm not as far along on this project as I'd like to be (took a little "Swift 2.0" detour), so I'm not ready to release yet, and its a new project, and a personal side-project, so I don't need to worry about existing sales. However, this is a real disaster for people whose apps are in the wild or on a release schedule.

I hope there will be a kind of workaround. iOS 9.0 may not work well, but new version of Xcode may probably built the app the way it works well on a broken OS.


Otherwise it's really, really bad.

Just me, or SpriteKit in GMs terribly broken?
 
 
Q