Archived

This topic is now archived and is closed to further replies.

v0dKA

Regarding .pak's

Recommended Posts

v0dKA    568
Can some1 please explain what is the purspose of a .pak? Isn''t it some sort of a compression file? Also, how do you modify programs with other programs? Specifically, what i want to do is release a game, and as time goes on, introduce add-ons and upgrades through .pak''s which a player can download, and then unpak into the game directory. Can that work? ps -- doesn''t necessarily have to be a .pak

Share this post


Link to post
Share on other sites
jtmerchant    126
Umm... most games use DLLs (Dynamic Linking Library). Basically They link at runtime when the EXE calls the function or initiates a class that exists within the DLL. This way you can have the main EXE then however many DLLs you need for each area of code and when you have to patch something, for example, say one of your particle systems for your spells is causing an error on certain systems, you can give the user a new magic.dll file in a patch. Might not be the best example if you haven't played EverQuest, but you get the picture... hopefully. I haven't really found a good tutorial on calling functions from DLLs but I know some of the basics.

EDIT:: Correct me if I have any incorrect or misleading information, as usual.

[edited by - jtmerchant on January 17, 2004 9:28:05 PM]

Share this post


Link to post
Share on other sites
OrangyTang    1298
quote:
Original post by v0dKA
Can some1 please explain what is the purspose of a .pak? Isn''t it some sort of a compression file?

.pak files for the quake engines are just that, a collection of files (with directory info) compressed into one big lump. Its worth noting that although Q1 & Q2 used a custom file format, Q3''s .pk3 files are just winzip files with a different extension. To open a .pak file you can grab QuArK (Quake Army Knife) which will let you take a peek inside them.

[qupte] Specifically, what i want to do is release a game, and as time goes on, introduce add-ons and upgrades through .pak''s which a player can download, and then unpak into the game directory. Can that work?

Quake''s system is simple yet flexible, so i''ll just cover the main points to give you a few ideas.

At game start the game directory is set which is a sub dir of the games installed dir. Defaults to something like /id. All game specific data gets loaded from here which is how mods can be added and override default models, code, data etc.

Pak files are named pak0.pak all the way to pak9.pak. Any data to be loaded is checked in the 9th one, then the 8th etc until it is found. This way anything in a later file overrides the earlier ones - tends to get used for patches which can just drop a newer pak file in and leave existing files alone.

But one of the most handy things is that anything in the dir can also override all the data in the pak files, if its in the same relative dir. /maps in the pak file structure gets overridden by /maps sitting in the game directory. Which works great because you can have the files extracted for working and testing on them, then pak them up for distribution.

Share this post


Link to post
Share on other sites