[.net] 'PAK' Format In .NET

Started by
9 comments, last by Rob Loach 18 years, 3 months ago
Hello, Does anyone here happen to know what the C# equivilent of the PAK format from this article: http://www.gamedev.net/reference/articles/article1991.asp is, and how to read the file in question? Thank you in advance. [Edited by - jmac7142 on November 11, 2005 1:39:31 AM]
Advertisement
Most file formats (like PAK) are language independant...

If you understand C# and C++, it's trivial to write a loader/saver in C#.
I'm unfamiliar with anything but VC++ .NET and C# .NET, and that article appears to be written in MFC. Also, I asked if anyone had a .NET method of reading the PAK format (with a BinaryReader if possible). Plus I'd like to understand how the code works, instead of just copying it into a code file.
Hi

Ok i've done what you requested , based on the article you posted.

HOWEVER I did not include the "cryptography" - because I feel that if you want to learn something it is better to understand how it works and then later add "cryptography".

This Library creates and reads PAK files as layed out in the above mentioned article (minus the "cryptography").

You can specify if you want to read one / or all of the files from the pak file etc.

Review the source code for more information -

please note that this is not optimized code due to the fact that I tried to do it in a simple fashion for you to understand and also 'cause I got other things to do ;)

You can download the Source here :

http://196.34.38.100/code/CSharpPakCompilerSource.zip

This server may be up for a few days , but after that this link will no longer function .... - maybe i'll do a codeproject or gamedev.net article on this at a later stage ;)

HOW:
Open PakCompiler\PakCompiler in Visual Studio .NET 2003 , fix up the references and Build.

As you can see it is a console application that does a small test run of the library (PakLib)

Also , this will pickup any files in the specified directory and also in the
sub-directories - thus the naming in the filetableentry class would reflect that. e.g. \somefolder\someinnerfolder\file.txt

NB: if you have large files it may seem if the application is not responding but it is busy - you can add a Application.DoEvents() - if you want to still use the GUI if it takes too long , or spawn it in a different thread.

Anyway , this code is released AS IS , YOU USE IT AT YOUR OWN RISK

Hope it helps
Bye
Le Roi Beukes
leroi123456@hotmail.com
There is SharpZipLib that will read a number of different compression file formats. PhysFS is a great compression tool to load in different file formats. It comes with a .NET interface as well [wink]. Good luck!
Rob Loach [Website] [Projects] [Contact]
Ummmm, that link (http://196.34.38.100/code/CSharpPakCompilerSource.zip) doesn't appear to be working as of approximately 6:48 EST, November 11th.
Although I didn't try it out, I did make a mirror for it: CSharpPakCompilerSource.zip. Once I get the time, I'll give it a test.
Rob Loach [Website] [Projects] [Contact]
Hi

The link should be fine, you can also try the mirror site - I tested this and is working , otherwise drop me an e-mail at leroi123456@hotmail.com and I'll e-mail you the file.

Thanks
Le Roi
Hello,

I actually have one more question, how would read the same sort of file, except in this case it contains multiple resource tables. More specifically, there is a header and 3 data tables.

Thanks in advance.

Hi

I've done a small vertical scroller space game in .NET 2.0
using Managed DirectX , and would like people to test it for me , anyone out there can send feedback to leroi123456@hotmail.com

It's Work In Progress - so don't expect miracles :)

http://196.34.38.100/code/ArenaST.exe.rename

Thanks
Le Roi
leroi123456@hotmail.com

This topic is closed to new replies.

Advertisement