Low FPS on iOS Simulator SpriteKit

Christian

I've found a strange behaviour on the Xcode 6 iOS Simulator.

Even with just a menu showing in my GameScene, the Simulator FPS area really low at around 20 FPS.

Are there any known issues, which could cause this issue? Also when I start my game itself, it drops from around 30FPS to 19 FPS immediately.

Here my code which is loaded at startup:

 override func didMoveToView(view: SKView) {
        var sud:NSUserDefaults = NSUserDefaults.standardUserDefaults()

        if(sud.valueForKey("highscores") != nil){
            highScores = sud.valueForKey("highscores") as [Int]
        }else{
            highScores = [0, 0]
            sud.setValue(highScores, forKey: "highscores")
        }

        createColors()
        createStartMenu()  
    }


func createColors(){
        colorArray = [
            ColorClass(name: "greenSea", color: greenSea),
            ColorClass(name: "emerald", color: emerald),
            ColorClass(name: "peterRiver", color:peterRiver),
            ColorClass(name: "amethyst", color:amethyst),
            ColorClass(name: "wetAsphalt", color:wetAsphalt),
            ColorClass(name: "sunFlower", color:sunFlower),
            ColorClass(name: "carrot", color:carrot),
            ColorClass(name: "pumpkin", color:pumpkin),
            ColorClass(name: "alizarin", color:alizarin),
            ColorClass(name: "pomeGranate", color:pomeGranate),
            ColorClass(name: "clouds", color:clouds),
            ColorClass(name: "asbestos", color:asbestos)]

    }

func setSceneBackground(){
    var background = SKSpriteNode(color: myBackgroundcolor, size: CGSizeMake(self.frame.width, self.frame.height))
    background.position = CGPointMake(self.frame.width/2, self.frame.height/2)
    self.addChild(background)
}



  func createStartMenu(){
        self.removeAllChildren()
        setSceneBackground()
        reset()

        var background = SKSpriteNode(color: myBackgroundcolor, size: CGSizeMake(self.frame.width/1.2, self.frame.height/1.5))

        background.position = CGPointMake(self.frame.width/2, self.frame.height/2)

        var buttonSize:CGSize = CGSizeMake(background.size.width - 20, background.size.height/4 - 15)
        background.setScale(0)

        var alizarin = UIColor(rgba: "#e74c3c")
        playLevelsButton = SKSpriteNode(color: alizarin, size: buttonSize)
        playLevelsButton.position.y = buttonSize.height + buttonSize.height/2 + 15

        var fontSize = buttonSize.height/2

        playLevelLabel = SKLabelNode()
        playLevelLabel.fontSize = fontSize
        playLevelLabel.text = "Easy"
        playLevelLabel.name = "playLevelLabel"
        playLevelLabel.fontName = myFont
        playLevelLabel.zPosition = 1
        playLevelLabel.verticalAlignmentMode = SKLabelVerticalAlignmentMode.Center
        playLevelsButton.addChild(playLevelLabel)

        var carrot = UIColor(rgba: "#e67e22")
        playMoreDifficultButton = SKSpriteNode(color: carrot, size: buttonSize)
        playMoreDifficultButton.position.y = buttonSize.height/2 + 5

        playMoreDifficultLabel = SKLabelNode()
        playMoreDifficultLabel.text = "Difficult"
        playMoreDifficultLabel.fontName = myFont
        playMoreDifficultLabel.fontSize = fontSize
        playMoreDifficultLabel.name = "playMoreDifficultLabel"
        playMoreDifficultLabel.verticalAlignmentMode = SKLabelVerticalAlignmentMode.Center
        playMoreDifficultButton.addChild(playMoreDifficultLabel)

        var sunFlower = UIColor(rgba: "#f1c40f")
        howToPlayButton = SKSpriteNode(color: sunFlower, size: buttonSize)
        howToPlayButton.position.y = -buttonSize.height/2 - 5

        howToPlayLabel = SKLabelNode()
        howToPlayLabel.text = "How To Play"
        howToPlayLabel.fontSize = fontSize
        howToPlayLabel.fontName = myFont
        howToPlayLabel.name = "howToPlayLabel"
        howToPlayLabel.verticalAlignmentMode = SKLabelVerticalAlignmentMode.Center
        howToPlayButton.addChild(howToPlayLabel)

        var emerald = UIColor(rgba: "#2ecc71")
        highScoreButton = SKSpriteNode(color: emerald, size: buttonSize)
        highScoreButton.position.y = -buttonSize.height - buttonSize.height/2 - 15

        highScoreLabel = SKLabelNode()
        highScoreLabel.text = "Highscore"
        highScoreLabel.fontSize = fontSize
        highScoreLabel.fontName = myFont
        highScoreLabel.name = "highScoreLabel"
        highScoreLabel.verticalAlignmentMode = SKLabelVerticalAlignmentMode.Center
        highScoreButton.addChild(highScoreLabel)

        //Names
        playLevelsButton.name = "playLevels"
        playMoreDifficultButton.name = "playMoreDifficult"
        howToPlayButton.name = "howToPlay"
        highScoreButton.name = "highScore"

        background.addChild(playLevelsButton)
        background.addChild(playMoreDifficultButton)
        background.addChild(howToPlayButton)
        background.addChild(highScoreButton)
        self.addChild(background)
        background.runAction(SKAction.scaleTo(1, duration: 0.3))
    }

 func reset(){
        correctColors = []
        tileArray = []
        tempArray = []
        amountCorrect = 0
        tapped = 0
        gameStarted = false
        maxTime = nil
        timeStamp = 0
        tileFrameSize = nil

        searchColor = nil

        tileColors = []

    }
