Jump to content
The Dark Mod Forums

PK4 Overrides And Such


Aprilsister

Recommended Posts

Can anyone give a run-down of the way D3 handles the hierarchical pk4/zip overrides? I know its an alphabetical succession but does that apply to all files regardless of where it finds them in the "path" it takes? Or is each directory processed according to its alphabetical? And where -- how high up the directory structure -- does the processing begin?

 

IOW, for instance, which of these files would be processed and in what order:

 

D:\Games\Doom3\Ima.pk4

D:\Games\Doom3\Excluded Me Why Doncha\Ima.pk4

D:\Games\Doom3\base\Ima.pk4

D:\Games\Doom3\darkmod\Ima.pk4

D:\Games\Doom3\darkmod\A Wonderful Set Of Enhancements\Ima.pk4

D:\Games\Doom3\darkmod\Zis Is Ze Enhancements Folder\Ima.pk4

Link to comment
Share on other sites

The D3 engine searches a set of folders, in a specific order. Each of the folders can contain uncompressed files and PK4 files (uncompressed ones override the ones in the PK4), and the PK4 files are traversed in reverse alphabetic order. There are slight differences between POSIX and Windows systems, as the nix-OSes can have folders in their home paths as well, like ~/.doom3/base. The ones in the home folder override the ones in the engine folder /usr/local/games/doom3/

 

If you have a file called textures/game.tga, the search order is like this, from top priority to lowest priority:

 

~/.doom3//textures/game.tga

~/.doom3//zealot.pk4 => textures/game.tga

~/.doom3//anozelot.pk4 => textures/game.tga

 

/usr/local/games/doom3//textures/game.tga

/usr/local/games/doom3//zealot.pk4 => textures/game.tga

/usr/local/games/doom3//anozelot.pk4 => textures/game.tga

 

~/.doom3//textures/game.tga

~/.doom3//zealot.pk4 => textures/game.tga

~/.doom3//anozelot.pk4 => textures/game.tga

 

/usr/local/games/doom3//textures/game.tga

/usr/local/games/doom3//zealot.pk4 => textures/game.tga

/usr/local/games/doom3//anozelot.pk4 => textures/game.tga

 

~/.doom3/base/textures/game.tga

~/.doom3/base/zealot.pk4 => textures/game.tga

~/.doom3/base/anozelot.pk4 => textures/game.tga

 

/usr/local/games/doom3/base/textures/game.tga

/usr/local/games/doom3/base/zealot.pk4 => textures/game.tga

/usr/local/games/doom3/base/anozelot.pk4 => textures/game.tga

 

All without warranty, I haven't confirmed these by thorough tests myself.

Link to comment
Share on other sites

Only three directories are checked for pk4s and in the following order. Doom3 content first (Doom3\base), then TDM(Doom3\darkmod), then FM (Doom3\darkmod\fms\?). Within each folder content is loaded alphabetically.

 

Of your examples here is how things would play out...

 

D:\Games\Doom3\Ima.pk4 - wrong directory

D:\Games\Doom3\Excluded Me Why Doncha\Ima.pk4 - wrong directory

D:\Games\Doom3\base\Ima. pk4 - Loaded first and overrides nothing since I comes before the P in Pak000.pk4.

D:\Games\Doom3\darkmod\ Ima.pk4 - Loaded after Doom 3 assets but prior to TDM assets and can therefore only override Doom 3 assets since I comes before the T in tdm_ai_animals01.pk4.

D:\Games\Doom3\darkmod\ A Wonderful Set Of Enhancements\Ima.pk4 - wrong directory

D:\Games\Doom3\darkmod\ Zis Is Ze Enhancements Folder\Ima.pk4 - wrong directory

Link to comment
Share on other sites

Each of the folders can contain uncompressed files and PK4 files (uncompressed ones override the ones in the PK4), and the PK4 files are traversed in reverse alphabetic order.

 

To be clear, I think the game processes PK4s in normal alphabetical order, with later files overriding earlier ones. This is of course the same as setting priority order to reverse alphabetical, as you describe here.

 

~/.doom3/<fs_game>/textures/game.tga

~/.doom3/<fs_game>/zealot.pk4 => textures/game.tga

~/.doom3/<fs_game>/anozelot.pk4 => textures/game.tga

 

Conclusion: make sure your overriding PK4 is named something like "zzz.pk4" and it will override everything.

 

Only three directories are checked for pk4s and in the following order. Doom3 content first (Doom3\base), then TDM(Doom3\darkmod), then FM (Doom3\darkmod\fms\?).

 

My understanding is that the darkmod/fms/whatever directory is used to store the original uninstalled FM, which is then copied into a top-level blah/ directory alongside the main darkmod directory when the FM is actually installed. In effect the FM actually becomes a "new" mod, which draws upon the sibling darkmod as its base.

 

Therefore if you want to override something in an FM, I believe you need to put the new files in the top-level sibling FM directory, not inside darkmod/fms/.

Link to comment
Share on other sites

  • 2 weeks later...

Questions:

 

Since the FM extractor seems to open up the PK4 upon installation, can you include override zzz_stuff.pk4's inside your PK4?

 

Would that even allow you to pack your own custom gamex86.dll inside the override PK4 without interfering with TDM's gamex86.dll system-wide?

 

(I suspect "no" to the second one as there would need some "relinquish control' mechanism to revert back after FM uninstall...)

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 2 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 4 replies
×
×
  • Create New...