Jump to content
etsorhtt

Nioh 2 - Modding Thread and Discussion -

Recommended Posts

BASIC MODDING

Quick TLDR/Refreshers:

Spoiler

! FOR THE LOVE OF GOD DO NOT EDIT D3DX.INI !

Everything can be done directly from individual mods, if some specific feature/command you need missing ask and I can make commandlist that you will be able to call from your mod!

You can create temporary .ini inside the Mods folder for your needs and dispose of it once you done

Since motion blur option in graphics settings alters some pixel/vertex shaders between On/Off states, make sure to find and add checks for shaders for both of those options
-------------------------------------------------------------------

Adding shader check:

[ShaderOverride*CUSTOMNAME*]

hash = *SHADERHASH*

run = CommandListN2General

-------------------------------------------------------------------

Adding shader to Frame Analysis (dump) list:

[ShaderOverride*CUSTOMNAME*]

hash = *SHADERHASH*
run = CommandListN2Dump

-------------------------------------------------------------------

Skipping vertex/index buffer:
;Find and add shader check related to the buffer first, won't work without it

[TextureOverride*CUSTOMNAME*]

hash = *BUFFERHASH*

handling = skip

-------------------------------------------------------------------

Replacing textures:

[TextureOverride*CUSTOMNAME*]

hash = *TEXTUREHASH*

ps-t*?* = Resource*CUSTOMNAME*     <- These should have same name because one references the other
 

[Resource*CUSTOMNAME*]                  <- These should have same name because one references the other

filename = *FILENAME*


;Note: Instead of specifying texture type above, ps-t*?*(ps-t0, ps-t1, ps-t2, ps-t3) you can try using this command to make 3DMigoto sort it out
;automatically. In certain rare cases it can fix issues, or cause them instead. Example:

 

[TextureOverride*CUSTOMNAME*]

hash = *TEXTUREHASH*

this = Resource*CUSTOMNAME*          <- These should have same name because one references the other


[Resource*CUSTOMNAME*]                  <- These should have same name because one references the other

filename = *FILENAME*


-------------------------------------------------------------------

Blender Plugin

Replacing meshes:

[TextureOverride*CUSTOMNAME*]

hash = *BUFFERHASH*

handling = skip

match_first_index = *MESHINDEX*

vb0 = Resource*CUSTOMNAMEVB*

ib = Resource*CUSTOMNAMEIB*

drawindexed = auto

 

[Resource*CUSTOMNAMEVB*]

type = Buffer

stride = *STRIDE*

filename = *FILENAMEVB*

 

[Resource*CUSTOMNAMEIB*]

type = Buffer

format = *FORMAT*

filename = *FILENAMEIB*

-------------------------------------------------------------------


How to remove models/effects:

Spoiler

1comp.png

1. Decide what you want to remove

-------------------------------------------------------------------

2. Enter hunting mode:

Enter hunting mode ( NUMPAD 0 )

Hunting mode controls:
( NUMPAD 0 ) - Hunting mode On/Off
( NUMPAD + ) - Reset current shader/buffer selection
( NUMPAD / ), ( NUMPAD * ) - Cycle through vertex buffers, ( NUMPAD - ) - copy selected vertex buffer hash to clipboard
( NUMPAD 7 ), ( NUMPAD 8 ) - Cycle through index buffers, ( NUMPAD 9 ) - copy selected index buffer hash to clipboard
( NUMPAD 4 ), ( NUMPAD 5 ) - Cycle through vertex shaders, ( NUMPAD 6 ) - copy selected vertex shader hash to clipboard
( NUMPAD 1 ), ( NUMPAD 2 ) - Cycle through pixel shaders, ( NUMPAD 3 ) - copy selected pixel shader hash to clipboard
( F8 ) - Perform frame analysis
( Ctrl+F8 ) - Switch frame analysis profile: Listed shaders/UI/Log file only

hunting_comp.png

Think about vertex/index buffers as individual models/effects, they depend on vertex/pixel shaders which are collections of those models/effects
That's why we first have to find pixel or vertex shader tied to something we want to remove before going through the buffers

2comp.png

