Memory use Sanity check

I have never had any problems with my app crashing when loaded on devices, but reading these forums is making me nervous so I thought I would put this out here just for a quick sanity check.  Do these numbers look safe for this game:

all #s are from the simulator 

MEMORY = 2387.7 KB TEXTURE = 17 MB    nexus one 

MEMORY = 2380.8 KB TEXTURE = 62 MB    iphone 4 

MEMORY = 2613.3 KB TEXTURE = 262 MB  iphone 6 plus; Kindle Fire HD 9; Samsung S5 etc…

Thanks in Advance.

Totally Fine for modern Apple devices (iPhone 5+ and iPad Air +)  512M … 768M total mem is fine.

Above 512MB total memory for old apple devices (iPad Mini, iPad 1 & 2) might be an issue.

Android is a whole different discussion.

I updated my last post.

I guess you are right, there are lots and lots of types of Android devices.  All the Samsung Sx’s have better specs than the Iphones so they should be OK.  But there are probably some really low end stuff out there.  Is there a way to force Corona to use the low end graphics?   I could do a system check and if the memory is 512 then assume 1x graphics.  The way I am doing it is setting graphic level based on screen size.  

I can’t answer you on the forcing part, but to say I think there is little you can do.

The biggest piece of advice I can give is, avoid textures and spritesheets over 2048x2048 in size and most of your troubles will be gone.

The biggest issues I have had to deal with in the past are:

  • Massive textures that are larger than the maximum size of texture buffers on low-end devices
  • Too many textures in use at one time (all devices have a limited number of texture buffers; but finding the sweet spot is difficult).
    • My typical solution is first to ignore this.  And check if it is a problem later in the game.
    • However, if I do know that the client (usually for me this is encountered on client projects) intends to have lots of art, then I will plan a bit in advance.  That planning involves finding a way to group textures that will be used at the same time in one or more texture sheets.  That way, I can have them all loaded together.
    • The issue you can easily run into is ‘texture thrashing’ where  you are constantly loading and unloading texture units because you planned badly.  It easy to ‘outsmart oneself’ by optimizing in advance and making a bad choice.

I must say, I rarely encounter issues with textures in my own (lo-fi games and client’s games) as long as I remember not to use huge sprite sheets and textures.

Dang (I must be slipping)!

There is one thing you can do.  Include 1x, 2x, 3x textures and make a smart config.lua file to force low-end devices to use the 1x textures.

Totally Fine for modern Apple devices (iPhone 5+ and iPad Air +)  512M … 768M total mem is fine.

Above 512MB total memory for old apple devices (iPad Mini, iPad 1 & 2) might be an issue.

Android is a whole different discussion.

I updated my last post.

I guess you are right, there are lots and lots of types of Android devices.  All the Samsung Sx’s have better specs than the Iphones so they should be OK.  But there are probably some really low end stuff out there.  Is there a way to force Corona to use the low end graphics?   I could do a system check and if the memory is 512 then assume 1x graphics.  The way I am doing it is setting graphic level based on screen size.  

I can’t answer you on the forcing part, but to say I think there is little you can do.

The biggest piece of advice I can give is, avoid textures and spritesheets over 2048x2048 in size and most of your troubles will be gone.

The biggest issues I have had to deal with in the past are:

  • Massive textures that are larger than the maximum size of texture buffers on low-end devices
  • Too many textures in use at one time (all devices have a limited number of texture buffers; but finding the sweet spot is difficult).
    • My typical solution is first to ignore this.  And check if it is a problem later in the game.
    • However, if I do know that the client (usually for me this is encountered on client projects) intends to have lots of art, then I will plan a bit in advance.  That planning involves finding a way to group textures that will be used at the same time in one or more texture sheets.  That way, I can have them all loaded together.
    • The issue you can easily run into is ‘texture thrashing’ where  you are constantly loading and unloading texture units because you planned badly.  It easy to ‘outsmart oneself’ by optimizing in advance and making a bad choice.

I must say, I rarely encounter issues with textures in my own (lo-fi games and client’s games) as long as I remember not to use huge sprite sheets and textures.

Dang (I must be slipping)!

There is one thing you can do.  Include 1x, 2x, 3x textures and make a smart config.lua file to force low-end devices to use the 1x textures.