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

Help with offsets #15

Open
garbo181 opened this issue Sep 19, 2021 · 5 comments
Open

Help with offsets #15

garbo181 opened this issue Sep 19, 2021 · 5 comments

Comments

@garbo181
Copy link

I am trying to use hpk to mod Imperium Civitas (Glory of the Roman Empire). So far it has been easy to unpack the files, however I can't manage to repack them again and make it work.

This is how the "original" Packs/data.hpk prints

file is compressed
header:
data_offset: 0x24
fragments_residual_offset: 0x2A299
fragments_residual_count: 49
fragments_per_file: 1
fragments_filesystem_offset: 0x20374
fragments_filesystem_length: 32824
filesystem entries: 4103

and this is what I get when printing the re-packaged data.hpk

file is compressed
header:
data_offset: 0x24
fragments_residual_offset: 0x0
fragments_residual_count: 0
fragments_per_file: 1
fragments_filesystem_offset: 0x1EE164
fragments_filesystem_length: 32824
filesystem entries: 4103

Is there an option I am missing that might be useful to solve this? I have tried playing with the --chunk-size but only changed the fragments_filesystem_offset

Thanks for everything

Garbo

@nickelc
Copy link
Owner

nickelc commented Sep 19, 2021

however I can't manage to repack them again and make it work.

Do you mean that the game does not run with the repacked file?

The offsets are different for repacked files because the residual data is thrown away. The data is not used and is some leftover from how Haemimont edits the files instead of re-creating the files.

@garbo181
Copy link
Author

garbo181 commented Sep 19, 2021

Do you mean that the game does not run with the repacked file?

The game does not run and also the obtained hpk file size is lower than the original (even if I have not modified anything at all)

The offsets are different for repacked files because the residual data is thrown away. The data is not used and is some leftover from how Haemimont edits the files instead of re-creating the files.

Ok , thanks, so as far as I understand I shouldn't worry about it at all

@nickelc
Copy link
Owner

nickelc commented Sep 20, 2021

I got a version of the game but i have troubles to make it work with WINE under linux but I also noticed that hpk fails to extract Assets.hpk & Sounds.hpk without errors.

@nickelc
Copy link
Owner

nickelc commented Sep 20, 2021

I could also try to put the extracted files in the parent folder. That works for Tropico and Surviving Mars (except the Lua.hpk for SM).
Extract Packs/Data.hpk into Data.

@garbo181
Copy link
Author

I got a version of the game but i have troubles to make it work with WINE under linux but I also noticed that hpk fails to extract Assets.hpk & Sounds.hpk without errors.

I tried to extract again both files with the verbose option and got no errors. I am using W10.

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

No branches or pull requests

2 participants