Jump to content


Photo

Pak Archive Dll


  • Please log in to reply
63 replies to this topic

#1 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 December 2008 - 08:22 PM

A PAK file is a type of archive that was used in Quake games to store data. This DLL allows you to edit those files or even make and use your own in your game. It simply stores data (or files) inside of a single file.

I highly suggest you do not use this even if it works. It's poorly written and not supported.

Download: Host-A
Archive Manager: Host-A

Special thanks to Uuf6429 for pretty much remaking the unit. I fixed some issues and made the DLL. Also re-fixed them. And then I fixed some bugs. He also made most of the archive manager, a long time ago. I just had the time to fix it up for public use (more user friendly, can drop files into archive).

Read before posting questions:
You do NOT need Quake or anything, it just allows you to use them (PAK Files) in your game easily.
You do NOT need Quake PAK files, make your own!
It does NOT encrypt/compress/decompress archives automatically, you must do it yourself.

Edited by TheMagicNumber, 04 September 2011 - 10:52 PM.

  • 2

#2 posva

posva

    GMC Member

  • New Member
  • 610 posts
  • Version:GM8

Posted 29 December 2008 - 09:05 PM

it's a good idea! i didn't try it beacuse it doesn't work on GM7. I recommend you to put the time it use for packing and unpacking, will be great if it use encryption and compression!
  • 0

#3 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 December 2008 - 10:10 PM

Thanks! I won't add compression, encryption may be added though. What did you mean here:

I recommend you to put the time it use for packing and unpacking

Like, get the time it took to unpack? Or progress?

Edited by GMREC1111, 29 December 2008 - 10:11 PM.

  • 2

#4 BrokenGlass

BrokenGlass

    GMC Member

  • New Member
  • 524 posts

Posted 29 December 2008 - 10:15 PM

What
  • 0

#5 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 December 2008 - 10:17 PM

What

That was pointless...
  • 2

#6 BrokenGlass

BrokenGlass

    GMC Member

  • New Member
  • 524 posts

Posted 29 December 2008 - 10:19 PM

No, i was just wondering what of use this would be.
  • 0

#7 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 December 2008 - 10:23 PM

Hehe, multiple uses. Too many to list.

Edited by GMREC1111, 29 December 2008 - 10:23 PM.

  • 2

#8 BrokenGlass

BrokenGlass

    GMC Member

  • New Member
  • 524 posts

Posted 29 December 2008 - 10:23 PM

Looks nice, should add compression too ^.^
  • 0

#9 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 December 2008 - 10:33 PM

I got a Huffman unit I could add to the DLL, you would need to call it on the file and it will not be threaded, just adding it on.

Added Huffman compression/decompression functions.

Edited by GMREC1111, 29 December 2008 - 11:00 PM.

  • 2

#10 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 29 December 2008 - 11:29 PM

What

Well, yeah, that's what I kinda thought, too.

Edited by Fede-lasse, 29 December 2008 - 11:29 PM.

  • 0

#11 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 30 December 2008 - 03:09 AM

Update
Added simple encryption, will take suggestions on a more secure way. Currently using XOR with single character keys.

Link in first post.
  • 2

#12 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 30 December 2008 - 10:22 AM

You can for example pack all of your game files using this into one file and then unpack them when the game starts. Sort of like GM's include files system, but with some added features, such as you can make it unpack a particular file (which is faster the unpacking all of them, as GM does).
Also, considering it's fully compiled, it's faster then GM's file functions.

By the way, on my home pc, I tried it on some example files not noticing one of them was an update 200Mb large. I took only a few seconds to pack/unpack it.

GMREC, an interesting feature you may add (and which is also a bit of a challenge) is to make threaded unpacking with progress. Just an idea though ;)

Edited by uuf6429, 30 December 2008 - 10:27 AM.

  • 0

#13 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 30 December 2008 - 01:14 PM

Maybe, but I'm not too experienced with threading.

You can even use this to contain update packages where they are compressed and you have them installed so hey don't need to download the entire game ;)

Fixed for GM7

Edited by GMREC1111, 30 December 2008 - 09:05 PM.

  • 2

#14 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 31 December 2008 - 09:39 AM

Actually PAK are compressed files and folders. Most commercial games use that 'format' which is actually a different compression algorithm encrypted. They are nice for storing external resources and organizing them transparently.
  • 0

#15 score_under

score_under

    Least kawaii

  • GMC Member
  • 1319 posts

Posted 31 December 2008 - 03:36 PM

Currently using XOR with single character keys.

If you want multiple character keys, it's not much different,
Single:
chr2=chr^key;

Multiple
if(index>strlen(key))
index=0;
chr2=chr^key[index];
index++;
  • 0

#16 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 31 December 2008 - 04:22 PM

Ok, I'll do that later. (Working on something else)

It isn't C++, it is Delphi. "^" is the symbol for a pointer. XOR is "xor" :D

Edited by GMREC1111, 01 January 2009 - 12:01 AM.

  • 2

#17 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 02 January 2009 - 04:37 PM

7z compression, and I'm happy.
  • 0

#18 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 02 January 2009 - 04:49 PM

7z compression, and I'm happy.

Umm, no. Huffman ftw.
  • 2

#19 SonicMX

SonicMX

    GMC Member

  • New Member
  • 30 posts

Posted 02 January 2009 - 05:07 PM

It's a bit more complicated than I thought, (or not really what I wanted?)

When you want to add a file to a pak, you just can add strings (or texts)?
I don't understand the way the DLL does it. if you want to add a file, why you have to enter the data next? Can't the DLL read the whole data from the file and then storage it?
  • 0

#20 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 02 January 2009 - 09:21 PM

I could add a function to add a file from a file. It will be doing the same thing and will just be easier on your side <_<

It will be done soon, multiple character keys for encryption will come with it. (Done, just need release)

Edited by GMREC1111, 07 February 2009 - 01:04 PM.

  • 2




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users