Couple Questions on Memory CS2 vs CS3 and iOS Devices

0 favourites
  • 4 posts
From the Asset Store
A collection of various characters spritesheets for creating a 2D top down, RPG, tower defense, or other similar game.
  • Hey everyone,

    Been working on on Math Quest for a few months and this trivia game is far from a memory hog but I have issues with the game restarting itself from time to time on iOS. No issues at all on PC.

    Let me walk this back some...Originally my game was crashing on all iOS devices when it got to the intro of the game but worked fine on my PC. My estimated RAM in CS2 for the entire game was listed at 850MB or something like that. I discovered that some of my layouts were using showing 400-600MB of RAM in CS2. So I worked on getting all my layouts to be 170MB or under in CS2. Saved as file and opened in CS3 to export to iOS. With all the changes the estimated RAM for the entire game is down to around 350MB, i believe. This was a good learning experience for sure and I thought I had a grasp on things. :)

    Started testing again and found some layouts we still crashing(by crashing I mean the game would just restart itself). Referenced layouts in CS3 and the bigger ones that were roughly 170MB in CS2 were showing as 400+ MB in CS3. I am not sure why but I worked on getting those down in CS3 and exported again.

    Started testing again on iPhone X and it seems to work ok.

    Started tested again on iPad Air 2 and it crashed after one play-through.

    so this leads me to my questions.

    - Why is CS2 showing the RAM preview as when debugging a layout at 170MB but CS3 shows it at 400MB for the exact same layout?

    - Why is memory an issue if Apple sites show their RAM allowance is now 4GB, which I am not even glose too.

    - If multiple play-through can suck up the RAM is there a way to reset the RAM at the start of a new play-through?

    Thanks,

    Rich

  • friendly bump for the devs

  • Construct 3 uses a different spritesheeting algorithm that is better at combining multiple objects on to the same spritesheet. However if you do things like create lots of objects dynamically at runtime without them being placed on the layout, this can cause higher memory usage as Construct doesn't know ahead of time how to group objects on spritesheets according to when they're used together. See memory usage in the manual for more information on best practices.

    If that doesn't help solve it, you can try reducing the spritesheet size in project properties. It can help increase the granularity of image loading, which can bring down the overall memory use.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Construct 3 uses a different spritesheeting algorithm that is better at combining multiple objects on to the same spritesheet. However if you do things like create lots of objects dynamically at runtime without them being placed on the layout, this can cause higher memory usage as Construct doesn't know ahead of time how to group objects on spritesheets according to when they're used together. See memory usage in the manual for more information on best practices.

    If that doesn't help solve it, you can try reducing the spritesheet size in project properties. It can help increase the granularity of image loading, which can bring down the overall memory use.

    I found a related post where it talks about layers and transparencies which freed up a lot of space and memory but alas I still have crashing when testing on an ipad air 2.

    It is far from a labor intensive game but it does jump back and forth between layers often and I think the memory is hitting a max and crashing, maybe? Everything on screen in the layout is there at the start.

    Testing Process - (RAM estimates based of my memory but can get more exact numbers if needed)

    Start Game - Logo Layout(this displays my company logo)(50 MB Ram)

    Takes you to Main Menu((97 MB RAM)

    Click on "Story Mode" Button which takes you to Intro_1 Layout to do a small cutscene(97 MB RAM - this is skipable but for testing sake I run through the whole intro)

    This progresses to Intro_2(217 MB RAM)

    This progresses to Intro_3(150MB RAM)

    This takes you to Player_Select(55 MB RAM)

    This takes you to name Entry Layout(50 MB RAM)

    This Takes you to Wold_Map(100 MB RAM)

    This takes you to the game playl oop

    Game loop

    Roll dice on Stage 1 layout(98 MB RAM)

    Takes you to Enemy Prep layout(56 MB RAM)

    Takes you to Trivia Question Layout(150 MB RAM) - answers all correct answers(2-10 questions depending on enemy)

    Takes you to Enemy Defeated Layout(58 MB)

    Takes you to Stage 1(or whatever level you are on) - REPEAT

    So I find I can get to about the 3rd stage layout which can mean the loop went through about 15-20 times or so and the game resets on the ipad. I have done my best to get the RAM numbers down from like 450 for most of the layouts to a good portion being under 100 MB. I am planning on testing on more devices but I guess I do not understand why it keeps crashing and hoping someone can shed some more light.

    Thanks,

    Rich

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)