Problems with big images..

smurftedsmurfted Member, PRO Posts: 570

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

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,052

    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).

  • tmanntmann Member Posts: 278

    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...

  • smurftedsmurfted Member, PRO Posts: 570

    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?

  • smurftedsmurfted Member, PRO Posts: 570

    Has nobody experienced this before?

  • smurftedsmurfted Member, PRO Posts: 570

    Why does my app retain the images in memory even when there are not being shown anymore? Can i free up that memory?

  • freneticzfreneticz SwedenMember, PRO Posts: 774

    Maybe spawn and destroy images, so only the one you need is on scene all the time

  • smurftedsmurfted Member, PRO Posts: 570

    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..

  • smurftedsmurfted Member, PRO Posts: 570

    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?!

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited June 2016

    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.

  • smurftedsmurfted Member, PRO Posts: 570

    oh dear.. :'(

  • smurftedsmurfted Member, PRO Posts: 570

    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!

Sign In or Register to comment.