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

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.

Did not think of that (XCode somehow working around iOS bugs) !


Anyway, despite my complaints I have to admit I've gotten my game to almost back to where it was. I've submitted 7 bug reports and littered the code with "if ios9" statements, but it works.


The major missing feature now is the lighting, which I was using liberally to make it look more snazzy, but at least some people will see it (ios 8 users). Maybe they'll do us a favor and SKLightNode is 2x faster in iOS 9.1 than iOS 8.x (instead of 4x slower)

I am seeing a ton of issues with my app as well:


  • Changed zPositions
  • Animations running too fast
  • Changed touch detection. Touches of hidden sprite nodes are not getting detected anymore. Setting alpha to 0.0 does not work either. You have to set it to something like 0.001 to make it work again.
  • Texture Preloading of Sprites in an xcassets catalog leads to most of the sprites being invisible


Hope to see some more documentation for the breaking changes, soon. Any help on fixing the above errors is appreciated

I was excited when I saw in XCode 7 you can put texture atlases in the asset catalog (instead of the old way, in .atlas folders, outside of the asset catalog).


So I moved all my texture atlases to the Asset Catalog, and my excitement wore off when I found in my testing a huge degradation in peformance. Specifically, instantiating the SKTextureAtlas with


self.myAtlas = [SKTextureAtlas atlasNamed:...];


and then referencing that atlas to fill an array of frames using code in a loop such as


[self.myTextureArray addObject:[self.myAtlas textureNamed:...]];


This is all before I preload the textures. But the ensuing pre-load does not seem to suffer a performance degradation. It's instantiating the SKTexture instances which is waaaay slower when using the atlas in the asset catalog. So my fix is to go back to using .atlas folders and skip the asset catalog for this, which is a shame, because App Slicing uses the Asset Catalog to make thinner downloadables...

have a equal problem 😟

apple, whan we can get the fixes?

Maybe this will help someone - here are the issues that impacted me the most and their respective bug report numbers:


  • 22803714 - Sprite Kit: after parent shuffling, node no longer passes touch events
  • 22806689 - Sprite Kit: after changing a node's parent, it reports its parent as nil (probably related to the one above)
  • 22819759 - Sprite Kit: textures not loaded from texture atlas (when an .atlas container in the project folder has the same name as some single texture in the asset catalog)
  • 22820879 - Sprite Kit: SKEmitter not visible with targetNode set
  • 22821166 - Sprite Kit: SKCropNode + SKEmitterNode cause a big performance drop, the emitter is not visible
  • 22821479 - Sprite Kit: size getter returns an invalid value for negatively scaled sprites


And I'd like to encourage everyone to report your issues using the Bug Reporter to get the ball rolling. 😎