3. Find correct vertex/pixel shader:

Finding pixel shader is enough most of the time, unless there's some issues finding vertex shader is not necessary
Cycle through pixel shaders ( NUMPAD 1 ), ( NUMPAD 2 ) until model or effect disappears from screen, just like tonfas in my example
(along with armor but that's fine, that just means they both depend on that shader)

-------------------------------------------------------------------

4. Copy the hash and add shader check:

Copy its hash ( NUMPAD 3 ) and create text .ini file for the mod in Mods folder (or feel free to create subfolder within it and place .ini there), riptonfas.ini in my example. Open mod .ini you just created and add check for pixel shader you copied:


[ShaderOverride*CUSTOMNAME*]

hash = *SHADERHASH*

run = CommandListN2General

for example:
 

[ShaderOverrideRIPTonfas]

hash = 91ea5a0a0fc326fa

run = CommandListN2General

Now any changes that you make to buffers related to this shader will be able to take effect. Save the file, Refresh ( F10 ) in game and ( NUMPAD + ) in hunting mode to reset your previous selections

Why this is done? Is this step necessary?
Performance! Manually adding checks for shaders that we need for our mods significantly reduces overhead
It is possible to make 3DMigoto check for every shader present but that induces decent performance loss
I'm considering adding key shortcut for this in next version for test purposes

3comp.png

5. Find and copy vertex/index buffer:

From my experience with Nioh 2 so far, vertex buffers are more reliable and have less chances of multiple in-game objects sharing the same hash, so focus on them first:
Cycle trough vertex buffers ( NUMPAD / ), ( NUMPAD * ) until model or effect disappears from screen, just like tonfas in my example
(This time only tonfas! What was that about buffers being invidual objects and shaders being collections of them again..?)

-------------------------------------------------------------------

6. Skip and repeat for all parts if necessary:

Copy its hash ( NUMPAD - ) and back to the mod .ini. Now you can tell 3dmigoto to skip drawing the model/effect:


[TextureOverride*CUSTOMNAME*]

hash = *BUFFERHASH*

handling = skip

for example:
 

[TextureOverrideTonfas-Body]

hash = 588922d0

handling = skip

Save, refresh, reset, the usual. If all good, you can exit hunting mode.
Sometimes what you want to remove consist of multiple parts that also use different pixel/vertex shader or/and vertex/index buffer so might need to repeat entire process for additional hashes

Tonfas gone! Oh wait, there's still handles visible! Back to step 5 and 6 to repeat the process of finding vertex or index buffer for handles now.

-------------------------------------------------------------------

In my example end result looks like this:

; For this example I used Lord Tonfas
; Here I add check for pixel shader to allow buffer editing

[ShaderOverrideRIPTonfas]

hash = 91ea5a0a0fc326fa

run = CommandListN2General
; Here I add skip to tonfas

[TextureOverrideTonfas-Body]

hash = 588922d0

handling = skip

; Here I found and added vertex buffer to skip the handles

[TextureOverrideTonfas-Handles]

hash = 6d3f7f45

handling = skip

4comp.png

7. (OPTIONAL) Perform frame analysis:

What if you don't want to remove something but rather get its texture/meshes, or want both? For that we use frame analysis to dump everything related to listed vertex/pixel shader hash:

Instead CommandListN2General we use CommandListN2Dump, it's not possible to have two "run" commands under same section, so you can comment out "run = CommandListN2General" line by adding ; in front of it and then add "run = CommandListN2Dump" below it
and revert back once you done

From step 4:
 

[ShaderOverride*CUSTOMNAME*]

hash = *SHADERHASH*

;run = CommandListN2General
run = CommandListN2Dump

for example:
 

[ShaderOverrideRIPTonfas]

hash = 91ea5a0a0fc326fa

;run = CommandListN2General
run = CommandListN2Dump

After that ( F8 ) to perform Frame Analysis

This will create folder "FrameAnalysis-*CurrentDate*" in root directory of a game with everything that was possible to dump from listed shader

Do not forget to remove "run = CommandListN2Dump" line once you done or if you plan on sharing your mod with other people, or this will force them to dump your shader every time they try dump something for themselves, which is no bueno.


 


How to make texture edits:

Spoiler

1. Decide what texture you want to edit

In my example I'll be using Kodama Bowl that shares same shader hash with tonfas from previous tutorial

1_texcomp.png

2. Find correct vertex/pixel shader and add shader check:

Repeat/Go through steps 2-4 and 7 from first tutorial "How to remove models/effects"

-------------------------------------------------------------------

3. Find texture you wanted to edit:

Open newly created "FrameAnalysis-*CurrentDate*" folder

In case of textures you should be looking for .dds files
To find the texture you wanted to edit easier, you can install something like Paint.net that can generate previews for .dds files in windows explorer
Also, pay close attention to names of the textures, in my example: "000012.1-[commandlistn2dump]-ps-t1=de095efb.dds"

de095efb - hash of the texture something we will need for later
ps-t1 - gives us general idea what type of texture that is:

ps-t0 - usually diffuse (color) textures, something you need most of the time and should be looking for first
ps-t1 - usually specular textures
ps-t2 - usually displacement textures
ps-t3 - usually normal map textures

But Nioh 2 has some peculiar cases and Kodama Bowl in my example is one of those!
There's no ps-t0 texture! Instead it uses combined color + specular(as alpha channel) texture under ps-t1!
This in turn changes how we going to save it after editing.

2_texcomp.png

4. Opening texture and making edits:

You can use any program to open .dds files that supports it but I had some bad experience with files being partially corrupted in both GIMP and Paint.net. I highly recommend using Photoshop with either Intel Texture Works Plugin or NVIDIA Texture Tools Plugin

3_texcomp.png

5. Saving texture file:

After making edits it's very important to save it with correct settings. I'll be using Intel Texture Works plugin as example but anything that has .dds support should have similar ones
Settings depending on the type of texture:

 

ps-t0 - Color (+Alpha if present), BC7 Compression, sRGB, auto-generate mip-maps
ps-t1, ps-t2, ps-t3 - Color (+Alpha if present), BC7 Compression, Linear, auto-generate mip-maps

In my example even though Kodama Bowl uses ps-t1 texture to hold general color data (that usually saved in sRGB). because it is ps-t1 that uses alpha channel to hold specular data it should be saved in Linear color space.

Save texture file in the same folder your mod .ini is

-------------------------------------------------------------------

6. Apply edited texture in game:

Back to the mod .ini, and tell 3DMigoto to apply the texture, time to check texture name again, in our case
000012.1-[commandlistn2dump]-ps-t1=de095efb.dds:


[TextureOverride*CUSTOMNAME*]

hash = *TEXTUREHASH*

ps-t*?* = Resource*CUSTOMNAME*  <- These should have same name because one references the other
 

[Resource*CUSTOMNAME*]            <- These should have same name because one references the other

filename = *FILENAME*


;Note: Instead of specifying texture type above, ps-t*?*(ps-t0, ps-t1, ps-t2, ps-t3) you can try using this command to make 3DMigoto sort it out ;automatically. In certain rare cases it can fix issues, or cause them instead. Example:
 

[TextureOverride*CUSTOMNAME*]

hash = *TEXTUREHASH*

this = Resource*CUSTOMNAME*    <- These should have same name because one references the other


[Resource*CUSTOMNAME*]            <- These should have same name because one references the other

filename = *FILENAME*

In my example:

[TextureOverrideKBowl]
hash = de095efb
ps-t1 = ResourceKBowl
 

[ResourceKBowl]

filename = ps-t1=de095efb.dds      <- once you noted down hash and texture type you can rename texture file, just make that name in .ini and actual
       file name match

-------------------------------------------------------------------

In my example final result looks like this:

; Here I add check for pixel shader

[ShaderOverrideKBowl]

hash = 91ea5a0a0fc326fa

run = CommandListN2General

; Here I tell 3DMigoto type and hash of the texture and where to look for the file

[TextureOverrideKBowl]
hash = de095efb
ps-t1 = ResourceKBowl
; And here I tell3DMigoto name of the file

[ResourceKBowl]

filename = ps-t1=de095efb.dds


Save file, back to the game, refresh, reset, the usual. If all done correctly texture in-game should swap to your edit!

 

 

 

Link to post

Well done. Thanks for the new thread too.

 

I'll check out 3Dmigoto now that we have a base to work from. Thanks so much for taking the lead and getting the ball rolling

Link to post
22 minutes ago, Miumin07 said:

Could you give us a navy blue shinobi set recolor? Trying to pull off a cosplay


Sure, I wanted to add more colors anyway.
 

 

18 minutes ago, bsfy said:

How to export texture map? thank you


I'll do a write-up on doing basic texture modding using 3DMigoto later.

Link to post

Great work! Tested working 100% Tho if you want to take some request I might suggest trying to remove the cape out of The Ferry Man's Robe

It might make a good feminine looking armor the game has been lacking (though I'm not so far into the game yet)

The armor in question - the cape was very annoying looking (also clipped through weapons on the back) .

 

Spoiler

1792233834_nioh22021-02-1001-05-54.png.cae8dd3f5765bc29ccc12b44ef63e61b.png


And also maybe removing the fur thingy from this bottom piece
 

Spoiler

1487690277_nioh22021-02-1001-07-50.png.db11112b7207e24066eb5ac265c4a128.png


Would totally understand if you wanna work on something else tho, Thanks a bunch! :D
 

Link to post
On 2/9/2021 at 1:47 PM, ecobotstar said:

Great work! Tested working 100% Tho if you want to take some request I might suggest trying to remove the cape out of The Ferry Man's Robe

It might make a good feminine looking armor the game has been lacking (though I'm not so far into the game yet)

The armor in question - the cape was very annoying looking (also clipped through weapons on the back) .

 

  Hide contents

1792233834_nioh22021-02-1001-05-54.png.cae8dd3f5765bc29ccc12b44ef63e61b.png


And also maybe removing the fur thingy from this bottom piece
 

  Hide contents

1487690277_nioh22021-02-1001-07-50.png.db11112b7207e24066eb5ac265c4a128.png


Would totally understand if you wanna work on something else tho, Thanks a bunch! :D
 

 

Example:

 

Spoiler

image.png.4a8149c593c679db55dbbb5dcad22589.png

 

 

Here's the Pelt Removed just throw that in a folder in the mods folder should work.
I need to grab a ferrymans cape but that one should be pretty simple too
 

 

 

UPDATE: Was using Shader level edits before, ended up causing issues. Updated using IBs now. Shouldn't effect other items now. But if it does let me know. Also, it now uses the Mod Enablers call to look at the IBs of the back belt because that ID was already in there, If you're using VVMod version then uncomment the [ShaderOverrideBackPelt] Section in the .ini

 

PeltRemove.ini

Link to post
4 hours ago, ShaolinKitsune said:

 

Example:

 

  Hide contents

image.png.4a8149c593c679db55dbbb5dcad22589.png

 

 

Here's the Pelt Removed just throw that in a folder in the mods folder should work.
I need to grab a ferrymans cape but that one should be pretty simple too
 

PeltRemove.ini 376 B · 16 downloads


Hmmmm I try the mod (put it in a folder within the "Mods" folder) but it just turn invisible like this.
 

Spoiler

388059565_nioh22021-02-1017-20-13.png.2b154ec374a1f093804a356028467bbe.png


And also turn ma gurl Toyo weird.
 

Spoiler

1656913243_nioh22021-02-1017-18-29.png.44a3050bbfebc5a0272890b13c2b871a.png


It was fixed when I turn off or deleted the mod too, but that means I can't make your mod work. Any ideas?

Link to post
40 minutes ago, ecobotstar said:


Hmmmm I try the mod (put it in a folder within the "Mods" folder) but it just turn invisible like this.
 

  Reveal hidden contents

388059565_nioh22021-02-1017-20-13.png.2b154ec374a1f093804a356028467bbe.png


And also turn ma gurl Toyo weird.
 

  Reveal hidden contents

1656913243_nioh22021-02-1017-18-29.png.44a3050bbfebc5a0272890b13c2b871a.png


It was fixed when I turn off or deleted the mod too, but that means I can't make your mod work. Any ideas?

 

 

Hmm the only thing I can think of is that the IB's are different on your machine for whatever reason. I would suggest Following Estorhtt's Guide on it. 

So the Wolfpet was broken into a few parts, The back section, and three differenet front sections.

So Enable hunting mode, and use Num1 or Num2 to cycle through the shaders. stop when the back pelt disappears. hit Num3 to copy that in the clipboard and replace the 

"ca6c4ac5ac115146" in hash = ca6c4ac5ac115146 with the copied value. It's under the [ShaderOverrideBackPelt] section

That will make the back half of the pelt disappear when the mod is loaded

Now, use the same Num1 or Num2 to cycle through till the whole pants model disappears copy that value using Num3 and replace the 
a38c98c7c7c31931 in hash = a38c98c7c7c31931 in the [ShaderOverrideFrontPelt] section

 

all this does atm is tell 3Dmigoto we want to look at this shader but now we need the parts we want to remove.

 

Press Num + to reset the hunting mode settings and now use Num 7 or Num 8 to search through the IBs

 

once you found one of the pieces of the pelt, use Num 9 to copy it and replace

"9b0decde"  in hash = 9b0decde under [TextureOverridePelt] section

 

do that 2 more times for [TextureOverridePelt2] and [TextureOverridePelt3]

 

after giving it the values your game uses, it should work properly

Link to post
3 minutes ago, ShaolinKitsune said:

 

Hmm the only thing I can think of is that the IB's are different on your machine for whatever reason.

 


I can't check atm, but this should not happen if running on the same version of the game. Updates do can breaks things, such is downside of 3dmigoto.

Link to post

After beating the whole game (incl. DLCs) this is probably the most "revealing" combo you can get in the vanilla game (Kawanami Clan Vest - chestpiece, Thief's Waistguard - pants, Archer's Straw Sandals - boots, Genmei Onmyo Mage Bracers - hands). 

 

 

Spoiler

20210210123516_1.jpg.a084e7819963a26aacd8895821bf242b.jpg

 

Spoiler

20210210124416_1.jpg.cf26d1487b4812aed07831427490bd9e.jpg

 

Obviously there are things that could be improved here, such as:

 

1) removing the stupid turtle shell from the chestpiece

2) removing the "fur things" from underneath the waistguard

3) no idea if the overdone chest bandages could be lessened or replaced by something smaller to show some cleavage....I'm not exactly an expert

 

