April 4th, 2007, 06:08 PM
Join Date: Feb 2007
Location: Concord, California
Time spent in forums: 9 h 34 m 22 sec
Reputation Power: 0
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?