Dramaticly reduce Download Sizes

Blitz3D Forums/Blitz3D Tutorials/Dramaticly reduce Download Sizes

jfk EO-11110(Posted 2004) [#1]
These are some Tipps to reduce the Filesize of your Demos.

Let us assume you have made a nice Demo with lots of BMPs and WAVs and the size is enormous, even when zipped. I guess you are way too lazy to edit your game code to use JPG and OGG instead. The good thing about this is: You don't have to!!!

Blitz checks the file-formats not from the filename extension, but reads the fileheader and recognizes file formats such as jpg or ogg, no matter how the filenames are!

This is why you can convert your BMPs to JPGs (or to PNGs, where nonlossy images are required, usually masked textures or images) and then rename it to .BMP. Blitz will then find the "whatever.BMP", but will recognize and load it correctly as a JPG.

You can do the same with WAV / OGG.

This way I reduced the size of my latest demo from 11 to 6 Megabytes.


CyberHeater(Posted 2004) [#2]
Cool. You learn a new thing every day.


Michael Reitzenstein(Posted 2004) [#3]
Use TGA where possible. With 7Zip compression, it's lossless and smaller than PNG in most cases.


Rob Farley(Posted 2004) [#4]
Also, for file size stuff, if you're using a png, make sure grey scale images are 256 colour images, and also try reducing the colour depths of other images, if it still looks fine then that's cool. 3D stuff will convert it up to full colour again but it saves disk space and ultimately download times.


Warren(Posted 2004) [#5]
Use TGA where possible. With 7Zip compression, it's lossless and smaller than PNG in most cases.

What about game load times once the files are on the hard drive? Do the larger TGA files have a noticeable lag when loading, say, hundreds of them compared to the smaller PNGs?


Speaking of PNG ... I've asked this before but can't get a definitive answer. Which paint programs, version numbers as well please, support editing and loading/saving of PNG files with alpha channels? They all support PNG, but I've yet to find one that actually works with alpha in the PNG...


Rob Farley(Posted 2004) [#6]
I know Paint Shop Pro 7 does... 'cos I use it!


Warren(Posted 2004) [#7]
It does? I've never been able to make alpha work in that. Can you also load TGA's with alpha channels and actually SEE the alpha? My PSP7 always ignores alpha, totally and utterly.

Can you successfully load and edit 32-bit TGa files?


Rob Farley(Posted 2004) [#8]
Yep.
Look in the masks menu, "Load from Alpha Channel" will suck the alpha off the image.
When you save the PNG, you have to run the optimiser and set the transparancy to "Alpha Channel Transparancy"


MrCredo(Posted 2004) [#9]
hm this is very old trick


Warren(Posted 2004) [#10]
Rob

Neat! I had no idea ...

Now, is there a way to edit that alpha information from within PSP7?


Rob Farley(Posted 2004) [#11]
Mask... edit.


Warren(Posted 2004) [#12]
Man! I had no idea I could do this in PSP. Thanks Rob, the info is MUCHO appreciated!!


Rob Farley(Posted 2004) [#13]
I find reading the manual is quite handy sometimes. But then I think I'm one of the few people who have a manual and a box for PSP.


Warren(Posted 2004) [#14]
I have the manual, box and the whole deal.

Perhaps if they used standard industry terminology I would have found the information instead of thinking, "What the hell is a mask?"

You have to admit, the implementation is -very- clunky. Why they wouldn't just copy the Photoshop model is beyond me...

At any rate, thanks again!


Rob Farley(Posted 2004) [#15]
No wucking furries.