120 FPS in Xcode Debug Navigator vs ~60 FPS in SKScene - Swift

时间:2017-11-13 06:15:30

标签: swift xcode sprite-kit frame-rate skscene

I'm building a SpriteKit game and have had a minor lag that I can't get to fully go away. CPU usage tends to vary, however, I see this lag regardless of whether CPU usage is >40% or <20%.

I've combed through the code to try to make it as efficient as possible (e.g., reusing nodes, hardcoding values, optimizing conditionals, etc.) and I'm about out of ideas.

I've noticed this difference between the FPS per the debug tool (120 FPS) and what I see within the SKView (~60 FPS, but never lower than about 58 FPS). My thought was that maybe the view controller running at a higher FPS is somehow stealing resources from the SKScene. I've messed around with preferredFrameRate, trying to set it to 120 in the SKScene (I don't think I can set it on the view controller) but that didn't change the rate on SKScene.

I'm using an iPhone 6s, so not exactly the newest iPhone, but I also downloaded another ball bounce game, One More Brick, and there's basically no lag whatsoever, so I don't think it's my phone.

Anyone familiar with this issue?

enter image description here

0 个答案:

没有答案