How to deal with many files

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pink
Posts: 272
Joined: Wed Mar 12, 2014 6:18 pm

How to deal with many files

Post by pink » Thu Nov 23, 2023 2:53 pm

Okay livecodinians, I am working on a game that is going to have a fair amount of graphics and sounds clips. It will be necessary to download more of each as things progress. I don’t have an exact number, but the initial count is over 500 files at around 250MB, though I am trying to shrink the size.

So, I'm looking for speed, flexibility and I am trying not to be a memory hog

I’m trying to decide what would be the best way to keep and maintain all this. My thoughts are:

1. Store everything as individual files in a directory. - Really don’t like it, but that’s an option.

2. Save to an external stack. Seems like it could take a long time to load, but it would be easy to call up images as needed.

3. Save to multiple external stacks. I could make a number of smaller stacks which I could load in as needed instead of all at once. Can anyone think of a downside?

4. Sqlite database. Honestly have no idea how much this would take up in time and resources. With the stacks, they have to be loaded in memory, but does a sqlite DB have the same issue?

5. Is there some way to create smaller archives that can be opened as needed, like a zip file or something similar?

Any opinions or suggestions?
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

bwmilby
Posts: 442
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: How to deal with many files

Post by bwmilby » Fri Nov 24, 2023 2:49 am

I worked with SivaSiva that had a similar issue (although mainly was reducing app size). The approach that was used there was the file based one. A zip file was prepared with the assets and it was downloaded after the app installed. Once downloaded, the files were extracted and the zip file deleted. Depending on requirements, you could actually do much of the downloading in the background and use the callbacks to put files where needed and set flags that the content was available. We also used a similar approach to the stories feature which required a batch of images for each one.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Games”