April 4th, 2007, 05:08 PM
How a game handles compressed files
I think nowadays, most of the games have their data files compressed in several packages(For ex, quake3 and doom3 engines have pk3 compression file format to store the game data.)
My question is, how do they handle the compressed files? I guess the method should be either..
1) Extract them in a temporary folder, and remove all the files and the folder when the loading is finished.
Pro : You can simply extract all those files and use game
library modules to load the files by specifying the
Con : All the data files are revealed to the user. Needs extra
hard disk memory, since all the data is being extracted.
2) Read directly from the packages.
Pro : The game can keep the files in the archive under
its encryption. It doesn't need extra hard disk memory.
Con : You have to write your own functions to load the
data, such as bitmaps, from the package to the
buffers, and many other things.
3) Some other methods probably.
What do you think?
April 4th, 2007, 08:50 PM
Well for Quake and doom and wolf etc... that use pk3's pk3 is just a zip file. If you rename it (or just open it) with a program that can handle zip files you can see everything inside it. I don't think they are normally trying to *hide* the files, they are compressing them to save on space.