Synthesis-Collective / SynthEBD

Port of zEBD to Mutagen
31 stars 7 forks source link

SynthEBD not correctly changing custom NPC's body/hand/feet .nif paths? #65

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi again,

This time I'm trying to use SynthEBD to patch Custom NPCs in order to force them all to use vanilla body meshes and my own list of BodySlides/Textures through Body Descriptor and Textures rules.

However, I noticed that in-game some of these NPCs aren't getting the right bodies, sometimes a very weird one. Forcing a Bodyslide using AutoBody's hotkey sometimes work, but when it does, they quickly revert to old body after some event refresh.

Checking with SSEEdit, I've noticed that SynthEBD is correctly overwriting the NPC's Mod .esp "torso" entries of the "Armor Addon" section (shouldn't it overwrite hands and feet also?) with the vanilla torso .nif path. However, that looks like it is being ignored, since I've also noticed that SynthEBD overwrites the NPC's WNAM/Worn Armor record with its own NPC_Patched0001 ARMO record. This record then points me to another Body_Patched0001 record that has, among other entries, three ARMA records (torso,feet,hands) where each has Model Filename entries pointing to the custom NPCs torso/hands/feet .nif path, and not the vanilla paths... shoudln't all of these paths point to the vanilla one, since I chose the "force" option on SynthEBD to use vanilla meshes?

These were all vanilla Races NPCs. On a side note, I did test on one custom race NPC, and its "Armor Addon" entry wasn't even overwritten by SynthEBD like the other vanilla races NPCs. I also made sure to include its custom race to the patchable races list...

I'm sorry if the explanation got a bit convoluted, I don't have a good understanding of Skyrim's inner working :)

I ran the patcher with these options turned on: image

Thanks!

Piranha91 commented 1 year ago

That does sound like incorrect behavior - can I ask 2 favors to help with debugging? 1) can you upload screenshots of what you are describing in SSEedit? 2) can you tell me which follower it is so I can download and test?

regarding the follower though, keep in mind that config files are race restricted as well. Usually the head normal maps are specific to races (eg breton normals only go to Breton NPCs). That means that if there are no head normals whose allowed races include the custom race NPC, the whole config file will be deemed incompatible). The easiest way around this is to use the race aliasing feature in the general settings menu - if you want that follower to get Nord textures, for example, you would alias the custom follower race as NordRace. My hunch is this should resolve your issue.

ghost commented 1 year ago

Sure, I'm using Somollig's NPCs converted to SSE and I've merged them into one .esp via zEdit's merge.

Somollig's original NPC's: https://www.nexusmods.com/skyrim/users/57455561?tab=user+files

Some SSE's conversions: https://www.nexusmods.com/skyrimspecialedition/mods/46789?tab=description https://www.nexusmods.com/skyrimspecialedition/mods/35077?tab=description https://www.nexusmods.com/skyrimspecialedition/mods/48822?tab=description

These are the entries for "Charlotte" for example:

image image image image image

About the custom race NPC, it was as you said, my conf was lacking the race alias... Now it looks like it is patching textures correctly. I didn't have time to do some thorough testing, but from what I could see, there was some weird body stretching and some mismatch between hands and body. Its "armor addon" wasn't patched like the other followers, but its NPC entry was properly patched... I'sm still trying to debug it properly though...

Gawdzila commented 1 year ago

I can confirm that I am experiencing the same sort of issue with EasyNPC, with actors inheriting the old body meshes. The body textures do appear to work correctly, and the clothed body mesh appears correct as well, but the face textures and naked body are still being inherited from EasyNPC. I am using the EasyNPC Compatibility Mode.

Interestingly, I took a peek in SSEEdit and it looks as if there is a copy of the EasyNPC torso armor record being created with vanilla paths, with the same name as the one in the EasyNPC record, but that one is not being used. Instead, another version with "_Patched0001" appended to the name is being used, and that one contains the old path for the custom body that is packed into the EasyNPC .bsa file. I was doing some testing with the BijinNPCs mod and, weirdly, if I load the mod but disable the .esp from it, SynthEBD then replaces the body properly. I have never been able to get it to stop using the Bijin face textures, however, even when I was not using EasyNPC at all.

Piranha91 commented 1 year ago

Just to clarify, are you running SynthEBD after EasyNPC and using the generated plugins in that order as well?

Gawdzila commented 1 year ago

Yes, exactly. EasyNPC first, which I use as the input to SynthEBD, and then placing the generated SynthEBD plugin after the EasyNPC plugin so that it wins conflicts when running the game.

Piranha91 commented 1 year ago

That’s really weird - the body nif path issue I’ve reproduced and am in process of fixing, but I’ve never seen it fail to assign a face texture. Does the consistency entry for that NPC say it should have a modded face tex?

Piranha91 commented 1 year ago

