Game Development Community

Loading Time Issues/Questions

by Jason Darby · in iTorque 2D · 09/24/2009 (6:01 pm) · 7 replies


I know this is a bit of a wide open question, but what is considered a normal loading time from the Splash screen to the game?

After 4 days of trying to get stuff working, I finally have something working on the phone (yay)... its only 3 scenes and very minimal graphics but takes 12-14 seconds to load. So what advice is there for speed and how long it should take.

Also when i add more levels the game fails to load/work. I believe version 0.5 is 2392kb and version 0.7 is 3338kb. Theres not much script between these versions.

What are the limits and restrictions for a level or the iphone. I know there are things such as making the graphics lower res...

If anyone could give advice on this it would be appreciated, Ive seen and played many iphone games and they certainly have more graphic capability that my game (even if it needs alittle optimising).

Many thanks

Jason

About the author

Computer games book author, have written 6 game creation books, published by Cengage Course Technology. Owner of Arcade website www.madword.com and Castle software.


#1
09/24/2009 (6:17 pm)
I believe that an empty application with itgb takes around 5 seconds to load. ~3 seconds are required for the iphone OS to do its thing and the engine itself takes around 2 seconds. It's possible to cut down the engine loading time by removing any functionality that you aren't using (I had dramatic loading improvements when I disabled the networking). If you're careful with your assist loading, you should be able to reduce your loading times but you will never get < 5 seconds or at least I've never heard of anyone who could.

From what I've heard, 8-10 seconds is a realistic loading time to aim for.
#2
09/24/2009 (7:39 pm)
The first half-second is loading the Default.png+plist, the next few seconds is loading the application binary. To keep the rest manageable, load scripts as late as possible, load datablocks only in the levels/maps as needed, precache as little as possible and use PVRs whenever you can.

5 seconds is possible with just a minimal menu loading. I've had some rather inconsistent loading times, though. One T2Di game I bought took a few tries before it wanted to run, then had shorter loading times for each run until it reached 7 seconds! We have no idea what caused it (the game is Chalk Chains/Catenaez).
#3
09/24/2009 (9:14 pm)
The best I've ever gotten is 12 seconds for our project and that is with most of the "common" .cs files disabled. Loading one graphic and a level that only contains that graphic, my second splash screen (iTGB splash) stretches it to 15 seconds.

Apple is only concerned with that first part of the loading. Once I get the simple level containing only a splash screen loaded up I pause for 1 second to make sure apple is happy, then I start loading the next set of datablocks and audio I will need for the intro screen, while the user studies the iTGB screen for a few seconds. 20 seconds and the user gets the first screen they can interact with.

With lots of careful sequential planning of loading and deleting, we have managed to solve all time and memory limitations. Working with a limited system like the iPhone requires some very careful planning.

EDIT: I just built a totally empty project (1 polygon, no graphics) and sure enough it is about 5 to 5.5 seconds. Now I need to take a closer look at what is taking all the extra time in our games. However, I stand by that if you can get the first simple level up by 17 seconds Apple won't kill it.
#4
09/24/2009 (9:48 pm)
In truth any "section" of your code must respond within 20 seconds or it will be terminated. So if you have a script function that takes longer than 20 seconds then it will shutdown your application also.

From what I've seen anytime the main event thread is blocked for more than 20 seconds the iphone kills your program. So if you respond to a player clicking an object and then load a level that takes longer than 20 seconds then you will also be killed.
#5
09/25/2009 (6:09 pm)
That's harsh! But if you make the user wait more than 20 seconds in the middle of a game they'll probably want to kill you anyway ;-)
#6
09/26/2009 (6:29 am)
We have tried a few things so far and have reduced it by about 1 second, its at about 16 seconds so far. Still looking at different methods of loading scripts etc.

We hadnt optimised our graphics, they were normal PNG. I wasnt intending to do that optimisation until towards the end of development but the 20 second shutdown was meaning i couldnt even test it (mainly because i guess it was loading everything at the start :).. Image optimiations : 1 image was about 120k and now is less than 60k just by changing its format to a lower resolution which doesnt affect the overall quality. Not sure how much time this will knock off, but will let you know. But i think that is worth attempting.
#7
09/27/2009 (2:59 pm)
I found the following:

Any images bigger than 256x256 take 1-2 seconds to load each. Anything less than that takes way, way less than a second. As I didn't have too many graphics in Fluttr it actually worked out better for me to use small individual pngs rather than a big PVR. Consolidating my script files helped save time too (strangely).

As it stands I have my company logo as default.png. Then a fading GG logo. I've modded the source so as the GG logo has finished fading up it loads my assets for main menu (built as a t2d scene). That way the user doesn't even know it's loading.

Then before your first level it puts up a little help screen which hides loading the rest of the assets. A lot of time time it's not about the length of time your game takes loading, but the length of time the user is waiting with a blank screen?

Hope some of that might help.