Also, in the last DLC you can unlock

Spoiler

transformation into Nyotengu from DOA - her outfit is kinda censored though. She has huge granny underpants under her robe, and chest bandages covering up any possible cleavage. Also, her "transformation version" has no wings.

 

Hope this post helps any modding future.

Link to post

@etsorhtt 

So is the ini file setup out of the box to export the VB and IB files? I used those + his addon to import to blender before, but I cant get the IDs to show up again on another dump I believe I originally did it with your supplementary script and his original setup.

Or better yet is there just a way to export the currently selected item in hunting?

Link to post

@ShaolinKitsune

Yeah, it should be dumping everything, I just added more checks for textures compared to the one from VVMigoto. for the meshes make sure you added both pixel and vertex shader check:
 

Spoiler

Annotation 2021-02-10 160438.png


Also, from my experience with VV, it's better to use VB/the hash displayed in blender collections window upon importing(had it change in magical ways compared to what was show in hunting mode):

vb0=fc2db56b

 

Annotation 2021-02-10 161139.png

Really sucks that normal map inverts.

Link to post
5 hours ago, etsorhtt said:

@ShaolinKitsune

Yeah, it should be dumping everything, I just added more checks for textures compared to the one from VVMigoto. for the meshes make sure you added both pixel and vertex shader check:
 

  Reveal hidden contents

