SpriteKit problems with iOS 9

I am simply adding a sprite to a scene in SpriteKit. Whenever my app is launched, i get the following error:


2015-09-19 15:39:02.318 *MY APP NAME HERE* [2569:811044] <CAMetalLayer: 0x157819ce0>: calling -display has no effect.


This causes some of my sprites to not render, but it seems to be random which ones it affects every time the scene is opened. It is only taking effect on one of the scenes in my game. I am using Xcode 7 and building on iOS 9. This did not happen on Xcode 6 when building for iOS 8. Please help, thanks.

Accepted Reply

Hey Zebon,


Your problem is probably related to zPositioning.


The behaviour has changed from IOS 9.


Previously, even if you had View.ignoresSiblingOrder = true in your viewController, sprites with the same zPosition would still render in the same order that you added them to the stack - that is the last sprite added had the highest viewing priority.


The documentation has always said that if you switch this flag on, then all sprites with the same zPosition MAY appear in random order.


Now (as of IOS 9) it seems all sprites with the same zPosition WILL appear in random order.


It's a pretty big change of behaviour for a sprite based game engine.


Please Apple, can you communicate these things.

Replies

To clarify my above post, the app builds fine in Xcode, but when the app is run, that is when the error is printed to the logs. The sprites work fine when I tap on them, but they are not rendering on the screen.

are you sure the asset was included or you are calling the right assest name?

I am having the same issue. I get this error whenever the scene renders:


2015-09-20 14:58:07.454 My app name [3965:1162436] <CAMetalLayer: 0x15d733ab0>: calling -display has no effect.


The app runs fine on the simulator however when exported to my physical phone I recieve this error. Nothing is displayed on my physical phone.


Any help would be greatly appreciated!

same issue. Am having other more important issues with Spritekit though.

Also have the same issue. It just started happening randomly.


2015-09-22 21:41:28.038 My App Name [257:8166] <CAMetalLayer: 0x15677d630>: calling -display has no effect.

I tried to remove everything from the SKScene, and also stopped loading the scene all together (just an empty view controller). Still seem to have the same problem when running it on my device. Error isn't thrown in the simulator though.

I have this problem like you. in ios 8 and xcode 6 worked without problem but in ios 9 shows log like

<CAMetalLayer: 0x15677d630>: calling -display has no effect.

also method -(void)touchbegan don't work.

i think you have a view and a 3d scenekit view on it and a overlaySKScene on your scene and multiple interaction does'nt work. right?

Same issue here. Everything was fine in iOS8 and now with iOS9 GM it doesnt render all sprites all the time:

- iPhone 6 plus and iPad air 2 - everything is renderd most of the time but from time to time it will forget one of them

- iPad mini or iPad 2 - just doesnt renders anything other than sks


This is so random and difficult find a solution for.


I am just wondering incase the prefixes have changed. For example in xcassets may be we are not supposed to use ~ipad etc anymore.

```

Same issue here. Everything was fine in iOS8 and now with iOS9 GM it doesnt render all sprites all the time:

- iPhone 6 plus and iPad air 2 - everything is renderd most of the time but from time to time it will forget one of them

- iPad mini or iPad 2 - just doesnt renders anything other than sks

```

Interesting, my sprites are all rendering, but rendering in random orders. I don't know what to say or how to even begin to debug this.

Hey Zebon,


Your problem is probably related to zPositioning.


The behaviour has changed from IOS 9.


Previously, even if you had View.ignoresSiblingOrder = true in your viewController, sprites with the same zPosition would still render in the same order that you added them to the stack - that is the last sprite added had the highest viewing priority.


The documentation has always said that if you switch this flag on, then all sprites with the same zPosition MAY appear in random order.


Now (as of IOS 9) it seems all sprites with the same zPosition WILL appear in random order.


It's a pretty big change of behaviour for a sprite based game engine.


Please Apple, can you communicate these things.

I have been having an issue where enemies (that all share the same zDepth) flickering as they pass over each other. I understand what your saying that all sprites with the same zDepth *may* appear in a random order but this can't be right. The only answer is to allow a zSpace for the enemies (maybe zDepth 10 to 50) and assign each enemy a slightly different zDepth. The simple fact of the matter is that this is either a bug or it needs changing, items added at the same zDepth should not flicker as they pass over each other, a sprite based game could have 100s of sprites trying to manage related groups to all be at a different zDepth is time consuming and annoying at best.

At a guess, your sprites are probably flickering as they appear in a random order each frame draw - upto 60 times a second 😟


I've had to do the same thing - go through every part of my game and make sure zPositions are set. It was time consuming, tedious and annoying.


It's probably not a bug as it's in the documentation.


It is, however, a pretty big change, and could have been communicated if Apple wanted to communicate with indie game developers.


Keynote speaches raving how awesome everything is.. are great. Wears pretty thin quite quickly when reality is like this.


I am probably more annoyed than I should be. I love SpriteKit. But do wish the execution was a bit better on IOS 9.

Thanks for the confimation, I appreciate that its now a "Feature" rather than a "Problem" 🙂 But I would have thought that sprites that all have the same zDepth should display without flicker. If you set two red sprites to have a zDepth of 2.0 than you expect that to stay at 2.0 and not be randomly changed at runtime. Also I would have thought that two red sprites at the same depth would be processed together into a single draw call (effectivly composited together) and therefore displayed as a single layer, there should be no flicker as they pass over each other.


Somehow Apple had this working in iOS8, and changed something to alter that in iOS9, I would have thought that making it mimic previous behaviour would have been abvisable, especially given that its such a pain trying to manage it manually.