Gravemind2401 / Reclaimer

A Halo game file explorer
GNU General Public License v3.0
75 stars 15 forks source link

feat: support for halo infinite #70

Closed Surasia closed 1 day ago

Surasia commented 1 month ago
Surasia commented 1 month ago

look into: modules are not being read properly. A proper implementation (seems) to be here, however I cannot get it to work with Reclaimer.

@Connor-jt I'm not sure if you're still interested in Halo stuff, but could you expand on how you read module header and module files? Currently, my implementation looks like this, and I also tried this, which worked, however tags did not get decompressed properly.

I assume it is related to the header alignment, though even after adding that, it does not seem to function.

Connor-jt commented 1 month ago

theres a good chance you might have made a minor mistake in the data you're reading if every tag fails to decompress then i would guess that yeah you aren't aligned correctly with where the tag data actually starts at?

easiest way to figure it out would be running through your code that doesn't work alongside some code that does work. like just opening up the same module in the two different tools and matching up notable offsets like the tag data offset thing.

the tag reading is annoyingly complicated at least, so its almost expected to make a few mistakes when putting together a reader for it

ill get back to you after looking through the code here

Connor-jt commented 1 month ago

this doesn't look right i dont see any other issues though, although i didn't double check your tag structures to make sure they're all correct

um yeah for the tag reading/indexing process itself, i mean its pretty straight forward once you have the right tag structures and something to cast raw bytes into those structures

since reading module files is really as simple as reading the bytes into the

and then i believe the process for reading at least the headers for individual tags was something like

i didn't look through the code for that process though, so its probably a bit more detailed than that, and i cant quite remember it all right now

Surasia commented 1 month ago

@Connor-jt Thanks a lot! The 8 byte padding was indeed the issue. Everything else (including resource indexing!) works now 👍

Surasia commented 1 month ago

Git can be a pain sometimes... now properly pushed the changes.

image image

Surasia commented 1 month ago

Bitmaps can now mostly load. Textures that have bitmap data contained inside of them seem to be a bit tricky.

Also, some files use the HD1 modules from the HD texture pack. These are found as stubs with empty data inside the original module, with a flag to indicate if the additional modules should be used. Currently, I will simply use one less mip to load the proper data- adding the HD1 module support in the future.

Surasia commented 1 month ago

Self-contained bitmaps now fully work.

image

Surasia commented 1 month ago

Added the option to provide a file path to a .txt file that contains file names. It should be formatted like this: (on each line) 00002B36 : fx\library_olympus\objects\characters\marines\_parts\marine_handcuffs_lightning_ring_beam.particle

This isn't ideal because reclaimer uses Little Endian integer global IDs, while the tag path uses a big endian hexadecimal string to indicate global tag ID. In the future, I want to avoid having to parse an entire file (something compressed and built into reclaimer as a resource)

Currently, it simply goes through each line and maps it to a "TagMapping" dictionary with a key of int and value of string, which at least makes it rather fast to load.

Surasia commented 1 month ago

Around 90% of bitmaps now load. The majority that don't load are R32G32B32A32 bitmaps (which I don't plan on adding) and some bc7 sequenced bitmaps.

Surasia commented 1 month ago

oops, accidentally pushed ci stuff to this branch. removed it now

Surasia commented 1 month ago

converted back to draft, got some more things i want to add

Surasia commented 2 weeks ago

@Gravemind2401 I think this is pretty much everything that I think would be best fit for an initial release. I wasn't really able to think of a way to properly implement coatings, so I think I will leave it for now. The biggest issue I have currently with this PR is the string/tag mapper; it does not have any functional issues however it requires a very specific format of a text file that is not documented anywhere, or given an example of. I might remove it for now, but I'd appreciate if you could weigh-in on this.

Gravemind2401 commented 1 week ago

@Gravemind2401 I think this is pretty much everything that I think would be best fit for an initial release. I wasn't really able to think of a way to properly implement coatings, so I think I will leave it for now. The biggest issue I have currently with this PR is the string/tag mapper; it does not have any functional issues however it requires a very specific format of a text file that is not documented anywhere, or given an example of. I might remove it for now, but I'd appreciate if you could weigh-in on this.

I'm not really sure what the best way to handle the strings would be. You could create a dedicated repository for the strings file so at least there's a common place people can get it from and you can push updates to, but in terms of implementation I guess a text file is as good as any.

As for merging, there's still a couple things I want to sort out when I get around to it. Currently the tag hierarchy still uses the four-character class codes which is different to the existing behaviour for earlier games. Since there's no strings I'll have to just generate a tag class list xml like what Halo 1 and 2 are using. I'd also like to implement a proper module interface similar to ICacheFile so that the tag viewer and meta viewer functionality doesn't need to be duplicated.