how much ram should a game be running at to avoid crashing?
Hipster_Owl_Studios
Member, PRO Posts: 214
hello im working on a game and noticed that in some scenes my game spikes up 103 mb is that bad?
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
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.
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