06-17-2012, 05:40 AM
Xonotic 0.6 came out at 964Mb and with the improvements still coming, 1.0 could break the Gb barrier. All of this size does create a barrier to getting more people into this game and has other problems too. Contrary to the belief of teenages using their parents Internet, students in university accommodation and freeloaders hopping onto someone elses wifi, bandwidth always has a cost to someone.
Prior to Nexuiz 2.0 I did a bit of work which hacked 30Mb off the download size at the time and I thought it would be worth doing this again. This is all intended to be without loss of quality, it's just about putting a bit more effort into compression. Hopefully this may have a small performance payoff when loading the game too as when you compress a ZIP harder, it is ALWAYS faster to extract, unlike LZ78 based formats.
I've based this on the rysnc version as this is packaged up. Some of these items are just cleaning up too.
1. There are a lot of empty directories within the PK3 files under textures/. I'm sure these are left from some useful point in the past but now just add to the size of the ZIP and overcomplicate the file structure the game has to work with.
These could be found and removed with:
Or use this in the makefile to pass a list of exclusions to 7za.
2. Both font-nimbussansl-rsync.pk3 and font-xolonium-rsync.pk3 contain an identical unifont....ttf file which sits in data/fonts. As pk3's are read in alphanumeric order the xolonium one with replace the nimbussansl one in use. The file is quite large and might compress well but it's still 2.7Mb. This could either be removed from one PK3 or the 2 PK3s combined.
3. data-rysnc.pk3 has an autoexec/empty.cfg file in it. Does this need to be here?
4. Compression of the PK3s and the main ZIP with 7za is not as aggressive as it could be. About 1% can be gained by compressing with:
5. There are a number of makefiles, perl scripts, ruby scripts in the PK3s themselves. Do these files need to be there? If they are only used to build certain parts of the game, they could be in source/ or available just on git. Having them in the PK3's adds to the filelist that the gaem is having to run with.
6. There are quite a lot of darkplaces-icon files in data-rysnc.pk3. Not sure if these are duplicated from source/darkplaces/ but they seem unneccessary where they are anyway. To build the executable with the icon, they're in the source directory, if a user wants an icon for their desktop, they're not going to look in the PK3! If they are intended as master files for making smaller icons out of then they could be left in git rather than the PK3 where they just bloat the game filestructure.
7. tuba.png and tuba.svg images are in docs/. Should these be in docs/htmlfiles/weaponimg? Or excluded?
8. fteqcc/ could perhaps be moved in misc/tools/ as it matches in better with whats in there.
9. There is an sdl.dll in the root of the game directory. Should this be moved into bin32/? There is already one in bin64/ but not bin32/. Maybe some technical reason I've missed.
10. PNG images can be optimised a little more:
11. JPEG images can be optimised more too:
Don't worry about the multiple jpegoptim runs, that's needed to get it done right!
12. The executables and libraries now total over 100Mb! While this does compress quite a bit, they remain a very substantial part of the package. While a universal download has to contain so many architectures this will be the case and can't be helped. If the x86 builds were to change to -march=pentium3 then a small reduction might be seen.
13. Sources. I know it's a GPL requirement for them to be available but do they need to be in the main package? Do the map sources need to be in the PK3? 99.9% of downloaders won't ever use any of the sources. Anyone else can look on git. That's one opinion on it, obviously there are a lot of different ones.
No idea on a precise figure for improved size as yet but maybe 900Mb is possible?
I'd be happy to implement any of these in git if someone wants to give me access. I realise there is a lot of 'faffing' to be done in some of these cleanup steps and quite a bit of CPU time in rebuilding everything but it may actually make maintaining and rebuilding things easier in future just by the cleanup involved.
Prior to Nexuiz 2.0 I did a bit of work which hacked 30Mb off the download size at the time and I thought it would be worth doing this again. This is all intended to be without loss of quality, it's just about putting a bit more effort into compression. Hopefully this may have a small performance payoff when loading the game too as when you compress a ZIP harder, it is ALWAYS faster to extract, unlike LZ78 based formats.
I've based this on the rysnc version as this is packaged up. Some of these items are just cleaning up too.
1. There are a lot of empty directories within the PK3 files under textures/. I'm sure these are left from some useful point in the past but now just add to the size of the ZIP and overcomplicate the file structure the game has to work with.
These could be found and removed with:
Code:
for c in `find . -type d -empty`
do
rm -rf $c
done
2. Both font-nimbussansl-rsync.pk3 and font-xolonium-rsync.pk3 contain an identical unifont....ttf file which sits in data/fonts. As pk3's are read in alphanumeric order the xolonium one with replace the nimbussansl one in use. The file is quite large and might compress well but it's still 2.7Mb. This could either be removed from one PK3 or the 2 PK3s combined.
3. data-rysnc.pk3 has an autoexec/empty.cfg file in it. Does this need to be here?
4. Compression of the PK3s and the main ZIP with 7za is not as aggressive as it could be. About 1% can be gained by compressing with:
Code:
7za a -tzip -mfb15 -mpass258
5. There are a number of makefiles, perl scripts, ruby scripts in the PK3s themselves. Do these files need to be there? If they are only used to build certain parts of the game, they could be in source/ or available just on git. Having them in the PK3's adds to the filelist that the gaem is having to run with.
6. There are quite a lot of darkplaces-icon files in data-rysnc.pk3. Not sure if these are duplicated from source/darkplaces/ but they seem unneccessary where they are anyway. To build the executable with the icon, they're in the source directory, if a user wants an icon for their desktop, they're not going to look in the PK3! If they are intended as master files for making smaller icons out of then they could be left in git rather than the PK3 where they just bloat the game filestructure.
7. tuba.png and tuba.svg images are in docs/. Should these be in docs/htmlfiles/weaponimg? Or excluded?
8. fteqcc/ could perhaps be moved in misc/tools/ as it matches in better with whats in there.
9. There is an sdl.dll in the root of the game directory. Should this be moved into bin32/? There is already one in bin64/ but not bin32/. Maybe some technical reason I've missed.
10. PNG images can be optimised a little more:
Code:
for a in `find . -name *.png`
do
optipng -nb -nc -np -nz -i0 -q -strip all $a
advpng -z4 $a
done
11. JPEG images can be optimised more too:
Code:
for b in `find . -name *.jpg`
do
jpegoptim --strip-all --quiet $b
jpegtran -progressive -outfile $b $b
jpegoptim --strip-all --quiet $b
jpegoptim --strip-all -m95 --quiet $b # Cap JPEG's at m%
done
12. The executables and libraries now total over 100Mb! While this does compress quite a bit, they remain a very substantial part of the package. While a universal download has to contain so many architectures this will be the case and can't be helped. If the x86 builds were to change to -march=pentium3 then a small reduction might be seen.
13. Sources. I know it's a GPL requirement for them to be available but do they need to be in the main package? Do the map sources need to be in the PK3? 99.9% of downloaders won't ever use any of the sources. Anyone else can look on git. That's one opinion on it, obviously there are a lot of different ones.
No idea on a precise figure for improved size as yet but maybe 900Mb is possible?
I'd be happy to implement any of these in git if someone wants to give me access. I realise there is a lot of 'faffing' to be done in some of these cleanup steps and quite a bit of CPU time in rebuilding everything but it may actually make maintaining and rebuilding things easier in future just by the cleanup involved.
I'm at least a reasonably tolerable person to be around - Narcopic