Why isn't setting frameInterval on SKView working?

I am trying to reduce the frame rate to 30 FPS. The official documentation says:

skView.frameInterval = 2;

      

I have read all the docs available as well as every similar question asked here on stackoverflow or other pages / blogs, etc. I tried this in various ways, but wherever I tried to set the property, it had no effect on the FPS.

I am not using any other synchronization mechanisms other than those provided by SpriteKit. I install it according to the documentation and answers here on Stackoverflow.

I even ran a basic SpriteKit template with Xcode and tried to set the frame rate property, but even that didn't work.

Does anyone have any similarities? Is there an alternative way to reduce the max fps? What else can I try to reduce the FPS?

BTW: I am working on OS X and have the first Retina Macbook Pro - is it a hardware issue?

EDIT:

I am not overriding the method -(void)update:

- only-(void)didSimulatePhysics

This is what I am doing in a subclass of NSViewController that I have set in Interface Builder. self.spriteKitView

is the output for NSView

my NSViewController

-Subclass

-(void)setupSpriteKitView {

    self.spriteKitView.frameInterval = 2;
    self.spriteKitView.ignoresSiblingOrder = YES;
    self.spriteKitView.showsFPS = YES;
    self.spriteKitView.showsDrawCount = YES;
    self.spriteKitView.showsNodeCount = YES;
}

-(void)viewDidLoad {

    [super viewDidLoad];
    [self setupSpriteKitView];
    [self loadStartupScene];
}

      

I even tried to put this in my SKScene-Subclass, attach it as a custom property inside the Interface Builder to the SKView.

How am I not working now? In both my game and Xcode template, the debug output says 60 FPS. And even when zoomed out, the skView.frameInterval = 4

animation remains smooth.

+1


source to share


1 answer


Ok! Since hours of work on this, figuring out what I am doing wrong, I tested the Xcode SpriteKit template. Surprisingly, even this Apple code sample is not responsive to the property skView.frameInterval

.

So, I was thinking about a hardware error and searched the Apple forums for that. I found several people complaining about the same problem and surprisingly Apple knows about this FPS-Bug and will fix it in Elite Captain ... Hopefully ... I'm going to check out dev prerelease!

However , SpriteKit has a few more bugs in os x ! For example, when switching a window to full screen mode, FPS drops sporadically by the amount of undefined. It messed up a bit!



EDIT:

Thanks to @EpicByte I found several reasons and answers. See his explanation in the comments above!

0


source







All Articles