1

My problem is that my GameScene starts with about double the nodes and draws count and 40 fps for several seconds. This problem appears only on my iPad (mini retina) while on my iPhone (5) the game runs smoothly from the start although the nodes are still a lot more than what it should be

  • 1
    You need to post code to have people help with your problems. – Knight0fDragon Jan 17 '16 at 18:29
  • Well, the problem is that I can't figure out which part of the code can generate more sprites than there are on the scene. I mean, on average my game scene has 25 nodes and 12-13 draws but on start it counts 40-45 nodes and 25 draws. On iPhone it gets normal quickly while on iPad it stays 40 fps even for all the game time – Carlo Blasi Jan 17 '16 at 18:45
  • 1
    Your problem is when you start the game, you post the code that has to do with the start of the game – Knight0fDragon Jan 17 '16 at 18:46

2 Answers2

0

This 40fps problem is an issue within the iOS frameworks. It's created by some kind of throttling (by iOS).

Perhaps this throttling was designed to give a more consistent experience for an app struggling to maintain 60fps. But nobody knows.

Apple has never commented on it.

It became prevalent throughout the rollout of iOS 9 in Scene Kit, Sprite Kit and Metal. But has been seen within OpenGL ES locked projects, too.

However it was noticed in previous versions of iOS, too. Particularly within apps/games using CADisplayLink.

//Don't worry about those asking for code, you're right in your assumption that something is wrong that's not pertinent to your code.

Here's a deeper examination of a similar issue (probably from the same route cause) within Scene Kit: Inconsistent SceneKit framerate

Community
  • 1
  • 1
Confused
  • 6,048
  • 6
  • 34
  • 75
  • Thanks for your answer, I tried removing the SKActions that were called within the didMoveToView method but the problem is still there, is there anything I can do to solve it? – Carlo Blasi Jan 18 '16 at 11:02
  • Can you prove this from an outside source? I have never experienced any throttling issues due to the hardware or even to the framework. Chances are, the code is just written poorly, and is doing things that take up more than 1/60th of a second. (Remember a lot goes on in the update loop that you have no control over, so you only want to do the bare minimum inside of it) – Knight0fDragon Jan 18 '16 at 13:21
  • @Knight0fDragon If you've seen this problem you know what it is, and that it's possible with template files with minimal content and no extra code. If you haven't seen it, consider yourself blessed. – Confused Jan 18 '16 at 22:15
  • @carlb Probably not. Other than wait for Apple to acknowledge it and then fix it. I'll link a few here: http://stackoverflow.com/questions/27318579/spritekit-seemingly-at-random-drops-to-40-fps – Confused Jan 18 '16 at 22:18
  • And the mother of all complaints about Sprite Kit: https://forums.developer.apple.com/thread/17463?tstart=0 – Confused Jan 18 '16 at 22:23
  • 1
    @Knight0fDragon I have no code inside of the update function – Carlo Blasi Jan 19 '16 at 12:25
0

Also got a problem with low FPS at the start (when using spritekit and uikit together ) I used xib with SKView and for me the solution was to add a dependency to the scene in the 'attribute inspector' like at the picture below:

enter image description here

Arkady
  • 1,178
  • 14
  • 35