how much ram should a game be running at to avoid crashing?

hello im working on a game and noticed that in some scenes my game spikes up 103 mb is that bad?

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    on the latest devices that should be fine. the original iphone would crash, but i think anything after the 3GS would be good.
  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
    Thank you so much!
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    I was getting a memory spike of 330MB which was a bunch of animations and it was fine on 3GS, 4, 4S and 5 in iOS6 with GameSalad - but with iOS7 it was crashing with memory warnings. I changed how I did the animation and got the memory usage down to 30MB. So all good now :)

    I could not lazy load the animations either and they seemed to stay in memory anyway - lazy loading caused GameSalad's frame rate to drop to single digits for the time it was loading in the data.

    I think as @jonmulcahy said you will be fine - and there are apps out there that push memory up and display the warnings so you can see how your device handles memory usage at different times too - I have not used one but seen a few mentioned.
  • gamesfuagamesfua Member Posts: 723
    @matarua can you define "lazy loading?" I'm curious thanks!
  • Ali_WoodAli_Wood Member Posts: 52
    Yes please elaborate on the lazy loading animation as i'm having real FPS issues with my game on an iPhone4... maybe it could be my animations?!?
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @anatomyofdreams and @Ali_Wood sorry for the late reply - busy bee! :bz

    So lazy loading would be bringing an item on to the stage just before you need to use it. In this case memory usage gets staged in phases and does not do a massive dump at the start.

    In GameSalad, an example of this would be to spawn your animating actors - 1 at 1000 points - a new one at 2000 points etc. But what this does is cripple GameSalad for the time it is loading in the assets and when it's crippled it's also trying to play the animation - if it's a tiny animation no worries, but if it is a large one it does.

    To make your animations smoother - and I say smoother as they never really run too smooth in my experience so far and from what I have read on the forums - 30 FPS is not really achievable. But all that aside you do this...

    ... first put the animating actor on the stage from the very start - then the actor loads all the images of the animation on scene load.

    Then when you need the animation you can change this actors x and y and play the animation - then it will be as smooth as possible.

    If you spawn the actor in - it has to load and play the images at the same time which means you go down to 12 FPS at times and it gets all jumpy, skips frames etc.

    If you spawn the actor just before a score change so it's ready it still makes the game stutter. It's using the memory up and writing as fast as possible which takes resources.

    In my case also I had 900KB of images but they took up 330MB of RAM. So small game - big memory usage due to 108 frames at 640 square.

    In regards to FPS issues on an iPhone 4 - I find they are temperamental - they are suffering under new iOS versions which use more memory - and then we try and push them with our games even harder. I notice a restart and first thing you do is play the game and it's fine. But if there is memory used up by apps and the system it takes time and resource to allocate that. An iPhone 4 is suffering frame rate issues in iOS too.

    If there is anybody that knows how to animate better - I have heard of self.image code before but not sure how that works?

    Any smarts, ideas or corrections bring them to the mix :D

Sign In or Register to comment.