Original Post
A while ago I started working on a way to archive multiple files for my future games. I thought up a few different formats and created console programs to test them. The problem is that both have their pros and cons and I would like to know which format you guys think is more efficient before I making a more complex Win32 app and API for my games. First Setup ----------- [main header] [file header 1] [file/name data 1] ... [file header n] [file/name data n] The main header includes an id, the number of files, etc. Then each file has a main header with file and name size, and some other information. Second Setup ------------ [main header] [file header 1] ... [file header n] [file/name data 1] ... [file/name data n] In this version all of the headers are at the beginning of the file, and all of the data comes after that. --------- The first one is easier when it comes to adding files because it can simply add the next one right after the last file, unlike the second setup which requires all of the data to shift down when a new header is added before the file data. The second one is faster when it comes to reading files though because you can simply calculate [main header size + file header size * file number] to get the file offset then quickly move to that location in the file. The first version on the other hand requires you to read a file, jump ahead, read a file, jump ahead, etc. Which one should I stick with?