Problems with big images..
smurfted
Member, PRO Posts: 586
I have made an game that uses lots of large images, 144 (2000x2000 resolution) images to be precise.
The game was quite large at first, 127MB large. I compiled the game for android and after showing a series of images, it crashed!?
Figuring it was a memory problem. I rendered all the images again. Now as png-8 128 colours. It cut the game down to 45MB, much smaller than before and i thought the game must get further than the previous version before crashing...
It didn't, it showed the same number and crashed again, around about 36-44 images deep.
So i guess my question is, why is it crashing? Has anyone had a similar problem?
Comments
Because of the way our rendering system works, all images are loaded into memory as 32bit textures. So even if you store as png-8, we're going to convert them to our proprietary loading format which removes the file size the savings you got out of png-8.
You will want to consider updating your game to use smaller images where you can (for instance, if something is in the background and less important, you might be able to get away with a smaller image that is stretched).
No idea about why your game is crashing but once rendered every pixel uses the same amount of memory regardless of the file type and format it originated from. It may well still be worth compressing to keep your package size down but I have lost track of the current recommendations re GS image file formats. Certainly with some SDKs it is highly beneficial to squish your images as much as possible without fidelity loss but I don't think that applies to GS as they do things a bit different...
Its a one scene game. I've got 3 images (each 2000x2000) stacked on top each other.
I started out with 4 images, then reduced it to 3 when i thought it was using too much memory.
How much memory would that use, can we work that out?
Has nobody experienced this before?
Why does my app retain the images in memory even when there are not being shown anymore? Can i free up that memory?
Maybe spawn and destroy images, so only the one you need is on scene all the time
Homepage: freneticgamez.eu/
https://play.google.com/store/apps/developer?id=FreneticGamez
So far I've been using the same actor but changing what you see with a change attribute behaviour..
It's nice for its simplicity & that it can use expressions. But it crashes..
due to the reduced file sizes i got my app working though the game salad viewer on my iPhone. The app crashed at the same spot?!
With GS you'd be lucky to get away with 10 large images, its just how it is and i can't see a fix anytime soon so best think of a work around or another game, sorry.
oh dear..
So i've spent that last week re-thinking my project in an effort to get it working on devices (it always worked on OS X).
I've dropped the idea of zooming of the images.
So now i have one scene with two layers of 1024 x 1024 with 2 layers of 512 x 512 in an effort to save memory.
It amounts to 108 1024 square images and 72 512 square images, all in memory at once. And its working on a midrange lenovo tablet!