Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert music files to OGG to save disk usage #1

Open
akien-mga opened this issue Jul 24, 2019 · 5 comments · May be fixed by #2
Open

Convert music files to OGG to save disk usage #1

akien-mga opened this issue Jul 24, 2019 · 5 comments · May be fixed by #2

Comments

@akien-mga
Copy link
Contributor

Hi Paweł,

I'm looking into packaging Intrepid for my Linux distro Mageia, and it seems to work well even with Godot 3.1.1.

The source tarball and exported .pck are both pretty heavy, and it seems like there are some low hanging fruits to reduce this disk usage and bandwidth requirement on install.

$ du SOURCES/intrepid-1.0.4.tar.xz 
833M    SOURCES/intrepid-1.0.4.tar.xz
$ du RPMS/noarch/intrepid-1.0.4-1.mga7.noarch.rpm 
188M    RPMS/noarch/intrepid-1.0.4-1.mga7.noarch.rpm

A first thing is that all sounds are in .wav format, while the music tracks could likely work just as well in .ogg with decent enough quality:

$ du sounds/*.wav | grep M
27M     sounds/credits.wav
1,5M    sounds/escape_door.wav
3,5M    sounds/exit_music_reverse.wav
15M     sounds/game_outro_music.wav
7,0M    sounds/intro.wav
87M     sounds/main_music_loop.wav
4,3M    sounds/rumble_mono_1.wav

In the .pck, the .wav files are recompressed to Godot's proprietary .sample format, but the size difference is not big (60M for main_music_loop.wav-40af629615e14c1e1b8d4b2a30d791c4.sample).

After converting the ones which seem to be music tracks to me, I get:

$ du sounds/*.ogg
832K    sounds/credits.ogg
188K    sounds/exit_music_reverse.ogg
1,2M    sounds/game_outro_music.ogg
240K    sounds/intro.ogg
4,0rM    sounds/main_music_loop.ogg

With these changes I go from:

$ du sounds/
148M    sounds/

to:

$ du sounds/
17M     sounds/

In the tarball, I save 104 MB:

$ du ../intrepid-1.0.4.tar.xz 
729M    ../intrepid-1.0.4.tar.xz

I played the main menu music, credits and intro, I don't notice much quality loss, though I'm not a very experienced audio person :)

I did changes locally, so I can PR them if you're interested.

@akien-mga
Copy link
Contributor Author

I did changes locally, so I can PR them if you're interested.

Changes are in https://github.com/akien-mga/intrepid/tree/music-ogg if you want to test.

@akien-mga
Copy link
Contributor Author

akien-mga commented Jul 24, 2019

BTW, final package size (which contains only the .pck + some stuff like README, .desktop file and launch script):

$ du RPMS/noarch/intrepid-1.0.4-1.mga7.noarch.rpm 
129M    RPMS/noarch/intrepid-1.0.4-1.mga7.noarch.rpm

So 59M saved in the final distribution.

One would expect that the 700M worth of textures would make up more of the final package, but I assume they're exported compressed and end up much smaller than their 2k PNG originals.

Size difference on the .pck itself:

$ du -s /usr/share/games/intrepid/intrepid.pck 
417M    /usr/share/games/intrepid/intrepid.pck
$ du -s /media/data/Games/Steam/steamapps/common/Intrepid/Intrepid.pck 
499M    /media/data/Games/Steam/steamapps/common/Intrepid/Intrepid.pck

(Interesting to see how much RPM can reduce the package size, I wouldn't expect .pck to be so compressible.)

@akien-mga
Copy link
Contributor Author

Unrelated, but one thing I missed in the game or README so far is the attribution/copyright notice for Godot Engine itself as per the MIT license: https://github.com/godotengine/godot/blob/master/LICENSE.txt

Including the legalese in the game is a bit boring, so what I recommend usually is to put a statement that the game is developed with Godot Engine somewhere with a link to https://godotengine.org/license.

@akien-mga
Copy link
Contributor Author

I'm looking into packaging Intrepid for my Linux distro Mageia, and it seems to work well even with Godot 3.1.1.

I spoke a bit too fast here, the door of the first room doesn't open on 3.1.1. I'll see if I can fix that while preserving compat with 3.0.6.

@akien-mga akien-mga linked a pull request Jul 24, 2019 that will close this issue
@miskatonicstudio
Copy link
Owner

@akien-mga Godot Engine's license has been added to README, sorry it took me so long ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants