Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / What will cut down loading time?

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 23:31
I have 400 sprites in my project.
Even though all combined data files are only 5mb big it takes 18 seconds to load on iPad3.

What technique will cut down loading times?

Will grouping all sprites in spritesheets & making 20 files instead of 400 have any effect on loading time speed?
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 18th May 2012 01:24
I don't think you should worry much as most big games need time to load (angry birds is the best example.

Do you really need 400 sprites In one screen, this is too much for any engine to handle.
However:
Try to load the specific sprites every each level.
Do not delete the sprites if they are gone dead. Make them invisible so the come back to life in next level or screen.
A stone sprite can be turned into tree other screen (as an example)
Use dummy sprites and set physics around them. Dummy sprites have no image but they exist. Just hide them behind the level bitmap. This way you save much time In loading images.

And so on.....

SimpleProgram
12
Years of Service
User Offline
Joined: 2nd Oct 2011
Location: Cali
Posted: 18th May 2012 01:27
Are you loading them all at once?

You could try only loading the important sprites images you need for the menu, then deleting them when not in use. Then load only the
necessary sprites for each level, screen and etc.

That might decrease loading time in the beginning, but you will have to set up a loading screen function.

Hope this might help.

Programming and video games, what else could you need?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th May 2012 01:37
Using sprite sheets rather than separate images would increase speed also. Obliterator used to use all separate images and took ages to load, it now uses a combination of the two, and loads a fair bit faster. It also only loads the sprites needed for each level as suggested above.

Quote: "Do you really need 400 sprites In one screen, this is too much for any engine to handle."


Not really, I have had far more than that loaded with no problems in AGK.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th May 2012 09:29
The number of sprites is NOT an issue, it plays well on all iOS devices.

DVader I will try a combination of spritesheets (had a lot of graphical bugs with past AppGameKit versions when using spritesheets) and loading the images on the go instead of all at the start. Thanks.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th May 2012 14:44 Edited at: 19th May 2012 20:56
Put some timers and tested a bit...

Initially loading spritesheets was faster than loading single sprites, but when loading 50-60 sprites from 2 spritesheets, I found out that loading spritesheets was a bit slower. it's not noticeable, but timers don't lie!

I ended up not using spritesheets. i have packed the single sprite files using PNGgauntlet, saving 60-70% in filesize!

Login to post a reply

Server time is: 2024-04-27 12:06:26
Your offset time is: 2024-04-27 12:06:26