rickster

SpriteKit uses OpenGL ES for GPU-accelerated rendering on a device. In the iOS Simulator, OpenGL ES support is provided by a software renderer. As such, any use of OpenGL ES — whether by itself or via SpriteKit or SceneKit — has very different performance characteristics on the simulator versus on an actual device.

Never rely on the iOS Simulator for performance measures, especially when anything GPU-related is involved.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

AMD Crimson driver low fps Ubuntu 15.10

분류에서Dev

iOS 7 : SpriteKit GestureRecognizer

분류에서Dev

Why do I have low FPS unless root?

분류에서Dev

Swift NSLocale Simulator iOS 8

분류에서Dev

iOS simulator is inconsistant to the preview in Xcode?

분류에서Dev

iOS Endless Runner Lag SpriteKit

분류에서Dev

Installed Nvidia drivers 384 and screen flickering on dark backgrounds plus low FPS

분류에서Dev

iOS-Simulator에서 충돌

분류에서Dev

iOS-Simulator에서 충돌

분류에서Dev

iOS styling UITabBar only works on simulator

분류에서Dev

ios simulator - where is settings>notifications>appname?

분류에서Dev

Ok in simulator but throwing exception in ios device

분류에서Dev

How to stop iOS simulator hiding xcode

분류에서Dev

ios simulator can't scroll to bottom

분류에서Dev

TouchedEnded over TouchesBegan-Swift iOS SpriteKit

분류에서Dev

ios-Swift 2.2-SpriteKit-SpriteKit으로 비디오 루핑

분류에서Dev

Why Does AdMob Free Crash My App in the iOS Simulator?

분류에서Dev

Click doesnt work on iOS 8 simulator [Xcode 6.0.1]

분류에서Dev

web view loading in simulator but not loading in my device (ios 8)

분류에서Dev

Low memory warning causes a crash on iOS5 - unloadViewForced

분류에서Dev

iOS SpriteKit 이미 터 입자 주파수

분류에서Dev

iOS SpriteKit make random moving of sprites and something like collision in space

분류에서Dev

iOS SpriteKit 겹치는 SKSpriteNodes / 이미지

분류에서Dev

SpriteKit을 사용하는 iOS 9.3의 NSInvalidUnarchiveOperationException

분류에서Dev

시뮬레이터에 여전히 노드 수와 FPS가 표시되는 이유는 무엇입니까? [SpriteKit]

분류에서Dev

ios8 작업 중 ios7에서 Spritekit SKPhysicsBody 충돌

분류에서Dev

터미널 명령 'open -n -a "iOS Simulator"'를 사용하여 여러 iOS Simulator.app 실행

분류에서Dev

Firebase Phone Auth is not working in flutter app neither in iOS simulator nor in a real device

분류에서Dev

I am Trying to run a titanium project in ios simulator but getting some node error

Related 관련 기사

  1. 1

    AMD Crimson driver low fps Ubuntu 15.10

  2. 2

    iOS 7 : SpriteKit GestureRecognizer

  3. 3

    Why do I have low FPS unless root?

  4. 4

    Swift NSLocale Simulator iOS 8

  5. 5

    iOS simulator is inconsistant to the preview in Xcode?

  6. 6

    iOS Endless Runner Lag SpriteKit

  7. 7

    Installed Nvidia drivers 384 and screen flickering on dark backgrounds plus low FPS

  8. 8

    iOS-Simulator에서 충돌

  9. 9

    iOS-Simulator에서 충돌

  10. 10

    iOS styling UITabBar only works on simulator

  11. 11

    ios simulator - where is settings>notifications>appname?

  12. 12

    Ok in simulator but throwing exception in ios device

  13. 13

    How to stop iOS simulator hiding xcode

  14. 14

    ios simulator can't scroll to bottom

  15. 15

    TouchedEnded over TouchesBegan-Swift iOS SpriteKit

  16. 16

    ios-Swift 2.2-SpriteKit-SpriteKit으로 비디오 루핑

  17. 17

    Why Does AdMob Free Crash My App in the iOS Simulator?

  18. 18

    Click doesnt work on iOS 8 simulator [Xcode 6.0.1]

  19. 19

    web view loading in simulator but not loading in my device (ios 8)

  20. 20

    Low memory warning causes a crash on iOS5 - unloadViewForced

  21. 21

    iOS SpriteKit 이미 터 입자 주파수

  22. 22

    iOS SpriteKit make random moving of sprites and something like collision in space

  23. 23

    iOS SpriteKit 겹치는 SKSpriteNodes / 이미지

  24. 24

    SpriteKit을 사용하는 iOS 9.3의 NSInvalidUnarchiveOperationException

  25. 25

    시뮬레이터에 여전히 노드 수와 FPS가 표시되는 이유는 무엇입니까? [SpriteKit]

  26. 26

    ios8 작업 중 ios7에서 Spritekit SKPhysicsBody 충돌

  27. 27

    터미널 명령 'open -n -a "iOS Simulator"'를 사용하여 여러 iOS Simulator.app 실행

  28. 28

    Firebase Phone Auth is not working in flutter app neither in iOS simulator nor in a real device

  29. 29

    I am Trying to run a titanium project in ios simulator but getting some node error

뜨겁다태그

보관