Jump to content

Photo

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


12 replies to this topic

#1
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,484 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://residentevilm...format-research
http://z13.invisionf...orum/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, 28 September 2018 - 12:49 AM.


#2
RunnyGnome

RunnyGnome

    Stranger

  • Members
  • Pip
  • 7 posts

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?



#3
mabit

mabit

    Regular

  • Members
  • PipPip
  • 57 posts

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?



#4
Thray

Thray

    Journeyman

  • Supporter
  • Pip
  • 40 posts

I goofed and don't know how to delete


Edited by Thray, 28 August 2018 - 11:55 PM.


#5
Thray

Thray

    Journeyman

  • Supporter
  • Pip
  • 40 posts

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.



#6
mabit

mabit

    Regular

  • Members
  • PipPip
  • 57 posts

 

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.nexusmod...erworld/mods/11 by UberGrainy themselves)


Edited by mabit, 29 August 2018 - 03:21 AM.


#7
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,484 posts
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, 04 September 2018 - 07:53 PM.


#8
iamspartan

iamspartan

    Newbie

  • Members
  • Pip
  • 11 posts

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?



#9
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,484 posts

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



#10
iamspartan

iamspartan

    Newbie

  • Members
  • Pip
  • 11 posts

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.nexus...out-retextures/





Reply to this topic



  


Page loaded in: 0.980 seconds