Annotation 2021-02-10 160438.png


Also, from my experience with VV, it's better to use VB/the hash displayed in blender collections window upon importing(had it change in magical ways compared to what was show in hunting mode):

vb0=fc2db56b

 

Annotation 2021-02-10 161139.png

Really sucks that normal map inverts.

 

 

So the Normal maps seem to come out fine for me....unless I'm just misunderstanding what you mean. I am still fairly new to 3D Modeling.

Spoiler

NormalsSeemFine.thumb.png.ba318f6c9de90cb28ea612a54d833018.png

 

 

So far I've been able to export and import some decent parts of the models, however the snag I'm hitting is trying to get the body to export.  I can slice it up a million ways with Vertex shaders, Index Buffers, Vertex Buffers. But it never seems to be dumped. Seems like its composed of sever different parts, L/R of each Shoulder, upper arm, wrist, thigh, knee, calve, feet, buttocks and then lower ribs, collar, neck and jaw. But I cant get a single piece to export. 

I'd really like it so I can make sure theres no seems in the replacement models, and then the texture is going to be another issue all together.

Spoiler

Progress.png.5b15cad926bc71e097c5807d3afaadb5.png


 

Link to post

Hi,

for male version of "Fundoshi Flap Removal"

I replaced this number: 39407ec4 with this: 6e4a8455 in this file "\Nioh2\Mods\Basewear No Flap\flapremove.ini" and it seems to work.

