Add Titanfall VPK support
Describe Your Suggestion
Not actually sure how feasible this is, but they don't seem too different from regular Source VPKs
There is a titanfall vpk reader software tou can take a look at here
https://github.com/barnabwhy/TFVPKTool
It is write in javascript/typescript
But the basic priciples still apply here and can be looked at to see how they read the file
Already have that tab open in my browser :p
Thanks for the tip though!
There's also this commit I did to add some basic support to ValvePak C# library if you want more inspiration from another language: https://github.com/p0358/ValvePak/commit/bbca23818dc27b1981b7168539c4fa5edab5c98d
Main differences from Source VPK are:
- files stored can be split into parts (but not sure if any actually are, fun)
- index files are split into languages, they can contain different files (Titanfall 1 was split by languages, but thankfully they didn't do same files with different contents, but rather the different languages would just miss the other r1_%language%.txt files)
- compression with LZHAM of some files
- 64-bit integers instead of 32-bit
- embedded audio is absolute hellhole and only the linked TS library above handles it, audio comes as OGG and then the game unpacks it in-place into headerless WAV as install step in Titanfall 1, you need to parse the wav.acache file to reconstruct wav headers to unpack/play audio
With Titanfall 2 and Apex, Respawn stopped embedding audio in VPK (and textures) and they shipped everything in english index files...
audio comes as OGG and then the game unpacks it in-place into headerless WAV
i knew audio was messed up looking at tfvpktool but what the fuck
Yeah audio in that game was one big scam: https://twitter.com/p0358/status/1545216883472977922
Basically they convinced people they get uncompressed aka lossless audio. But no, they just inflate OGG for no reason and you only waste your disk space for a game that could weigh 30 GB with all languages included instead of 60 GB xD
Allegedly they did this to lower the minimum CPU requirements (plus Xbox used hardware accelerated audio compression so they didn't care). Nowadays you can download game files in 5 minutes and then wait few times longer for single-threaded audio inflation job to finish afterwards.
Here is another program to deal with Respawn VPKs: https://github.com/harmonytf/HarmonyVPKTool
I've checked it, that program uses TFVPKTool internally
There's also a Go implementation for dealing with VPKs, not sure how useful that is for you though ^^" https://github.com/pg9182/tf2vpk
r5r has an early apex vpk implementation, should work for titanfall 2 as well https://github.com/Mauler125/r5sdk/tree/p4sync/src/vpklib
https://github.com/taskinoz/RSPNVPK