The nif paths should now be working in 0.8.4.2. That said, I tested with Charlotte and I'm seeing a neck seam. Don't have a lot of time to dig into it - will try to look tomorrow to determine if it's just a bad texture combination in my testing or if there's some reason the script isn't applying to her. If it's an issue with the code I'll work on a fix asap. She's the only one in my testing who didn't get the script applied to her; not sure from a quick glance what's going on.

I still can't reproduce the issue of SynthEBD not applying a modded face texture. I'll need some screenshots to try to reproduce.

Gawdzila commented 1 year ago

It certainly seems to -- it would be weird if it didn't, since I did a specific NPC assignment to some of them :) I've been trying to diagnose it and see if some other mod is messing things up, but I've tried to avoid that by loading both EasyNPC and SynthEBD at the very bottom of both my load orders and all other NPC mods are deactivated. I'll get you some screen shots when I get a chance.

ghost commented 1 year ago

From what I could test, latest version fixes body meshes, so.. great job!

Charlotte's neck seam is now happening here too. I think it wasn't happening before, not so sure... maybe the problem is with the mod itself...?

Most of the custom NPCs I've tested are OK, but some of AZ's NPCs are having a bad head day:

https://www.nexusmods.com/skyrimspecialedition/mods/24797 (default option) this one has face textures problem, as if they aren't being assigned.

https://www.nexusmods.com/skyrimspecialedition/mods/42844?tab=files ("suzi" option) this one gives me the famous blue face problem

The last one was merged with other NPCs using zMerge. Maybe that's the real reason for the blue face? I don't know if merging plugins could be an issue...

Piranha91 commented 1 year ago

For the first NPC, I’ll try to test tonight and see if I can reproduce. For the second one with blue face, my hunch is that the resources aren’t being included in the merge. Try applying to it without merging - if it still a problem you’ll know.

Gawdzila commented 1 year ago

Okeedokee, here's some screenies showing the face texture issue. Figures the weird unheard-of problem would happen to me 😋 I've provided screenshots of Gerdur but most NPCs don't appear to be getting new face textures, not just the ones from Bijin mods; there are a lot of very prominent neck seams around.

Here's Gerdur, clearly with the original Bijin skin texture that contrasts with the texture assigned to her torso: 20221206_141238_MixedReality

Here's the bottom of my load order, showing that BijinNPCs is not loaded and that the EasyNPC merge and SynthEBD are at the bottom: LoadOrder

Here are my SynthEBD settings showing the settings and consistency/assignments for Gerdur, who should be using the head diffuse from ALT2: Settings 1 Settings 2 Settings 3 Settings 4

Do let me know if there's anything else helpful that I can provide!

Piranha91 commented 1 year ago

I’m starting to wonder if I messed something up when I repackaged one of the EBD scripts to include Pragasette’s esl fix. I’ll try to look into it tonight.

Piranha91 commented 1 year ago

Did a little bit of testing on the Charlotte follower... I put a custom watermark on the Demoniac head and body skin textures that SynthEBD was assigning to her. They both showed up in-game, so the skins are being applied, but the neck seam persisted. I then deleted SynthEBD and just checked her default appearance, and I see a huge neck seam anyway. Is this not the case for you?

ghost commented 1 year ago

Yes the neck seam is there anyway. With or withour SynthEBD. I've switched to the "original" (https://www.nexusmods.com/skyrimspecialedition/mods/34938?tab=files&file_id=135097&nmm=1) and not the "v2" version. The neck seam is almost imperceptible on this version.

ghost commented 1 year ago

Piranha, I've noticed this custom body .nif reference still being used... is that ok?

image image

It seems to happen with Pariahfolk13's NPCs, like Vorgha for example (https://www.nexusmods.com/skyrimspecialedition/mods/77812?tab=description).

Piranha91 commented 1 year ago

Is that model actually being used, or is there a torso Armature that’s superseding it in game?

ghost commented 1 year ago

Stupid me sent screens of different NPCs... -_-

These are Vorgha's entries: image image image

Vorgha is fine. I even removed the body/hands/head .nif/.dds files from the mod, and the body and armor meshes still loads ok, with the custom SynthEBD's patched textures.

However, Pariahfolk13's Inga NPC is being patched differently:

image image image

In this case, the default NPC appearance with armor loads the mod's textures. Without armor, it gets SynthEBD's textures and body meshes. Removing the mod's body/hand/head .nif and .dds files gives me a blue body with armor on, and SynthEBD's body/texture without armor.

Piranha91 commented 1 year ago

Link me to the mod so I can take a look on my end?

ghost commented 1 year ago

Sure

https://www.nexusmods.com/skyrimspecialedition/mods/76332?tab=description Morgan https://www.nexusmods.com/skyrimspecialedition/mods/78364?tab=description Inga

Gawdzila commented 1 year ago

I just tested by disabling SynthEBD and, while there is still a subtle seam, it seems consistent with the ones in the Bijin mod screenshots and it is much less pronounced than when I enable the SynthEBD plugin. To be sure it wasn't simply the ALT2 skin, I also changed her to Dibellan textures.

With SynthEBD: 20221207_204940_MixedReality (2)

Without SynthEBD: 20221207_191832_MixedReality (2)

I took a look in SSEEdit to see if I could see what was going on and it does look like her head texture is being created and assigned properly, it just apparently isn't being applied in the game. Gerdur_SSEEdit 1

Gerdur_SSEEdit 2

Last two tests. To force it to use Dibellan textures, I disabled both SynthEBD and EasyNPC, enabled the original Bijin mod, and swapped the textures manually to the Dibellan textures directly from the EBD folder, just to see what it should look like. The seam is still surprisingly obvious and they're very similar, but you can see that the freckle texture is different -- check the 3 prominent freckles right between the eyebrows in Bijin which are missing here, and also along the hairline, plus the shading on the neck/clavicle seems to line up correctly unlike in the top image.

20221207_211510_MixedReality (2)

Lastly, I did the "watermark" test and wrote in bright blue text on the forehead of the Dibellan head diffuse map located in the SynthEBD texture folder, then enabled EasyNPC and SynthEBD, and it looked exactly like the first picture. No watermark, so it looks like it isn't being used.

SynthEBD is at the very bottom of my load order and clearly it is overriding the body textures properly, so I'm at a loss as to why it wouldn't be doing the same for faces. Any ideas?

Piranha91 commented 1 year ago

Two questions:

1) Do you have EBD installed, and do you see its scripts in your real or virtualized data folder? 2) If you disable your NPC merge and just use Bijin's Gerdur and run SynthEBD, does she get patched correctly?

Piranha91 commented 1 year ago

Sure

https://www.nexusmods.com/skyrimspecialedition/mods/76332?tab=description Morgan https://www.nexusmods.com/skyrimspecialedition/mods/78364?tab=description Inga

I tested with Inga - I think this is something to do with her armor specifically. I tested by running SynthEBD on Aela, and painting a mark on the body textures assigned to her:

image

image

As you can see, that mark appears under her armor. When I did the same thing with Inga, this didn't happen. I put one mark on her default skin and another on her SynthEBD-assigned skin, and it's the default one that shows up while she's wearing armor. I don't have an understanding of where in the armor it points to the skin, but evidently that cuirass is pointing explicitly as her default skin, whereas Aela's uses whatever is underneath. I'm asking in the SkyrimMods discord server to see anyone can point me to what controls this, but I suspect it's on the side of the armor and therefore probably not within the scope of SynthEBD (although if it's controlled by the plugin and not by the .nif, I could potentially have SynthEBD detect the default outfit and auto-patch it). But I suspect it's controlled somewhere in the .nif.

Gawdzila commented 1 year ago
  1. Yes, I do have the original EBD installed and, if I look in the virtualized data folder tree in MO, I do see all 6 EBD scripts there.
  2. I tried running SynthEBD with Bijin NPCs only -- no NPC merge and no other NPC mods -- and it did not patch her face texture. One different thing it did do was to throw a couple of those errors on some random NPCs where it says they're gonna be re-randomized because of no compatible assets or somesuch, and then it spit out a new file into the overwrite called HeadPartDict3.json, but that all seems like expected behavior.
Piranha91 commented 1 year ago
  1. Yes, I do have the original EBD installed and, if I look in the virtualized data folder tree in MO, I do see all 6 EBD scripts there.

    1. I tried running SynthEBD with Bijin NPCs only -- no NPC merge and no other NPC mods -- and it did not patch her face texture. One different thing it did do was to throw a couple of those errors on some random NPCs where it says they're gonna be re-randomized because of no compatible assets or somesuch, and then it spit out a new file into the overwrite called HeadPartDict3.json, but that all seems like expected behavior.

I'm going to move this to a new issue to avoid cluttering, since it looks like it's a separate problem.

ghost commented 1 year ago

Humm.. I know nothing of how .nif files work, but by opening Inga's armor on NifSkope I could find the following texture references to Skyrim's default body textures (maybe it's set elsewehere in the .nif?):

image image

The only other place where I could find references to the mod's default skin is in the plugin itself, as shown on those last two screenshots of my last post ("Female World Model - Alternate Textures" references).

Piranha91 commented 1 year ago

I was able to get the correct skin to show up under the armor by changing the armor slots from 32 to 56. You'll need to do this in the armor record, the armature record, and the _0 and _1 .nif files. You can find instructions here: https://www.nexusmods.com/skyrimspecialedition/articles/2861 - note that inga's armor has a bunch of pieces in the .nif, and you have to do it for all of them. Also, I noticed her armor doesn't have .tri files for bodyslide, so I hope you weren't planning to use autobody or obody on her.

The simpler solution IMO is to just give her a different armor that doesn't have this issue.

ghost commented 1 year ago

Ah, nice catch... but oh well, that's too much hassle for one NPC lol

I'll go with your suggestion and just give her vanilla armor!

Piranha91 commented 1 year ago

I think the conversation in this thread has been resolved - remaining issues about neck seams are best discussed in the other open issue on this topic.