Link to post

@ShaolinKitsune

I uploaded blend file with the body.

For the normal maps I meant when exporting mesh back to game:

Spoiler

Nioh 2 The Complete Edition Screenshot 2021.02.10 - 16.24.33.94.jpg


The "shine" changes but it's not a specular but a normal, I tested it quite a bit. It literally inverts inside out. More noticeable on back of fundoshi with mod enabled. This is what normal maps look like, they add depth to the model and react to light direction:
 

Spoiler

normalmap.png


For the body, I was able to import it earlier, yeah it's split into tiny parts, probably to be able dynamically hide them depending on equipped armor.
But yeah the issue with character textures is they're "baked" from your character creator settings, and wholly unique to your character in skintone/tattoos/marks/everything.

@loxoss_

Alright, I'll check it out and add to the mod if all good!

Edit: All good, hash is correct, I edited model to remove the top part just like with female version before. Thanks!
 

Basewear No Flap.7z

BODY_F.blend

Link to post

im having the same issue with the pelt remove mod as ecobotstar it makes the lone wolf legs, top, and bottom all invisible like a chunk of my girl is missing but the other stuff works fine the flap removal is great if we could get a recolor to like black or something to make it look like panties that would be great :D

Link to post
11 minutes ago, dropkickinit said:

im having the same issue with the pelt remove mod as ecobotstar it makes the lone wolf legs, top, and bottom all invisible like a chunk of my girl is missing but the other stuff works fine the flap removal is great if we could get a recolor to like black or something to make it look like panties that would be great :D

 

