GithubHelp home page GithubHelp logo

project-cartographer / h2pc_tagextraction Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 7.0 103.06 MB

A application made to extract assets from cache files of H2v using BlamLib by KornnerStudios.

C# 89.35% MAXScript 0.52% HLSL 0.12% Lua 3.49% Batchfile 0.01% C++ 3.80% C 2.73%
halo2 tag extraction meta handling extractor h2pc blamlib

h2pc_tagextraction's People

Contributors

deadhamster35 avatar general-101 avatar himanshu-01 avatar num0005 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

h2pc_tagextraction's Issues

Undo processing on sbsp.

Copied from #10

  • Crash on load due to improper handling of 3D BSP node. Fixed by 0c528e3

  • Environment objects needs the references readded. Environment pallet seems to be emptied out and environment objects has a copy made in scnr. Not sure if there is any logic that can get back whatever the original was. Maybe compare unique ID and tag type to find the original?

Undo processing on scenario.

Copied from #10

  • Just barely working. Crash on load if the resource and AI resource tag block isn't deleted from the scenario resource tag block. solved by 5781246

  • Decorators tag block needs to be moved back from sbsp and repaired if needed.

  • Seems to have issues with tag references being fine in Guerilla but being empty in Sapien. This is related to the environment objects tag block in sbsp. tag block will overwrite whatever exists in scnr.

Extracting from shared maps has issues

Shared maps don't place extracted tags in the proper folder path and aren't properly named. Pretty sure this started in a21d3cc Can't really just undo this because it means shared refs won't work when we need them for bitmap data and such. Need to find a solution later.

Workaround for now involves making a copy of the shared map and extracting from that instead.

Physics model crashes on load

Copied from #10

  • Crashes on load. Appears to be because the tag extractor isn't undoing the post processing H2Tool does on package. Add the number of mass distribution tag block equivalent to the amount of objects in the physics_model tag. The mass distribution tag block gets created when the file is initially created from source JMS files and is merged with rigid bodies tag block on package.

  • Something is wrong with physics models that isn't post processing. See crate_space_a. crate_space_b, detail_keyplug, and fuselage_arm in 06a_sentinelwalls.map. I'll look into this more when I can.

Automatically remake shader tags.

Copied from #10

Due to post processing H2Tool does on package, the tag does not function for it's intended purpose. Must be remade from scratch. Data within can be used to remake the shader properly. Data changes completely from what H2Sapien expects.

Undo processing on biped

Copied from #10

  • Mostly comes out without issue. Acceleration values have some math done on them on package and the tag extractor does not undo this. Use "X^(-1)" to undo. X is the extracted value. Solution provided by 07bc53a

  • Dead sphere shapes, pill shapes, sphere shapes tag block should be empty as these don't exist until the tags are packaged.

Sound tag not reconstructed.

Copied from #10

cache_file_sound is what is given instead of the .sound tag. Code to reconstruct the sound tag might be incomplete.

Undo processing on scenario_structure_lightmap/ltmp.

Copied from #10

