1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Concord, California
    Rep Power

    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
          file locations.
      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?
  2. #2
  3. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Rep Power
    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.

IMN logo majestic logo threadwatch logo seochat tools logo