Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Titanfall VPK support #75

Open
craftablescience opened this issue Jan 29, 2024 · 10 comments
Open

Add Titanfall VPK support #75

craftablescience opened this issue Jan 29, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@craftablescience
Copy link
Owner

Describe Your Suggestion

Not actually sure how feasible this is, but they don't seem too different from regular Source VPKs

@craftablescience craftablescience added the enhancement New feature or request label Jan 29, 2024
@craftablescience craftablescience added this to the 4.X milestone Jan 29, 2024
@craftablescience craftablescience self-assigned this Jan 29, 2024
@Nbc66
Copy link
Contributor

Nbc66 commented Jan 31, 2024

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

@craftablescience
Copy link
Owner Author

Already have that tab open in my browser :p

Thanks for the tip though!

@p0358
Copy link

p0358 commented Feb 4, 2024

There's also this commit I did to add some basic support to ValvePak C# library if you want more inspiration from another language: p0358/ValvePak@bbca238

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...

@craftablescience
Copy link
Owner Author

craftablescience commented Feb 4, 2024

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

@p0358
Copy link

p0358 commented Feb 4, 2024

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.

@Jan200101
Copy link

Here is another program to deal with Respawn VPKs:
https://github.com/harmonytf/HarmonyVPKTool

@craftablescience
Copy link
Owner Author

I've checked it, that program uses TFVPKTool internally

@GeckoEidechse
Copy link

There's also a Go implementation for dealing with VPKs, not sure how useful that is for you though ^^"
https://github.com/pg9182/tf2vpk

@uniboi
Copy link

uniboi commented Feb 4, 2024

r5r has an early apex vpk implementation, should work for titanfall 2 as well https://github.com/Mauler125/r5sdk/tree/p4sync/src/vpklib

@begin-theadventure
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants