Memory Issue

This topic contains 18 replies, has 2 voices, and was last updated by  CartoonSmart 3 weeks ago.

  • November 21, 2017 at 3:47 pm #176328

    iPad Air 2 64GB
    isOS 11.1.1
    Platform kit 1.72

    My platformer was working fine with two levels, you could keep playing forever cycling between the two. I added a third level and now the second level won’t load with this error:

    NOTE ——
    setup button1
    will look in the root for Players dictionary
    Player1
    Message from debugger: Terminated due to memory issue

    App runs fine in 256GB iPhone7. I haven’t had time to dig into the code, but how are resources managed in regards to memory usage? Were all assets and atlases loaded into memory at once?

    TIA !

  • November 21, 2017 at 3:54 pm #176329

    Nah, SpriteKit is only going to load what’s called for in the Scene (the .sks file). Keep in mind, all the kits are built with Sprite Kit, so there’s nothing going on under the hood memory wise that isn’t managed by the core framework.

    You might see a resource spike when transitioning between scenes because temporarily both scenes exist at once (the outgoing and the incoming). But I’ve never seen a crash because of that. You might see a frame rate slow down, depending on the transition effect.

    You said the app runs fine in your iPhone 7. Does that mean it crashed on a different device?

    • November 21, 2017 at 4:02 pm #176331

      Ahh, sorry, didn’t see the initial specs.

      So I’ve got two apps in the store with that kit that have far more than 3 levels (20 or so). I’m not saying a memory issue can’t crash it, but its not something thats going to occur just because you have a lot of scenes.

      Did you import in a really big background image maybe?

      Also give me a second, I can give you a few lines of code you could use to force-clear out all the sprites from the outgoing scene early. Might help.

  • November 21, 2017 at 3:56 pm #176330

    Yes it crashed on the iPad I described in my first post.

  • November 21, 2017 at 4:04 pm #176332

    Thanks!

  • November 21, 2017 at 4:08 pm #176333

    Actually, this is bit of code is almost already implemented in the kit. In the GameScene.swift file. Search for cleanUpScene()

    Then within that function find…

    for node in self.children {
                
                node.removeAllActions()
                
                
            }

    Change it to..

    for node in self.children {
                
    node.removeAllActions()
    node.removeFromParent()  //so just add this line
                
                
            }

    It will make for a more abrupt transition of the outgoing scene since it’s removing all the children of that scene immediately, then presenting the new scene. So you might want to also search for…

    self.view?.presentScene(scene, transition: SKTransition.fade(with: SKColor.black, duration: 2) )

    And just shorten the transition duration.

    But if that doesn’t do the trick, its either going to be an issue with an unusually big asset that got imported, or Apple is just completely f***ing over devices 3 years old =)

  • November 21, 2017 at 4:17 pm #176335

    I am working on it, the code to remove from parent didn’t work I am rechecking my resources.

  • November 21, 2017 at 4:20 pm #176338

    Did you try running without it plugged into Xcode debugging it?

  • November 21, 2017 at 4:23 pm #176339

    Yep same problem, my largest asset is a background that is 512×512

  • November 21, 2017 at 4:25 pm #176340

    Something odd is going on then. Just fired up my kid’s even older iPad to play Horde 2 and it was running smooth as ever. Also on iOS11 (built with the kit)

    You restart the iPad? Clear out the bad mojo =)

  • November 21, 2017 at 4:27 pm #176341

    Restarted my mac and iPad without success, I going through my project now shrinking some of my backgrounds.

  • November 21, 2017 at 4:31 pm #176342

    Ripped out all the backgrounds and still crashes

  • November 21, 2017 at 4:44 pm #176346

    My project is toast, ripped out the third level, back to where it was working and the second level still doesn’t load without crashing

  • November 21, 2017 at 5:15 pm #176347

    Feel free to send me the project and I can test on a more recent iPad. I can at least make sure it’s working normally. (You could also submit a Test Flight and add me as a tester)

    I wouldn’t rule out Apple could have introduced something in iOS11 that only chokes up older devices with Sprite Kit. That’s obviously annoying but I wouldn’t let it stop you though either. You can still test on your iPad by starting directly into the level you are building.

    Just curious, did you change the Deployment Target at all? I think I left it at iOS 10.2.

    Also have you tried Cleaning the Build Folder (Hold down option) and go to Product > Clean Build Folder.

  • November 21, 2017 at 5:24 pm #176348

    Were do I send it?

  • November 21, 2017 at 5:34 pm #176349

    Can I get a refund?

  • November 21, 2017 at 5:58 pm #176352

    Zip up everything you’ve got so far and email me at cartoonsmart@mac.com with a Dropbox or Google drive link. I’ll gladly take a look.

  • November 21, 2017 at 6:04 pm #176353

    I would like a refund if possible, I am going to code my platformer myself. I think there is something fragile with all the properties that are used. Great effort on your part and wish you continued success. I used PayPal and refund would be fine.

  • November 21, 2017 at 6:24 pm #176354

    Subscription payments are non-refundable. Otherwise people would vacuum clean the kits, and our huge archive of game art and go complain to Paypal for some reason or another. And in this particular case, I need to verify the issue myself. 100% willing to do so, and I do have an older iPad I can check on. I’ll be checking later tonight for that zip file link.

The topic ‘Memory Issue’ is closed to new replies.

Download the new CartoonSmart TV App - Organize all your FREE and Premium Lessons

Get it!