Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Feature Request: Export any supported blender file loaded in Noesis file as a G1M file (reverse process) #27

Open
Jupisoft111 opened this issue Jan 19, 2023 · 2 comments

Comments

@Jupisoft111
Copy link

Hello, my name is Júpter, and right now I can't think of anyone else on this planet capable of fullfilling a request like this.

My problem is that I want to edit the meshes for several models of the Fatal Frame 5 game to add new clothing, and until now I've used a tool by vagonumero13 called "g1m_exporter.exe", to export to IB/VB, then with an add-on modify it on blender and then import it back with another tool called "g1m_importer.exe" from the same author.

But I've found that this tool can't work with GMPK files that contain more than one G1M file. And even after writing messages to the author and waiting for more than a year I ahd no answer yet... So I can't mod any of the meshes in any way that I know of. I know C#, but I'm very lost when reading your awesome code in C++ (or any C++ actually).

So basically you're my only hope for properly modding Fatal Frame 5. I only need that your tool could also import back into an original G1M file by first loading the original G1M, exporting it with Noesis to a blender compatible format, and after editing all the desired meshes, import that edited file with Noesis once again, and then thanks to your plugin once more export it this time as a valid G1M file.

I just need you to reverse your process somehow and first load a Noesis native format and convert it back to a G1M format. I'm not sure how complicated that would be, or if it's at all possible right now, but as I mentioned you're my only hope right now. Thanks a lot in any case and have a wonderful day :-)

@Joschuka
Copy link
Owner

Hello,
First of all thank you for the kind words, I'm happy that you enjoy the plugin.
Importing back to the original format is always a challenge : contrary to exporting where I can ignore the fields I'm not really sure about as long as I get enough information to display the asset, reconstructing the G1M would require understanding every single byte (or at least enough not to make the game crash). While most of the sections are completely figured out, these annoying NUNO ones (among others) still have a lot of unknowns.
Another problem is the versionning. This G1M format has been used by dozens of games since around 2010 and developpers are still updating it and adding new features. Importing back would need to account for these different versions subtleties, making it quite a tedious work (unless you decide to only make it work for a single game).
Yet another issue would be the shaders. As you may have noticed, the g1m have references to shaders, which are game specific.
Also, while I managed to reverse the vertex shader and reconstruct the physics meshes for exporting, I'm still not sure about how they bake these in the first place with their inhouse tools, as the transforms are not bijective for the most part.

So could such an exporter be done ? Most likely, with some time, a lot of testing/reinjecting and more research about the unknown fields left. However I'm afraid that I personally currently cannot afford the time to contribute to such an effort, especially since I don't have a game using G1M I am personally interested in modding myself right now.

If you are really determined, I would suggest to check out the G1M binary template that I maintain here, which has my latest findings about the format https://github.com/three-houses-research-team/010-binary-templates/tree/master/Model%20related%20formats
You can then use it to display all the fields conveniently with the 010 editor and it will help you understand the format much more easily than you'd be able to by just reading my code. After that it will be a matter of trying to reconstruct these different sections one by one and make sure that all the fields are set up accordingly.

Hopefully that helps, again sorry that I cannot help much more but I currently cannot afford the time to get involved in such a demanding effort. However I'll be able to answer questions about the format if you have any. Best of luck !

@Jupisoft111
Copy link
Author

Hello again and thanks a lot for your detailed explanation. Despite searching for it on GitHub and other places I couldn't find the links you have pointed me to, so I'm really grateful for that. I'm not sure if I'll manage to succeed, even for a single game, but I'll do my best to achieve that.

Of course I'll keep you updated in case I ever manage to make any progress within the unknown values to complete the missing knowledge about the G1M format. And I didn't know about the shaders within the G1M file, so that's great to know.

The thing I did notice (if I'm not wrong at interpreting it), is that some of the G1M files seem to have 4th dimensional meshes for some body parts, like if they contained some sort of animation for that part, but sadly I couldn't get very far yet.

To start, I'll port to C# all the templates and then start making lots of tries with several G1M files (while expecting lots of crashes), until hopefully I'll be able to understand a bit more the format like you already did.

Thanks a lot for all your help and massive contribution to the understanding of the G1M format. Have a wonderful day :-)

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

No branches or pull requests

2 participants