00:00
00:00
Newgrounds Background Image Theme

Zombiehit just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Loading lots of local files quickly

370 Views | 6 Replies
New Topic Respond to this Topic

Hey I've created an Android game, but I fear that my initial loading time is making people annoyed with my app. I load about 300 image and audio files at the start from a local folder via the Loader class. I have messed around and found out that 3 simultaneous loaders is the quickest way using my method.

My question is, is there a faster way of loading the files without freezing the entire application for about 10 seconds ( which happens if I load them all at the same time )? Thanks :)

The game can be found here

Also I've been stuck on 109 downloads forever :/

Response to Loading lots of local files quickly 2014-07-02 16:54:49


well, the answer is pretty simple: don't load 300 assets at the same time.

The whole point of loading things from external sources is to reduce the initial load time and load each asset when it's required.
If somebody starts level one of a game, load all files for that level.

Response to Loading lots of local files quickly 2014-07-02 17:13:36


At 7/2/14 04:54 PM, milchreis wrote: well, the answer is pretty simple: don't load 300 assets at the same time.

The whole point of loading things from external sources is to reduce the initial load time and load each asset when it's required.
If somebody starts level one of a game, load all files for that level.

Yeah I load the maps themselves separately. Most of the assets are needed for every level. But I guess I could load the individual "towers" and their assets once the player actually buys them, hmm, I guess a couple of small loads is better than one big one. That would mean a whole lot of redesign, but it's probably the best way. Thanks for your suggestion :)

I guess I was hoping that since the files are on a local flash drive, it would be pretty quick to load them all, but I see your point.

Response to Loading lots of local files quickly 2014-07-02 19:04:55


Try an asynchronous loop with a load bar? That will free up the screen for updates, or is it just the time you're worried about?


If ya have something to say, PM me. I have a lot of time to spare.

Also never PM egg82.

BBS Signature

Response to Loading lots of local files quickly 2014-07-02 19:52:03


At 7/2/14 07:04 PM, MintPaw wrote: Try an asynchronous loop with a load bar? That will free up the screen for updates, or is it just the time you're worried about?

Hey,thanks. I'm worried about time. I'm already loading batches in an asynchronous loop, three at a time.

But I have taken the first suggestion to heart and have started organizing every unit into folders and loading them when needed, I guess there's no other way around it. Also I will do background loading, prob 1 file at a time when in the main menu, so that if the user is looking around the next load time will be shorter :) I think I can get away with it performance wise. Lots of work to do though :p

Thanks for your suggestion.

Response to Loading lots of local files quickly 2014-07-03 13:49:15


You could try to async load them while in the menu or something, between every menu transition load 20 assets or something. There's way you could make it work, but they're all quick hacky fixes. Proper organization is the way to go.


If ya have something to say, PM me. I have a lot of time to spare.

Also never PM egg82.

BBS Signature

Response to Loading lots of local files quickly 2014-07-03 14:33:05


At 7/3/14 01:49 PM, MintPaw wrote: You could try to async load them while in the menu or something, between every menu transition load 20 assets or something. There's way you could make it work, but they're all quick hacky fixes. Proper organization is the way to go.

Yes like I said in the previous post, do a little loading while in the menu. But i will not hack it in, I'll do it proper ;) thanks