Sign in to follow this  
jmac7142

[.net] 'PAK' Format In .NET

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Most file formats (like PAK) are language independant...

If you understand C# and C++, it's trivial to write a loader/saver in C#.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this