Brain Is Too Full?
netdzynr
Member Posts: 296
Frustration level = 119% -- hope some kind soul can offer advice...
My iPad game seems to be hitting a wall, I'm guessing, in terms of memory. What seemed to be working fine about a week ago is now randomly crashing left and right. I've read the posts about using 8bit PNG and mono sound as often as possible, but are there any other tips from the gurus here for keeping memory requirements lower? Does anybody know what the maximum threshold is for memory usage on iPad? Any other suggestions?
My title is (was) about 95% complete and I'm just so fed up with GameSalad right now. Hoping someone will restore my faith in this tool.
My iPad game seems to be hitting a wall, I'm guessing, in terms of memory. What seemed to be working fine about a week ago is now randomly crashing left and right. I've read the posts about using 8bit PNG and mono sound as often as possible, but are there any other tips from the gurus here for keeping memory requirements lower? Does anybody know what the maximum threshold is for memory usage on iPad? Any other suggestions?
My title is (was) about 95% complete and I'm just so fed up with GameSalad right now. Hoping someone will restore my faith in this tool.
Comments
Saving your audio as low as possible WILL save on RAM however. Stereo sounds are essentially just two mono sounds, which use twice the RAM.
My current game is a real beast. TONS of Actors instances, images, music and sound FX.
My FPS stays at a constant 60 FPS, but my RAM is always approaching 40MB. I have to be really careful with what images and sounds I use in each Scene.
I am nearing the end of development for my game and am about to start some serious testing on all the devices.
I have a version of every single iDevice here for testing, and I am a little fearful of how it will do on he iPhone 2G and the 1st gen iPod Touch. It works fine on a 3GS and above. I assume that I am probably just past the RAM limit for the oldest devices, we'll see!
Another problem is that Apple will not disclose the exact RAM limits of the devices. People are just guessing everywhere on the internet. And the limit is variable - it depends on applications running, phone calls, text messages, all sorts of stuff. Multitasking and jailbroken phones make it even worse with other apps eating up RAM.
At least on the iPad you have a consistent testing platform. There aren't old versions around, and the current one is pretty robust.
What are the different RAM usages you are getting on the GS Viewer?
If you want to send your project over to me,
I can look through it and see if I can spot anything glaring.
You should definitely be able to get your game running real nice on an iPad.
Let me know if I can help.
joe at firemaplegames dot com
1) Deleting attributes = probably, but crashing doesn't seem to occur reliably in the same circumstances. If could find a specific area where crashing would occur regularly, then I'd have something tangible to look into.
2) Copying from one game to another = not in a long time, but I thought 0.8.8 was supposed to allow this now: "Behaviors can now be dragged between different projects safely. "
3) Crashing on GS viewer = yes; Crashing on tilt = not using any tilt behaviors.
Thanks again for the response. Much appreciated.
I've added an empty scene in between game scenes to (hopefully) force clear out memory. This seems to kind of work, but I notice if I make a couple of hidden images visible in a scene (alpha = 1), memory use jumps significantly, and doesn't get lowered when the image is hidden/moved off screen. Is there any way to reclaim this memory, short of jumping to a new scene?
So you may want to check anything that was copied and pasted from one project to another just in case.
Good Luck!
BTW if anyone knows any tricks to getting GS to run faster other than restarting and not using the forward/backward buttons lemme know!
FMG passed along his experience that sound may be causing a memory leak in 0.8.9, and my game has one heavy sound in particular which, if FMG is right, may be contributing to my problem. I'll report back.
Again, I'm wondering if anybody knows an answer to this: if making a previously invisible actor visible (via alpha = 1) chews up a bunch of memory, is there any way to recover that used memory? (alpha = 0 doesn't seem to do it, and other folks have said that the visible attribute is not changeable at run time). Thanks in advance.
Regarding the memory use question above... what about animation? AFAIK, frame animation is only applied using the Animate behavior. Assuming that animating frames consumes memory, how does one turn the animation off? Right now I'm using a separate "off" Animate behavior that just has one frame and the speed set to 0 fps. Is this the proper way to disable animation of an actor?
As far as I can tell, GS goes through your code and "preloads" any image it can find in the Change Image and Animate behaviors.
Even if the player doesn't get to see them. Like if you have a "You've Won!" animation sitting off screen, nested in a Rule. Even if the player loses and doesn't get to see that animation, it still loads into RAM.
It also loads all of those images and sounds when you load the Scene.
I have found that using Change Attribute: self.Image To: "whatever.png" does NOT preload the image into memory - as opposed to the Change Image behavior, which does preload it.
I also use the same technique wrapped in a Timer to simulate the Animate behavior.
FMG, it does seems that jumping back and forth between scenes even with small SFX audio seems to gradually increase memory use. Haven't yet tried pulling all sounds to see if this is still the case.
'Brain is too full?'
Sometimes, though mostly it's empty. Feast or famine with me, no in-between
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io