SpriteKit Perfomance

I noticed some performance issues with SpriteKit on iOS 9 beta 5 (at least on older devices).


My code on iOS 8.x runs at 60 FPS, but on iOS 9 beta 5 runs at ~30 FPS.

On the previous iOS 9 betas, the code ran at 60 FPS.


Does anybody else have the same issues?


My development devices are an iPad (4th generation) and an iPhone 4S. I don't have a newer device to test on.


Thanks,

Josh

I'm don't know what the problem is but it's definitely related to UIView Animations.


I see the same thing as everyone else. When I present a UIView over top of my scene, the CPU usage drops from 70% to 30% and stays at 30% even when I dismiss the view. If I then press the home button and then resume the app, it goes back to 70% and 60 FPS.


Really frustrating as it didn't happen prior to iOS 9.

It's not just that. This problem exists across Sprite Kit, Scene Kit and Metal without any other intervening views, and even when setting Scene Kit to use OpenGL.


The problem is something much more intrinsic to iOS than using UIView Animations - it can be made to happen (repeatedly) with the base template of Scene Kit, just a jet model spinning in the middle of the screen.


iOS is setting something, flagging something to itself, that it should cap performance at 40fps, and then spoofing the CPU/GPU to pretend they're busy enough for long enough to stablise at 40fps.


Why? Why is it not admitted to?


Why is there no discussion about this that focuses on the fact that it's across APIs and Frameworks?


Because each developer only cares about his own situation....

And my axe..


Yep same here, every now and again randomly during gameplay, the framerate will suddenly drop to 40fps (it's always this exact fps) and then stabilises there as if it has been capped by iOS. I can pause my game (pauses game scene and physics engine) and wait a couple of seconds, then un-pause and it will go back to 60fps.


For fast moving scrolling games it's annoying at best as 40pfs for a smooth fast scroller looks a choppy mess.


I can get about 70% reproduction of this by simplying turning the physical volume up/down on the iPad - it triggers this sudden frame lock.


Thankfully my game isn't ready for release until early next year, so fingers crossed this gets sorted before then!


Apple - any chance of "reaching out" and letting us know why iOS is doing this and if there is anything we can do to prevent it kicking in?

I've got reply with request to attach stackshots.

I did it, and waiting for a response for 8 days.

I've just done some googling. Thought I'd see if this issue was around prior to iOS 9.


It was nowhere near as prevalent as it is now, but this exact same issue has been popping up for anyone using CADisplayLink since at least 2010.


At the exact same rate... 40fps.


Obviously it's really annoying to have to wait for moderators to approve links, so I leave it up to you to add keywords like CADisplayLink and 40fps variants into Google to find what I'm talking about.


And it really is in very different scenarios. Some guys even isolated it in super simple apps to demonstrate it. But no solution.


So... apple. What is this about?

I logged a number of bugs two weeks ago and not a single one has been acknowledged yet. I no longer log bugs.


Apple Staff are quick to jump into this forum to ask for information and examples but provide no other information in return. No hard feelings, they are just doing as they're told.


My project is still on hold and I will most likely miss a deadline at the end of the month.


I look forward to Apple fixing SpriteKit so I can finish my project and never use it again.😝

If you create a new game, using Xcode's Sprite Kit template, and add a SKCropNode instead of a spinning spaceship, it's easy to replicate the problem. Code attached.


On iOS 8, you can add 100 + ships without any issues - 60 fps, even on an old iPad 2.


On iOS 9 you can add about 25 before the fps drops to <30, on a new iPhone 6.


*ahem* Apple devs... HELLO???!!! Are you there? Are you listening? Yes, I've submitted a bug, with screenshots and example programs. Bug number

23069832


I realise that some games are affected more than others, but in my case, my live game has dropped from a steady, stable 60 fps on all devices, to an unplayable and crashing 15 fps. I have been working on this game for 2 years and put all my time, money and soul in to it. And now iOS9 has ganked it, and Apple are seemingly IGNORING the issue.


Trying hard to remain calm. Apple, could you please comment


-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    / Called when a touch begins */
  
    for (UITouch *touch in touches) {
        CGPoint location = [touch locationInNode:self];
  
        SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"Spaceship"];
        sprite.xScale = 0.5;
        sprite.yScale = 0.5;
        sprite.position = location;
  
        SKCropNode *cropNode = [[SKCropNode alloc] init];
        SKSpriteNode *mask = [SKSpriteNode spriteNodeWithColor:[UIColor blackColor] size:CGSizeMake(100, 100)];
        mask.position = sprite.position;
        [cropNode setMaskNode:mask];
        [cropNode addChild:sprite];
        [self addChild:cropNode];
    }
}

Just jumping in to say I'm having the same problem, I've also filed a bug 23083969. Thanks for the awesome sample project, much easier when it's already isolated for you!

Hello Digicub.


Bug report filed.


i am getting the following result with your sample code

____________________________________

iPad Air 2 - iOS 9.1 Beta 5



69 nodes : 55.3 fps
93 nodes: 30 - 36 fps
207 nodes 20.0 fps
237nodes : 18.0 fs
267 nodes : 15fps
429 nodes : 10.0fps
1404 nodes: 3.0 fps


/Indiedeveloper

Same problem here with my game I notes higher CPU load as well and frame droping, I also tested demo game of Apple "Adventure" the frames drops to 12 fps on iPod5! 😮

hope Apple will fix this soon 😟

I just tried the "Adventure" game in iOS 9 on an iPhone 5, I'm getting around 30 fps. I don't remember what it performed like in iOS 8 so I can't comment on that. On an iPhone 6 with iOS 8 it runs at consistant 60 fps though.


There is a pretty big difference at the main menu. In iOS 8 the number of nodes is around 150 and the number of draws are 29. The exact same project running in iOS 9 shows 259 nodes and 131 draws...and about half the framerate (though the two devices aren't the same so it's not a fair comparison).


Visually they look the same though.


Back to the waiting game I guess....

I've installed iOS 9.1 beta 5 on my iPad Air and I don't seem to get the random drops to 40fps anymore.


In iOS 9.0 I could force it to happen by just pulling control center up, caused the 40fps everytime. It doesn't happen in 9.1 beta 5.


So it seems that the 40fps problem is solved in 9.1. Hopefully customers will upgrade to 9.1 as soon as it comes out.

I don't know if this problem is solved or not, but I experience the same issue here. I have already opened a ticket (23026593) and gave the steps to reproduce the problem:


Steps to Reproduce:

1. Create a new project --> iOS/Game

- Language: Objective C

- Game technology: SpriteKit

- Devices: Universal

- Without unit and UI tests


2. Run the application on the device by pressing Cmd + R


3. Pull up and down the Control Center 1 to 4 times. After each try check the frame rate.


And voila, the default project runs on 40 FPS.

I am still seeing the 40fps problem in 9.1 beta 5. I don't have any SKEmitters or SKCropNodes in my game. I am only using SKShapeNodes.

I have the same issue with performance after updating to iOS9. My game runs at 60fps and sometime goes up to 60.2, now it just keeps going down and down and down. One example is the simple game menu I have which lists the levels, this one never went down below 60fps before the update; now, it's running at 30-40fps after the update! There is definitely broken in SpriteKit with the new update. I just hope that Apple issue a fix as soon as possible or tell us a work around in the mean time!


Thanks!

SpriteKit Perfomance
 
 
Q