   Game Data, Compression?
  These days in most games i see everything is stored in just a few filesSo far iv just been using the normal DirectX files.Can anyone give me any information on this?And many how to implement something like it.many thanks   
  It's usually called a "datafile". And it can be as simple as parsing a directory and storing all of the files found in that directory into a single file, in a linear order. I set mine up to include a lookup directory at the top of the file, which is just a simple list of {Filename,Offset} structures. To load a file, you look through the structure list to find the filename, then seek to it's offset and load it.Some games don't even bother to compress their datafile. But if you want to, you might want to look into zlib, or another compression library.I can be more specific about the processes. I'm just not sure of how far along you are in your programming abilities.   ;  Well iv been programming C++ for about a year and a half and direct-x for about 6 monthsIv touched on storing game saves in .dat files so i think id probably understand   ;  Data compression generally isnt too practical in modern systems with 80GB plus hard drives. But talking about the data 'paks' you see in most games are because the number of file pointers the system can allocate are finite so it's done to conserve those.A method for data compression i prefer is to compress each file seperately, strip the headers off each compressed file (note this basic method will only work if you use the same type of compression on each file) , inject the result into your data pack and add an entry into your data file table with the offset to the file. To decompress the data find the specific file name you are looking for, copy the compressed data into memory, and unpack the compressed data into the final buffer allocated for the purpose.Edit: you could use different compression methods on each file given you put that data into the data pack file table.[Edited by - callmewhitey on September 8, 2007 9:18:25 AM];  Just for clarification, the zlib library allows compressing file data in memory chunks, so you're free to compress whichever parts of the file you want.   ;  You can always try PhysicsFS.   ;  Hmm storing multiple files in 1 file is a little confusing to me could someone point me to a example or tutorial or write one of coursethanks   