I'll just make a quick video tutorial later for people who run into this issue. So that way they can put something that works on their system together.  Mine doesn't screw with Toyo at all. So I'm at a loss as to why it works for some but not for others.

 

1 hour ago, etsorhtt said:

@ShaolinKitsune

I uploaded blend file with the body.

For the normal maps I meant when exporting mesh back to game:

  Reveal hidden contents

Nioh 2 The Complete Edition Screenshot 2021.02.10 - 16.24.33.94.jpg


The "shine" changes but it's not a specular but a normal, I tested it quite a bit. It literally inverts inside out. More noticeable on back of fundoshi with mod enabled. This is what normal maps look like, they add depth to the model and react to light direction:
 

  Reveal hidden contents

normalmap.png


For the body, I was able to import it earlier, yeah it's split into tiny parts, probably to be able dynamically hide them depending on equipped armor.
But yeah the issue with character textures is they're "baked" from your character creator settings, and wholly unique to your character in skintone/tattoos/marks/everything.

@loxoss_

Alright, I'll check it out and add to the mod if all good!

Edit: All good, hash is correct, I edited model to remove the top part just like with female version before. Thanks!
 

Basewear No Flap.7z 20.79 kB · 7 downloads

BODY_F.blend 3.52 MB · 1 download

 

Awesome thanks for the model, See if I cant do some mesh editing that isnt god aweful.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...