poetaster / machines-vs-machines-sfos

Machines vs. Machines for Sailfish OS
GNU General Public License v3.0
0 stars 0 forks source link

Move level data out of installation dir #2

Open nephros opened 2 years ago

nephros commented 2 years ago

At ~36 MB MVM is one of the larger packages out there on SFOS, and regularly one of those that get uninstalled before system upgrades to make space.

The majority of the space is taken up by the data/ subdirectory.

Suggestion:

Alternative:

The second would allow one to just uninstall the space hog, and have the app functional without reinstalling. It would also allow separate life-cycles (versions) of app and level data if that is useful.

poetaster commented 2 years ago

I think to store data in ~/.local/share/ is the best idea. I haven't tried this in a .spec yet but assume there's a way to do it. Suggestions! The only drawback to this approach is the data hanging around in .local after uninstall. hmmm.

The data being in /usr/share/app/data also has the downside that testing with QML live is a bust.

Thanks for the feedback.

poetaster commented 2 years ago
install -D -t %{buildroot}/%{_datadir}/%{name}/data/* \
    ~/.local/share/de.poetaster/appname/data \

maybe.

poetaster commented 2 years ago

I'm going to look at getting the sound files (that's a third of the data!) smaller first... Maybe I can smoosh the data to suit our needs :)

poetaster commented 2 years ago

for file in ls *.ogg; do ffmpeg -i $file -c:a libvorbis -b:a 64k -ac 1 ${file}.ogg;done

The hammer here is stereo to mono, which I wouldn't normally do. The 64K down from 160 is just fine (only audible on studio monitors).

That takes one directory from 13 MB down to 4.8.

poetaster commented 2 years ago

All the wave files for fx where too large and stereo. Which explains why the game stutters when a lot of cannons are going.

poetaster commented 2 years ago

Ok, it's down to 22.1M now, in total. I can refine the png crush and probably save another 1-2 MB. Smaller than patience deck :)

Still, I'll look at doing this in stages:

  1. take the shoot the sherif variant and externalize to package (7M less)
  2. Make a variant stage with less levels (reduce m vs m level by 7M)

This would get us under 10mb. But I'll have to find the time.