craftablescience/VPKEdit

VPKv1 not outputting L4D1 format VPK files

Closed this issue · 4 comments

Describe the Bug

When testing VPK addon support for Postal 3, I was running into an issue where VPK files were not properly loading which was leading to crashes. After much trial and error I found that the VPK files output by VPKedit weren't compatible and seem to be differently formatted in some way from Left 4 Dead 1's VPKs which do work in Postal 3.

To Reproduce

I have uploaded the test addon this was happening with here: https://drive.google.com/file/d/11UgiOSda7Ju8Fzghp1sT5YqVFbM9zQIe/view?usp=sharing

The VPK marked "L4D1" was made with L4D1's VPK.exe and works
The VPK marked as "L4D2" was made with L4D2's VPK.exe and does not work
The VPKs marked as "v1" and "v2" were made with VPKedit and also do not work
The folder "MIKL_masterpieceVPK" is the source folder that was used to create the VPKs

To test these in Postal 3, place the VPK in one of Postal 3's search paths (such as the "p3" folder) and rename it to "pak01_dir.vpk"
Postal 3 will try to load any VPK in a search path thats named pak01_dir similar to Left 4 Dead 1
Then once loaded into the game, trying to load one of the maps in the addon such as "old_catharsis" will crash due to an issue with Postal 3 where the game can't load if there are too many missing models and textures.

VPKEdit Version

4.3.1

Operating System

Windows 10

Thanks for providing such a detailed issue, I'll look into this later today. I unfortunately own Postal 3 so it hopefully shouldn't be too difficult to figure out.

Actually, this doesn't look like a bug with VPKEdit, this looks like a bug with the L4D1 VPK creator and/or Postal 3. If you open both VPKs and compare their contents, you'll notice that all the .dx80.vtx and .dx90.vtx model files are stripped when creating the VPK with L4D1's vpk tool, but L4D2 includes those files. Those files being included in the VPK are probably why Postal 3 is crashing. I see no other difference between the two VPKs.

Actually, this doesn't look like a bug with VPKEdit, this looks like a bug with the L4D1 VPK creator and/or Postal 3. If you open both VPKs and compare their contents, you'll notice that all the .dx80.vtx and .dx90.vtx model files are stripped when creating the VPK with L4D1's vpk tool, but L4D2 includes those files. Those files being included in the VPK are probably why Postal 3 is crashing. I see no other difference between the two VPKs.

Thanks for this! After you said this I did some experimenting and it seems what L4D1's VPK creator does is it renames the .sw.vtx model files to have just .vtx extensions. It also has an odd behavior where it doesn't seem to actually remove the .dx80.vtx and .dx90.vtx files and instead just doesn't add them to the directory. Removing them completely from the folder used to create the VPK outputs a VPK thats approximately 9 MBs smaller than if they're left in there. According to the Valve Dev Wiki, the L4D games originally only used .vtx and were later updated to use .dx90.vtx so I'm assuming its related to that. Thanks for the help and I'll be sure to make note of this for other P3 modders!

Sure thing