Creating a Data Pack file

EFileTahi-A

Contributor
Joined
Aug 8, 2004
Messages
623
Location
Portugal / Barreiro
Ok, how can I create a data pack. You know, creating a file to hold all types of files (graphics, sounds, text files etc...) like Quake's .pak files.

Any, yet, small information on this subject will be much apreciated.
Thank you.
 
Often a .pak file or .wad or whatever is just a way to store related files together. If you have no particular format requirement then you may as well just use a zip file or similar.
 
But then I will have to unpack it first to get those files (right?).

I was thinking of something like grouping the files only, with no compression. And this grouping process must be done with C# language. I mean, creating my own file format for grouping files.

I don't know if I'm being explicit or not. Please do let me know about it.
 
Are you trying to group all of your files together to prevent end users from editing them? If what you would need to do is create a custom binary resource file.

This link is to Visual Basic 6.0 samples, but it shouldn't be too dificult to transfer the code to .NET, as it seems that you are after the logic of doing this instead of the source code.

http://gpwiki.org/index.php/VB:Tutorials:Custom_Resource_Files
 
Nate Bross said:
Are you trying to group all of your files together to prevent end users from editing them? If what you would need to do is create a custom binary resource file.

This link is to Visual Basic 6.0 samples, but it shouldn't be too dificult to transfer the code to .NET, as it seems that you are after the logic of doing this instead of the source code.

Thank you. I will look into this, although I would prefer to have a C# example...
 
Using a simple format like a zip file will allow you to replace / edit assets easily. A custom binary file will require the entire .pak (or whatever you call it) to be rebuilt and repacked everytime something changes.
If users modifying the files is an issue you could always encrypt the assests or simply password the zip itself.
 
I see what you mean.
Although the main purpose of the pack file thing is only for storage, not to constantly changing its contents, it's like when .NET compiles the hole project into a single executable file to be setup elsewhere, although in this way I don't want it to be executable but to store data only. Yet, I'm not worried about how easy it's contents can be unpacked by thirds.
 
Back
Top