Skip to main content
GameDev.net gamedev.net
🔒 Locked

Packing resources

Started by JohnLamock Aug 25, 2006 at 7:17 AM 6 replies 1.3k views
Original Post
JohnLamock
JohnLamock
Hi friends, I was looking inside some JAR files from several Studios and I had notice that some files had a kind of pack for the resources. I tried to google a little bit but found nothing useful. My idea to make something like that is to create a file with all the images put in order with headers saying the size of the next file. I don't know if it's the better way, or if I'm completely wrong. Anyone have some experience with that? Thanks in advance, John.
zolee
zolee
I think yours is a good idea. I did the same for images, fonts, game dialogs etc.
For example I stored all images to a single DAT file.
This file has a header, which tells offset/size of each image.

Also, I decided to use a simple pixel image format instead of BMP, JPG etc.
The image also has its header (storing ID, dimensions etc)

I store only 16 bits of data per pixel (as I don't need more for Windows Mobile RGB-565), and I apply a simple RLE compression. This makes an image a lot smaller than the corresponding BMP file.

Of course this approach requires you to code a image conversion utility, a datafile builder, and routines to load the datafile & parse image data.

br,Zolee------
JohnLamock
JohnLamock
Thank you for the replies!

shmoove, I think that is exactly what I was looking for!
I'll take a better look...

Regards,

John.
Greig Hamilton
Greig Hamilton
If you want to pack all your images into a single file and they use the same palatte then you can save even more space by only storing the palatte once.

Have a look at the sticky thread on www.j2meforums.com (under game development) called something similar to Tips and tricks to make your PNGs smaller. This contains a lot of useful information on how to reduce the size of your files.

Finally don't forget to use something like PNGCrush to reduce the size of your PNG files.

Greig
shmoove
shmoove
Quote:
Original post by Greig Hamilton
Have a look at the sticky thread on www.j2meforums.com (under game development) called something similar to Tips and tricks to make your PNGs smaller. This contains a lot of useful information on how to reduce the size of your files.

Give me all your tricks for minimizing jar file size. A great resource indeed.

shmoove
JohnLamock
JohnLamock
Hey Greig, thank you very much for the tip!

I read the entire topic and it helped a lot! Thank you again!

Thanks for all people who reply the topic!

Regards,

John.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.