Video Memory Usage - Mobile phones

Monkey Targets Forums/Android/Video Memory Usage - Mobile phones

matty(Posted 2011) [#1]
Hello all,

I have a game I'm working on for Android. Currently the apk is about 4MB. The current dimensions and quantity of image files (png/jpg) are shown below:

32 32 3
64 64 29
64 512 1
128 32 1
128 128 54
256 64 6
256 256 2
320 64 1 (image strip 64x64 frames)
320 320 1 (image strip 64x64 frames)
1024 128 1
1024 512 6

For the standard PC in the past with other blitz products to get a bit of a handle on how much video memory would be consumed I simply multiply the figures above together (Length x Width x Qty x 4 Bytes Per Pixel) to get a ball park figure of the memory used. In the case of the game I'm working on it comes out to about 17MB. Are monkey programs on Android phones able to be estimated a similar way or do they use compressed textures? Does the phone swap images in and out of video memory if they are not in use? (My game only uses a small selection of these images at any one time).

Now my game works on my phone (HTC Desire), my boss' phone (Galaxy S2), and most of the others we've tested on.

In the past any graphically intensive game, which this I would have to say is not, I have created has often been a bit hit and miss when it comes to knowing if it will work on a wide range of phones.

So is there some way I can find out before release which phones will definitely have trouble with my game?

There's a few questions and thoughts in there.

thanks,
Matt


AdamRedwoods(Posted 2011) [#2]
vmemory compressed on android? yes sometimes, but you have control over this if the phone supports it.

able to know which phones will fail? Overall not really since the market is so badly splintered.

do mobile phones manage when images are loaded into vmemory? yes.
http://stackoverflow.com/questions/3077283/track-opengl-texture-memory-in-android

I read somewhere that OpenGLES uses regular memory in conjunction with video memory. But how much?

On iPhone it looks like 24MB:
http://developer.apple.com/library/iOS/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html#//apple_ref/doc/uid/TP40008793-CH106-SW3


And I believe texture sizes are limited to 2048x2048, but depends on the hardware. There are ways to look this up through OpenGL.
http://stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices


If you want to limit what devices it works on, say the size of screens, OpenGL2.0, or even try using OpenGL texture compression and limit based on that-- use the manifest.xml file.
http://developer.android.com/guide/appendix/market-filters.html