Same issue with render_models (see #15) where everything after section will not be written. Unlike render_models this does not have anything to do with resource maps. My theory is that the geometry classification is causing it to store the mesh data in a different way from render_models. I have no proof for this though.

Undo processing on model_animation_graph/jmad

Copied from #10

Comes out without issue unless it references something to inherit animations from it. This must be undone as the blocks that were added from this will remain and will reference invalid animation indexes. Can cause crashing during packaging or during map loading. All that you have to do is delete any animations blocks that do not have a -1 value as a graph index as that means it is referencing the data from a different source.

Undo processing on model

Copied from #10

  • Can be used without issue.

  • The nodes tag block and the flag "has runtime nodes" needs to be undone as these don't exist until they are packaged.

Undo processing on bitmap

Copied from #10

  • Appears to be missing bitmap data a majority of the time among other things. Seems to be an issue with the extractor not loading the resource maps. Fixed by 0600328

  • Has issues beyond this where even if the bitmap data is internal then it may not be written for whatever reason.

  • Something is preventing them from being compressed in H2Tool. This means that extracted bitmaps can't be reused until the cause is found and fixed. Worked around by Project-Cartographer/H2Codez@f4adbbc

Issues with tag count

When selecting a tag type all the tags under that tag and the tag type itself count towards the total number of tags. So if there is 10 weapons and you select weap then the count will be 11.

Tag count isn't cleared on map close.

If the tag type tree isn't open then it will only add 1 to the tag count.

Haven't really caused problems yet and they aren't big issues but should prob do something about this.

Tag Extraction Issue List

I will be listing issues with tag groups here and possible causes and solutions if known.

physics_model/phmo

  • Crashes on load. Appears to be because the tag extractor isn't undoing the post processing H2Tool does on package. Add the number of mass distribution tag block equivalent to the amount of objects in the physics_model tag. The mass distribution tag block gets created when the file is initially created from source JMS files and is merged with rigid bodies tag block on package. Worked around by 628b95a Will need a proper fix at some point as Havok active physics objects won't work without proper mass distribution values. Current best solution would be to read the dumped tag and dump that to a JMS file to be reimported. https://pastebin.com/h6WUDFDZ

  • Block index in physics models that make use of the phantom tag block are set to unused. This has to be undone.

  • Objects with repaired Phantom meshes can cause death. Looking into this when I can. Seems to be related to Havok

collision_model/coll

  • Crashes on load. Appears to be because the tag extractor isn't properly handling the 3D BSP node tag block. Solution provided by 0c528e3

render_model/mode

  • Mesh itself is fine but weights and/or node indexes in the parts tag block aren't filled in properly. This means rigged models have to be remade since their weights are missing.

  • Some models can be missing everything after the section tag block entirely such as the grunt which means they are just an empty render_model file with no mesh data. Seems to be fixed by 0600328

  • If the render_model has PRT_info then this needs to be cleared as it will cause a crash on load. The crash in H2Sapien is because the render_model is missing the PRT specific shaders but I have no idea what state it would be after this. Seems fixed by 26f718a

  • Render models made with the DAE converter don't seem to get their raw vertices tag block written. This is because the DAEConverter doesn't fill in the section info block.

sound/!snd

  • cache_file_sound is what is given instead of the .sound tag. Code to reconstruct the sound tag might be incomplete.

shader/shad

  • Due to post processing H2Tool does on package, the tag does not function for it's intended purpose. Must be remade from scratch. Data within can be used to remake the shader properly. Data changes completely from what H2Sapien expects. Workaround provided by e4e36f3

  • Some quick notes on shaders. https://pastebin.com/FmqmP6F9

model/hlmt

  • Can be used without issue.

  • The nodes tag block needs to be undone as these don't exist until they are packaged. Fixed by a292b2a

  • The flag "has runtime nodes" needs to be undone as these don't exist until they are packaged. Fixed by fcfe0c6

biped/bipd

  • Mostly comes out without issue. Acceleration values have some math done on them on package and the tag extractor does not undo this. Use "X^(-1)" to undo. X is the extracted value. Solution provided by 07bc53a

  • Dead sphere shapes, pill shapes, sphere shapes tag block should be empty as these don't exist until the tags are packaged. Fixed by a292b2a

scenario/scnr

  • Just barely working. Crash on load if the resource and AI resource tag block isn't deleted from the scenario resource tag block. solved by 5781246

  • Decorators tag block needs to be moved back from sbsp and repaired if needed.

  • Seems to have issues with tag references being fine in Guerilla but being empty in Sapien. This is related to the environment objects tag block in sbsp. tag block will overwrite whatever exists in scnr.

  • Scenario cluster data tag block needs its sbsp reference readded. Just add it back in the same order as structure bsp

  • Structure BSP lighting tag block needs it's sbsp reference readded. Just add it back in the same order as structure bsp

scenario_structure_bsp/sbsp

  • Crash on load due to improper handling of 3D BSP node. Fixed by 0c528e3

  • Environment objects needs the references readded. Environment pallet seems to be emptied out and environment objects has a copy made in scnr. Not sure if there is any logic that can get back whatever the original was. Maybe compare unique ID and tag type to find the original?

  • Predicted resource tag block needs to be cleared. Fixed by a292b2a

model_animation_graph/jmad

  • Comes out without issue unless it references something to inherit animations from it. This must be undone as the blocks that were added from this will remain and will reference invalid animation indexes. Can cause crashing during packaging or during map loading. All that you have to do is delete any animations blocks that do not have a -1 value as a graph index as that means it is referencing the data from a different source. Fixed by 309cf84

device_machine/mach

  • Comes out mostly without issue. Values in power transition time, power acceleration time, position transition time, position acceleration time, depowered position transition, and depowered position acceleration are changed on package. Use "X^(-1)" to undo. X is the extracted value. Fixed by 101f081

bitmap/bitm

  • Appears to be missing bitmap data a majority of the time among other things. Seems to be an issue with the extractor not loading the resource maps. Fixed by 0600328

  • Has issues beyond this where even if the bitmap data is internal then it may not be written for whatever reason. Not happening as of commit 0600328 so it was probably resource map related to and I just guessed wrong.

  • Something is preventing them from being compressed in H2Tool. This means that extracted bitmaps can't be reused until the cause is found and fixed. Worked around by Project-Cartographer/H2Codez@f4adbbc

scenario_structure_lightmap/ltmp

  • The actual reason seems to be that the lightmap mesh is merged with sbsp on package. This needs to be confirmed but surface level examining of the ltmp tag in Assembly seems to point to the mesh being gone. Unless another solution comes around the best chance we have of reusing the lightmap tag is to rebuild it using the bsp tag. Workaround provided by Project-Cartographer/H2Codez@419c886

light_volume/MG32

  • light_volume_runtime_offset_block needs to be cleared. Fixed by a292b2a

vehicle/vehi

  • vehicle_phantom_shape_block needs to be cleared. Fixed by a292b2a

vehicle/vehi

  • vehicle_phantom_shape_block needs to be cleared. Fixed by a292b2a

particle/PRT3

  • What the title says. Will look into why H2Guerilla won't open them at times. Typically when the particle tag is 3kb in size is a trend I've noticed. Appears to be some issue with block size in the particle function area. I believe the issue is that some functions are different sizes and Blamlib isn't handling this correctly.

  • Also should look into clearing the processed particle data from the file. It seems it's still there in hex and Guerrilla does get rid of it when the file is saved but might as well take care of it here and now.

decorator_set/DECR

  • Resources tag block needs to be cleared. Fixed by ec8296c

Render model not extracted correctly.

Copied from #10

  • Mesh itself is fine but weights and/or node indexes in the parts tag block aren't filled in properly. This means rigged models have to be remade since their weights are missing.

  • Some models can be missing everything after the section tag block entirely such as the grunt which means they are just an empty render_model file with no mesh data. Seems to be fixed by 0600328

  • If the render_model has PRT_info then this needs to be cleared as it will cause a crash on load. The crash in H2Sapien is because the render_model is missing the PRT specific shaders but I have no idea what state it would be after this. Crash was actually caused by post processing on the mesh. Fixed by 26f718a

  • Render models made with the DAE converter don't seem to get their raw vertices tag block written.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.