Jump to content

[Tutorial] How to erase mesh parts, define material ID/LOD, change mesh address reference


UberGrainy

Recommended Posts

Edit: Updated LOD byte info.

 

Copy pasting this from my swimsuit mod description, just in case people didn't see it there.

 

This requires some hex editing knowledge, and a hex editor.

 

In mod3 files, after the material names, it refers to each part of the model. 80 bytes for each entry. If you replace those 80 bytes with 00s, it can't find the model, so it becomes hidden. You can also hide it by setting LOD to 00.

 

I previously said 6th byte was material ID. I don't know why I wrote that. Anyway, I rewrote the explanation.

 

Sample entry:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

13 00 AE 0B 00 00 00 00 01 00 00 00 21 00 24 43

00 00 00 00 00 00 00 00 1C 40 37 F6 00 00 00 00

4C 3E 00 00 00 00 00 00 00 24 01 00 00 00 AD 0B

FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00

 

Notable bytes:

QQ QQ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <- there are sometimes bytes at the end here, I don't know what they're for

13 00 PP PP 00 00 MM 00 LL LL 00 00 21 00 24 43

00 00 00 00 00 00 00 00 1C 40 37 F6 XX XX XX XX

YY YY YY YY 00 00 00 00 00 24 01 00 00 00 AD 0B <- don't know what these bytes on the end here are for

FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 <- there are sometimes bytes at the end here, I don't know what they're for

 

I do not know what QQ QQ and PP PP are, but QQ QQ always seems to match the previous entry's PP PP, except in the case of the first entry.

I have yet to figure out what the other bytes do, but fiddling with them tends to cause crashes.

 

MM is the material ID. It uses the order of the materials listed earlier in the file. Change the value and you'll see the texture will change.

 

LL defines LOD. 00 00 = invisible. 01 00 = char creation, equip box. 02 00 = in-game regular distance. Other values include 04 00, 08 00, 10 00, E0 FF, FC FF. I haven't tested what all of those are. One of the values defines the shadow.

To get infinite LOD, I just set these two bytes to FF FF. Shadow seems to be calculated when using FF FF.

 

XX XX XX XX is starting location of the mesh to look for. For example, if XX XX XX XX is 43 21 00 00, then the address is 00001234.

Initial address always seems to be 00 00 00 00, so I'm assuming mesh data always starts after a certain place (ie. after this material index?)

 

YY YY YY YY seems to be the size of the mesh. In the above example, it's 4C 3E 00 00, which means 00003E4C. Reducing this value removes triangles.

 

To get the starting address of the next mesh, you take XX XX XX XX and add YY YY YY YY.

In the above sample, 00000000 + 00003E4C means the next mesh will start at 00003E4C.

 

When you want to test the results, just hang out at the equipment box and switch equipment on and off.

To test LOD, set LOD to low, and camera distance set to far, then go to training mode and swing on the Wedge Beetle.

Don't forget to check the shadows to see if the shadow LOD is also working properly.

 

While looking up MRL format info, I found past MOD format specifications:

http://residentevilmodding.boards.net/thread/6320/capcoms-mtframework-mod-format-research

http://z13.invisionfree.com/Translation_Forum/ar/t26.htm

 

About customizable skin color:

I may be wrong, but this is my current theory/understanding.

1. CMM defines what parts of a texture are customizable. Usually red or green. This is usually for equipment.

2. Skin texture usually refers to a default skin texture. In the case of NPC clothing, sometimes the skin is drawn onto the clothes texture.

3. But even in the case of NPC textures having both clothing and skin, the skin is assigned its own material.

4. The game decides which color is customizable on a piece of equipment. I suspect this is defined in common/equip_scolor.esvc

5. In the model mrl3, skin materials may have some kind of shader switch that tells the game they are a Player or NPC skin material.

 

The game may be looking for both a specific material header name, and the shader switch.

NPC skin shader has entries in the 100mb shader files. But player skin shader does not seem to.

Until mrl3 structure is understood, I don't think I can resolve the skin issue.

 

I can't easily test mrl3, because the material/shader data varies in size, so I can't just copy paste stuff over, and the structure is kinda vague.

As far as I know, nobody has figured out the mrl3 structure yet.

Edited by UberGrainy
Link to comment
Share on other sites

I'm entirely new to modding so I'm not sure if I'm understanding this correctly, but would it be possible to use this process to remove just part of a piece of armor? I'm kind of going insane because I love the Damascus Beta set but the knife and pouch on the back of the waist piece constantly clip through the back of my Greatsword. Would I be able to remove the knife and pouch mesh using a hex editor?

Link to comment
Share on other sites

Hey there UberGrainy, I've been looking over mod3 files for a few hours now but haven't quite been able to follow your instructions above as I don't seem to be able to identify the material ids, is there some specific step I'm missing or some specific tool you're using to read the file?

Link to comment
Share on other sites

Hey there UberGrainy, I've been looking over mod3 files for a few hours now but haven't quite been able to follow your instructions above as I don't seem to be able to identify the material ids, is there some specific step I'm missing or some specific tool you're using to read the file?

Try HxD, I've had a lot of success with that.

Link to comment
Share on other sites

 

Hey there UberGrainy, I've been looking over mod3 files for a few hours now but haven't quite been able to follow your instructions above as I don't seem to be able to identify the material ids, is there some specific step I'm missing or some specific tool you're using to read the file?

Try HxD, I've had a lot of success with that.

 

 

I appreciate the help, but my issue was "not being able to identify the correct offsets in order to crop the models", not "being unable to work with hex files". Unless there's some special functionality in HxD that I'm not seeing?

 

The clarify my usecase, I'm trying to edit npc015.mod3 (meowscular chef's model) to be able to port them over as cat/hunter armor (similarly to what's been done in https://www.nexusmods.com/monsterhunterworld/mods/11 by UberGrainy themselves)

Edited by mabit
Link to comment
Share on other sites

Sorry for the late reply, didn't notice. Earlier in the file you'll see some material names. The ID is in order starting from 00. So if the first material name is ch_skin_00 or something, then that's material ID 00. If the second one is shadow_something then that's ID 01.

 

By the way, a correction. The YYYYYYYY part doesn't seem to match the actual vertex data. There's another index before the vertex data, not sure what it is.

Edited by UberGrainy
Link to comment
Share on other sites

  • 2 weeks later...

Hello. I've been trying to follow your tutorial on erasing meshes to get rid of that cursed cape on the male Legiana B armor, but I've been staring at this mod3 file in HxD for a few hours now... and have absolutely no idea what references the model and material names. I've tried using the example picture you posted on the mod as reference, but still can't click it.

 

I'm not exactly a sharp knife, so is there a specific method to which you use for identifying the different sections of material name/id/model?

Link to comment
Share on other sites

An easier way would be to try making the cape part of the texture transparent.

 

I did try that, but the cape just turns black instead of going invisible. I'm sure I didn't make an error retexturing, since it works on other armors.

 

Ex: https://imgur.com/a/yzIuFZO

 

There's a thread I put up with (mildly) more detail here: https://forums.nexusmods.com/index.php?/topic/6996031-question-about-retextures/

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...