Frodo45127 / rpfm

Rusted PackFile Manager (RPFM) is a... reimplementation in Rust and Qt5 of PackFile Manager (PFM), one of the best modding tools for Total War Games.
MIT License
370 stars 58 forks source link

spec for .pack files #7

Closed wismer closed 6 years ago

wismer commented 6 years ago

Is there a specification somewhere for the .pack files that I can look at? So as to better understand this program.

I know that loading pack files takes up a lot of memory and was wondering if there's a way to interpret the data in the pack files lazily, like if a section regarding character traits has an identifiable byte range that could be used.

I haven't been able to get the application compiled on my windows machine yet, but I aim to help out soon! Awesome project, by the way - excellent way to learn rust just by the sheer breadth of it.

wismer commented 6 years ago

Also, is there a better way for me to talk to you? Are you on freenode?

Frodo45127 commented 6 years ago

For a spec, there is this one, but it only applies to Arena PackFiles: https://github.com/TotalWarArena-Modding/docs/blob/master/PACK_FILE_FORMAT.md

I was supposed to help expanding it.... but I have not as much free time as I wanted to have. Other than that, not so long ago I updated the comments related to PackFile stuff, so you have those too, in /src/packfile/packfile.rs.

About lazy loading PackFiles, it can be done (it's already done for PackFiles loaded using the Add from PackFile feature) but it's not done due to TWeaK's behavior. Basically, TWeaK sometimes locks the PackFiles and, if you try to edit them, for some bizarre reason the PackFile is deleted. And that behavior is extremely common in Warhammer 2 (TWeaK doesn't close most of the times you try to close it). I, and many others have lost not only changes, but entire PackFiles due to that problem, so as a "solution" I made RPFM to load the entire PackFile to memory. It's not optimal, but if TWeaK deletes your PackFile, you can still save it in another place.

That doesn't mean it can't be implemented, but the old behavior is needed for editing mods in the data folder, so.... checking the path and the type of the PackFile should be enough. Also, when I say it's implemented, I mean read-only support. And in not the best way.

If you have any problem compiling, just say it. It took me 2 days to get it compiling in windows due to how confusing installing GTK can be in windows (and a couple of bugs in MinGW).

And freenode.... I've never used it. If you don't mind to explain how to use it (never used any irc)... Other than that, I'm usually available on steam (same nick as here) and discord (Frodo45127#9810).

wismer commented 6 years ago

awesome, thanks for the info! regarding the the issues I'm having with compilation, I think they have to do with which rust setup is active, or "target" - I've never had to deal with this stuff before (never tried Rust on windows). It mostly builds until it reaches the winres dependency - saying it has no binaries. I'll figure it out at some point.

I sent you a friend request on discord, too