Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Image size for final exported project too big (crash) — Gideros Forum

Image size for final exported project too big (crash)

MellsMells Guru
edited November 2013 in General questions
Hi,

My application runs fine on my laptop in Gideros Simulator.
It runs fine in the Gideros player installed on my device.
However it crashes when I build for my device from xCode (memory warning).

I was developing with light placeholder images until now, but as I approach the end of a milestone I'm including final artwork and starting to optimize.
Without any optimization, it crashes on device.

Some images :
1344x1536 | 2.1Mo
2726x1536 | 6.4Mo

So I understand that it might be "too big", that there is a difference between simulator on my laptop, gideros player on device, and app running on device.
But I have no idea of what can be considered as realistic and to what point I should optimize my work.

[ 1 ] Do you follow some guidelines? What's the maximum I should aim for?

[ 2 ] What is the typical size of the folder that is created when you export from Gideros (same folder as the xCode project), or the final app?

thanks!
twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps

Comments

  • @Mells I would not say there should be difference between Gideros device player and exported project

    It's basically the same, you can change one boolean in AppDelegate and it will become player.
    So the issue could be else where

    Only thing that comes to mind is that you are using normal mode on default Gideros player and retina on your exported project

    For solution, do you load everything in memory and use it, or you divide your assets between scenes? Or is the single scene so big?
  • MellsMells Guru
    edited November 2013
    @ar2rsawseen
    After more tests, the error is probably somewhere else...

    I'm using a scene manager. And the issue happens when I enter a certain scene. Not right from the start.

    I'm running the Gideros iOS player v2013.09 on :
    - my laptop
    - an iPad 2
    - an iPod Touch 5th generation

    On my laptop, the app works well in the simulator whatever the hardware settings for the Gideros player are.
    On the iPad 2, wifi testing on device, the app works.
    On the iPod touch 5, wifi testing on device, the app crashes when I enter a scene. The scene can be considered as heavy maybe? I don't know, because I have no way to compare.
    But the app runs fine on the iPad2 so I believe it's not an issue with the hardware.
    No error is reported in the console.

    What would be the difference between testing the app on device between an iPad2 and an iPod5, and running the player on the laptop vs on device?


    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • OZAppsOZApps Guru
    edited November 2013
    @Mells, there can also be an error in code that causes the crash on the device.

    The desktop version is more forgiving than the device. I can confirm that more recently, where the desktop player opens files, works, etc but on the device it does not and crashes. This was also faced while creating the addressbook plug-in, the xcode simulator also works fine without errors, the moment it is run on the device, back to springboard (crash) and it was really frustrating trying to find out what and why. Though my issue was simple as it needed the user to allow access (which is possible on the device and not on the simulator) in your case, try to break it down into the smallest code and see what causes the crash, could be a filename, a path, a graphic format or size, etc.

    You could place a lot of print statements to check at what point the app crashes. You can also use the xCode console to check with the device connected as for any information regarding why the app crashed (specially if it has memory errors)
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @Mells so most probably it is like this:
    both Ipad2 and Ipod5 has 512MB of Ram
    But while Ipad2 has simple display, Ipod5 has Retina display

    So if you have @1.5 or @2 assets, it tries to load them on ipod5 and gets out of memory, while loading base images on ipad2 and working correctly with the same amount of Ram

    So most probably you would have to try to unload that scene, by dividing it in more scenes or unloading some graphics, which does not get used so often
  • MellsMells Guru
    edited November 2013
    @OZApps @ar2rsawseen thanks for the help, I appreciate.

    I'd like to know what's happening behind the scenes before I run more tests.
    I use myImage.png and myImage@half.png

    - If I remove myImage@half.png from the project, is it guaranteed that myImage.png will be loaded as a replacement when required?
    - If I remove myImage.png from the project, is it guaranteed that myImage@half.png will be loaded as a replacement when required?

    If yes to both, I could try to keep only @half images in my project and see if the iPod is still struggling or if the issue comes from somewhere else.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Unfortunately yes to the first one (myImage.png will be used)
    but no to second one (myImage@half.png won't be used, only base images are used)
    As I understand, we will fix it, so not only base image is used, but not yet. :(

    What you can do, is maybe try disabling retina in project properties?
  • MellsMells Guru
    edited November 2013
    @ar2rsawseen
    thank you, I changed all my images with very light placeholders and it works.
    Now back to understanding how to optimize my images : I work on the iPad with a high resolution and scale the images down (*0.4) in my final project.
    Do you know why such a high resolution? I was wondering if Apple wouldn't implement a device in 2014 for 4k resolution tv (!) and was painting in such a high resolution.

    So it was an issue with my base images, I scaled all my images down in Pixelmator*0.5, and scale them down again *0.8 inside the app.

    I know, that's strange.
    Unfortunately yes to the first one (myImage.png will be used)
    In fact this is what I was expecting. What do other users expect instead?
    I was intrigued by the "unfortunately".
    As I understand, we will fix it, so not only base image is used, but not yet.
    So if I understand well what you mean is that currently myImage@half.png won't be loaded if myImage.png doesn't exist, but in the future this is something that will eventually implemented?
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • Unfortunately was more meant for the second statement

    And yes you understood correctly ;)
Sign In or Register to comment.