Talk:VPK (file format)

From Valve Developer Community
Jump to navigation Jump to search
Icon-message-48px.png
This is the discussion page of VPK (file format). To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

I think the bit ShaRose added about skipping refers to the same thing as the following sentence:

Each tree node begins with a null terminated ASCII string and empty strings are used to signify the end of a parent node.

Perhaps I should have been clear the leaf nodes were exempt from this; nonetheless, the pseudo-code covers it. --Nem (talk) 06:44, 5 Aug 2009

Does anybody know whether the format is Big Endian or Little Endian? Seems to be an important piece of info that has been overlooked. --Pharap (talk) 23:42, 10 Aug 2013

Assumptions

I've been doing some reverse engineering/code research and a few assumptions made in this article are incorrect:

  • The ArchiveIndex, EntryOffset, and EntryLength fields of VPKDirectoryEntry can be repeated if a file has fragmented contents. This explains why there is a terminator at the end of the entry header.
  • In CPackedStoreFileHandle (Alien Swarm SDK) the data referred to by the article as "Preload" is referred to as "Metadata" instead. The actual file data and the metadata are never mixed, so the comment about vmt files being stored entirely in the directory is incorrect. --BenLubar (talk) 20:05, 6 Aug 2022
  • About being able to have multiple ArchiveIndex, EntryOffset and EntryLength, both the game and hammer doesn't seem to like it. They don't crash, but they only read the first entry of each field. I tested a VMT, with no SmallData, so I could see how far the game or the editor would read the file. I created a WorldVertexTransition with a basetexture set in the first entry of ArchiveIndex, Offset and Length, and a basetexture2 in the second entry. Both the game and the editor only read up to basetexture, which means it didn't read the second part. To make sure it wasn't just a behavior of VMTs, I tested this with a VTF, splitting it into two, and I got black and purple checkers. This was tested in SDK2013SP in Feb 2025, perhaps it has a different behavior in newer branches. --XBLAH (talk) 11:03, 23 Feb 2025