Results 1 to 8 of 8

Thread: iPad - max available memory?

  1. #1

    Join Date
    Jan 2009
    Location
    Budapest, Hungary
    Posts
    26

    Default iPad - max available memory?

    Hi,

    I am planning to port our PC game to iPad. My main problem is, I don't know how much is the max available memory I can use for the game.

    Currently on PC the max memory usage around 250 MB, but I could rid of some animations, some texture variations, etc. but I should know which is the target number, which already acceptable for Apple.

    I found here some info: http://www.gaminghorror.net/steffenj...256-mb-of-ram/
    "I know that iPad developers reported iPad App rejections (no sources given to protect the innocent) when memory usage was between 120 to 150 MB. Unsurprisingly this is also in the range where you get memory warnings or crashes on the iPhone 3GS."

    If you have any experience where is exactly this memory limit, please let me know.

    Thank you,

    Lajos

  2. #2


    Join Date
    Feb 2006
    Location
    Australia
    Posts
    410

    Default

    I can't answer your question, but just wanted to say good luck - I think Fiona Finch would be awesome on the iPad!

  3. #3

    Join Date
    Mar 2008
    Location
    Gainesville, Florida
    Posts
    806

    Cool

    Hey Lajos,

    I didn't even know your new game was out. I'll have to pick it up.

    Images
    The new engine core you're using supports 'highquality' and 'lowquality' images. High quality gets stored as (for the iDevice) A8R8G8B8 with or without alpha and lowquality will get stored as A4R4G4B4 or R5G6B5 with our without alpha.

    The iDevice portion of the framework also supports PVRTC or PVR images. PVR looks good at 4bpp and the iDevice will upload the texture in the compressed format. Let me say that again, the texture is uploaded to the GFX memory COMPRESSED. Because there is no decompression, the loading time is about 6 times faster and the memory footprint is a LOT smaller. PVR supports alpha, but the real 'gotcha' is that you have to create square pow2 textures. Also, because it remains in a compressed format, you might want to turn off linear blending.


    Basically, you can go through and any images:
    • If they look good on PVR and it's not messing up the image, use that
    • else if they look good enough at the low quality setting, use that.
    • if the image has no alpha, turn off alpha.


    The framework also supports a 2-staged loading/uploading step. When you only 'load' the image, it will sit in memory compressed. Then, when you need to draw you can 'upload' the image and it will decompress (and free the compressed copy).

    Resource Management
    You could also consider loading some assets only when they are needed and unloading/reloading assets between screens. Look into worker threads and think about keeping a loading thread asleep. Then, when you need to load the resource set, wake the thread and pass it the resource group to load.

    If you are still using the ResourceManager, you can load/delete entire resource groups.

    Audio
    As for streams/samples: Streams are kept compressed in memory and decoded (by a separate thread) to a sound buffer for the stream. Samples are completely decompressed and kept uncompressed in memory.

    You could try running all of the audio as Streams, with the exception of some really small, really frequently used samples. I haven't messed with this yet, you'll have to play around with it to see how it does.

    Music
    Remember that the iDevice version of the framework supports playing music from the user's iPod. If you let the user play music from the iPod, then you get double benefit: Apple loves it when you let the user play music from the iPod (and you'll get a good push) and with the music being played by a system program, you don't have to use your memory to hold the game music.

    So, if the player turns on the iPod and selects tracks to play, unload the game music.

    Conclusion
    Shoot me an email. I have a TON of new code for the two frameworks you are using, including a better Image that doesn't save a local copy of the bits unless you tell it too.

    [BTW, thanks for the mention in the credits!]
    -James
    Haunted Hotel I, Haunted Hotel II, Jane Croft

  4. #4

    Default

    Quote Originally Posted by jpoag View Post
    Also, because it remains in a compressed format, you might want to turn off linear blending.
    Never heard of that one. Why would you want to do that? I mean, not cutting bilinear filtering but cutting it BECAUSE it on compress texture.

    JC

  5. #5

    Join Date
    Mar 2008
    Location
    Gainesville, Florida
    Posts
    806

    Cool

    Good question.

    In the framework in question, images are preprocessed before being uploaded to a texture. All transparent (completely transparent) pixels have their color channel set to the nearest non-transparent pixel (if one is found).

    This is because linear filtering on certain effects (sub pixel or floating point placement, rotation, scaling, etc...) where strict texel->Pixel mapping can't be done will cause the rasterisation to access adjacent pixels. Typically, this causes artifacts; usually a black line around drawings.

    However, in a compressed format (which is read from Disk and directly uploaded to the texture) there's not really any way to preprocess the images. That is, you can't really access the pixels directly in its compressed form.

    I guess that since you are converting images to PVR, you might as well use a tool like this: http://jet.ro/2009/10/17/tool-pngprep/ before hand to fix this problem and then the linear blending tip would be moot. That flood fills the PNG transparent pixels.
    -James
    Haunted Hotel I, Haunted Hotel II, Jane Croft

  6. #6

    Join Date
    Jan 2009
    Location
    Budapest, Hungary
    Posts
    26

    Default

    James,

    Thank you for your tips, you helped us a lot!!!
    (I've just sent you an email, too.)

    It seems, most / all of our memory problems will be solved if we use the PVR images.

  7. #7

    Join Date
    Jan 2009
    Location
    Budapest, Hungary
    Posts
    26

    Default

    Quote Originally Posted by Shaz View Post
    I can't answer your question, but just wanted to say good luck - I think Fiona Finch would be awesome on the iPad!
    Thank you Shaz!

  8. #8

    Default

    On the iPhone and iPad you have to really be careful on memory. There is no fixed amount that is definitely available, and in the past I've noticed if people have 10 pages open in Safari, your available memory will be under 20megs.

    Also people do not understand that memory is an issue. You game will most likely exit out if you run out of memory.


    Phil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •