Sprite kit iOS模拟器SpriteKit上的低FPS

Sprite kit iOS模拟器SpriteKit上的低FPS,sprite-kit,ios-simulator,frame-rate,Sprite Kit,Ios Simulator,Frame Rate,我在Xcode 6 iOS模拟器上发现了一个奇怪的行为 即使在我的游戏场景中只显示一个菜单,模拟器的FPS区域也非常低,大约为20 FPS 是否存在任何可能导致此问题的已知问题? 另外,当我开始我的游戏时,它会立即从30帧左右下降到19帧 下面是我在启动时加载的代码: override func didMoveToView(view: SKView) { var sud:NSUserDefaults = NSUserDefaults.standardUserDefaults()

我在Xcode 6 iOS模拟器上发现了一个奇怪的行为

即使在我的游戏场景中只显示一个菜单,模拟器的FPS区域也非常低,大约为20 FPS

是否存在任何可能导致此问题的已知问题? 另外,当我开始我的游戏时,它会立即从30帧左右下降到19帧

下面是我在启动时加载的代码:

 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 = []

    }

Sprite套件模拟器存在已知问题。。。这是误导。我的游戏在一台设备上运行60帧每秒,在模拟器上最高运行30帧每秒


人们将在设备上玩游戏,而不是在模拟器中,因此请进行相应的测试。

Sprite Kit模拟器存在已知问题。。。这是误导。我的游戏在一台设备上运行60帧每秒,在模拟器上最高运行30帧每秒


人们将在设备上玩游戏,而不是在模拟器中,因此请进行相应的测试。

SpriteKit使用OpenGL ES在设备上进行GPU加速渲染。在iOS模拟器中,OpenGL ES支持由软件渲染器提供。因此,OpenGL ES的任何使用——无论是单独使用还是通过SpriteKit或SceneKit使用——在模拟器上的性能特征与在实际设备上的性能特征都非常不同


永远不要依赖iOS模拟器来衡量性能,尤其是当涉及任何与GPU相关的东西时

SpriteKit使用OpenGL ES在设备上进行GPU加速渲染。在iOS模拟器中,OpenGL ES支持由软件渲染器提供。因此,OpenGL ES的任何使用——无论是单独使用还是通过SpriteKit或SceneKit使用——在模拟器上的性能特征与在实际设备上的性能特征都非常不同


永远不要依赖iOS模拟器来衡量性能,尤其是当涉及任何与GPU相关的东西时

我有11帧。你真幸运。我的手机在iPhone 5上的速度是13帧/秒,我的速度是11帧/秒。你们真幸运。我的手机在iPhone 5XCode 9上运行每秒13帧。我的FPS=1,打开DEBUG>opensystemlog,看到大量这样的消息:“com.apple.CoreSimulator.SimDevice.B9A5D2AF-5251-4F7A-8D00-DAF75203390A[4949490](com.apple.videosubscriptionsd):服务只运行了0秒。将respawn推出10秒。”XCode 9。我的FPS=1,打开DEBUG>open System Log,看到大量这样的消息:“com.apple.CoreSimulator.SimDevice.B9A5D2AF-5251-4F7A-8D00-DAF75203390A[4949490](com.apple.videosubscriptionsd):服务只运行了0秒。将respawn推出10秒。”