Compressing data in a project

Started by
5 comments, last by SimonForsman 15 years, 11 months ago
This might be the wrong place to post this so I apologize. I'm kind of a newb when it comes to this sort of thing, but I understand that there is importance in compressing pictures/music in a game project so that others simply can't take the files and view them easily. I guess my question is simply, how would I go about doing this, and what are some common methods. Perhaps something as simple as pointing me in the right direction would work. I just don't know where to start :/
Advertisement
Quote:Original post by Arbel
I'm kind of a newb when it comes to this sort of thing, but I understand that there is importance in compressing pictures/music in a game project so that others simply can't take the files and view them easily.
The importance of compressing game content is so the game takes up less space. Keeping others from viewing your textures is both impossible and unnecessary.
The easiest way to do this is to dump your resources in an ordinary zip file and use an existing archive library like PhysFS.
I suppose that is true, but at the same time I don't see any game projects where there is a mass jpeg folder of every game image or mass mp3 folder of all the games music. I usually see unknown files types etc. Is that solely done to save on size?

Or maybe I'm just confusing compression with something else...Like I see most games nowadays where you open up the folder and its all in one data file so you can't just directly access the resources. Maybe compressed was the wrong choice of word?

[Edited by - Arbel on May 26, 2008 10:22:24 PM]
You're confussiong compression with simple packing. Those files are just a bunch of mp3s and whatnot smushed together. The game knows where in the master file to find each file it contains. The final master file itself might be compressed, but its to save space, as mentioned above, not to hide the contents.

Even for games like wow, people can bust these files open, and check out whats inside, you cant really do to much to stop it from happening.
Thank you Tstrimp, that's exactly what I was looking for. Here's the link if anyone is interested(http://www.gamedev.net/reference/programming/features/pak/)

Feel free to close this topic as well.
Quote:Original post by Arbel
I suppose that is true, but at the same time I don't see any game projects where there is a mass jpeg folder of every game image or mass mp3 folder of all the games music. I usually see unknown files types etc. Is that solely done to save on size?

Or maybe I'm just confusing compression with something else...Like I see most games nowadays where you open up the folder and its all in one data file so you can't just directly access the resources. Maybe compressed was the wrong choice of word?


You want to avoid having multiple small files since:
1) no matter how small the file is it will always occupy atleast one block on the harddrive.

2) the OS will do its best to keep a single file stored in one large continuous block on the disc so that it can be read quickly, it will always be slower to read in multiple smaller files. (not only due to them being spread out physically, but also due to OS overhead with opening and closing files)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement