Loading time is very long

I’m finishing my first app, but I have a problem!
I have a lot of images to load (50 PNGs:: more than 30MO), I load them in the app’s launching (splash screen), the problem is that it takes more than 30 seconds to load those images!!!

I road in many articles that PNGs are the fastest images to load, but 30 seconds WOW, I tried JPG but generally it is the same average of loading time!

Any suggestions is welcome.
Thanks

Yes, absolutely get TexturePacker and switch to using a Spritesheet. PNG files and export to the .pvr.ccz format. It is an easy switch. My game went from 40mb of art to 5mb. Not to mention the other performance benefits.

1 Like

Thanks,
But I’m using background images, so I don’t understand how to use Spritesheet?

Even this, I tried to use this format, but I met problems when call with cocos2d-x, perhaps I mess some steps in the conversion or perhaps there is some tips with cocos2d-x to use this format??

I’d check out http://www.codeandweb.com/texturepacker

It will answer everything you need. It is very informative and clear.

Integrating with Cocos2d-x is very simple. http://www.cocos2d-x.org/reference/native-cpp/V3.1rc0/d7/d76/classcocos2d_1_1_sprite_frame_cache.html

Does the free version of Texture packer suffice for this?

I’m not sure. I purchased the pro version and never looked back. It was a great investment for me. I use it for more than just games too.

1 Like

30Mo for 50 images seems like a lot to me, that’s more than 500Ko per image.

Do you have scaled down version of your assets for lower resolution devices ?

Could you cut the images in smaller repeatable images instead of big images ?

@Fradow - these are good points as well.

@Lion_Ts - Those links are really out of date. Some of the concepts still apply though. For example as of v3 it is no longer recommended to use SpriteBatchNode.

@slackmoehrle - I’m using pvr.ccz format and it seems fixing my problems (both loading time and the size of the size of the app), but I have one more question:
For iPad and iPadHD, what is the best strategy: using specific images for iPad and others for iPadHD or using images for iPadHD and scale them for iPad to minimize ressources? But I’m not sure at what point the scale function is gourmand in resources??

There are pro and cons to the 2 methods.

Having specific images lower the amount of RAM required on lower devices and speed up the loadings times of the images, but make your app larger.

Having the same images will make your app smaller, but will take more RAM (which have a lot of implications: some lower-end/older devices may reach the limit, which causes cocos2d-x to unload unused textures, which causes a performance hit, especially since these will probably need to be reloaded later) and longer loading times (probably around x4 if you have a x2 scale).

All in all, you generally want to have specific images, since the size of the app is generally not that relevant.

P.S. : there is no scale function. The scale is applied by OpenGL when drawing the textures. There is basically no overhead for that, as far as I know.

2 Likes

To be honest, I just have a few sprite sheets. iPad, iPadHD and iPhone.

1 Like

@slackmoehrle, Thank you very much, Texture packer is very useful

of course.

if you want free app like texture packer or test for spritesheet,
try http://renderhjs.net/shoebox/ this one.

Thanks for the link. It look ok. I still don’t think you can beat Texture Packer at what it does. It is truly advanced.

@slackmoehrle

I am also using Texture Packer for my projects.
It’s best one.
And actually I don’t have any relation of shoebox.

Some tricks to optimize you spritesheets:

I’m meaning to try shoebox, got adobe air ready but it runs like molasses at work. what are the limitations of free version texture packer? read that free was only available for one year, other limitations and you’d need to blog or do something like that…

PVR.ccz is only for power vr graphics right? i presume you detect graphics at boot and would have different formats for different hardware? yet you only Menton PVR.ccz…