Deleted49413338User Posted September 22, 2018 Share Posted September 22, 2018 I have been talking to an experienced modder who recommends using material swaps to create a variety of npc outfits. For my mod though, a lot of the body meshes are custom shapes so the clothing will only fit that one body. What would be the advantage of using material swaps over just having multiple LL entries for Armor and armor addons to create the outfits. I currently use a custom body shape with the custom clothing as one singular nif. I have several of these assigned to one NPC in an outfit LL. So, when that NPC spawns it has a chance of drawing any outfit from the LL. Heads and bodies are not interchangable due to the custom shapes, so the outfit is Head,body,clothes all in one nif. If I create a material swap for just one outfit or armor addon.. ( not sure where the material swap goes by default? Or does it go in the actual NPC record entry?) rather than an outfit LL containing all the different armors.. is that advantageous? Is it preferable for performance reasons or is there no real difference? It would mean I would have to create material files for everything I am assuming? Link to comment Share on other sites More sharing options...
DeathMotif Posted September 22, 2018 Share Posted September 22, 2018 Everything has a cost in terms of memory, and memory is a precious commodity. It's a balancing act every time you create more meshes or textures with respect to memory management. The purpose of material swaps is to allow you to reuse a mesh with different textures. In this way you can save memory resources while extending variability. Keep in mind that for every material (texture) you create, you will need a separate Material Swap (MSWP). That is how the game recognizes and loads materials. I would suspect that your meshes contain your default material, so providing a material swap won't be necessary unless you have two or more materials total and want to swap between them. Please keep in mind that this is a separate issue from leveled lists, unless you want the NPC to have a random chance of having a particular material swap on an outfit. Given your use case, material swaps probably won't be effective. That said, is there a particular reason that you need the NPC to be so unique? Are all the armors compatible only with this body type? Is there a reason you didn't use BodySlide and OutfitStudio to make your NPC more compatible with existing body types? Link to comment Share on other sites More sharing options...
DeathMotif Posted September 22, 2018 Share Posted September 22, 2018 One thing I should point out. Textures can be very expensive with respect to memory. The size texture you choose to use will have an impact upon people downloading your mod. Be careful to avoid the temptation of making everything 4K. Yeah they look pretty, but they are memory hogs. Ignoring compression, 2K textures consume four times the amount of memory than 1K. Similarly, 4K consume four times the memory of 2K. This is because every time you double size, you are actually doubling the size across two dimensions. So 4K consumes approximately 16 times the memory of 1K textures. As you may imagine, that means that people with smaller memory video cards may not be able to run the game with your mod loaded if your textures take up too much memory.Another concern with respect to material swaps, you need to be careful with customization. Most meshes can only display a single texture (unless they are comprised of different parts, like the Vaultsuit.) You'd need to create a separate texture for every combination that you want when mixing and matching. I have found that a less memory intensive approach is to create multiple layers on the mesh (simply by duplicating the vertices if necessary), and applying a different material swap on each layer. This requires that every layer except the base layer support transparency, but that may be avoided by simply using mesh layers that only have the faces needed for the effect, without duplicating everything. An example of this is every mesh that has a decal applied (such as the vaultsuit number on the back of the vaultsuit). Using this technique, you can reduce the number of textures from ( _m_ base layer variations * _n_ successive layers * ( _P#_ variations ) ) to simply _m_ + _P#_ variations. For example, if you have three different areas to modify on your texture, and you have 4 options on the first change, 2 on the second, and 3 on the third, you'd need 4*2*3 textures (24 total textures) each requiring memory and a separate material swap. If you use layered meshes, that would be reduce to 4+2+3 textures (9 total textures) along with 9 material swaps. It's a trade-off, mesh complexity versus number of textures. On thing to remember is that there are limits to the number of vertices you can use in a mesh, so efficiency is key. The rest I leave up to you. Link to comment Share on other sites More sharing options...
Deleted49413338User Posted September 22, 2018 Author Share Posted September 22, 2018 Ok.. well that began to sound very complicated but by the end of your explanation, the examples helped me understand the jist of it I think. For my mod, There is two versions of a lot of the npcs that are the same but only with different textures These are bloody and rotten. lol. The only difference being a hue color change for most. I can see that material swap would possibly work there, but.. I made them two different races to have different blood colours. So It probably wouldn't work as I need it to. Other NPCs use multiple layers in the mesh ( I think? Multiple BSSubIndexTriShapes, each that have their own textures assigned to them) to assign Material swaps to these, would I have to split the mesh into multiple separate nif files, make them all as individual armor addons and assign them to have Material swaps? For example, atm I have a NPC mesh that contains the body, head, hair and clothes in one nif file. If I want the hair to be random colors or the clothes to cycle through a few different textures each time that npc spawns, do I need to split the nif into 3 separate nifs, one containing hair only, one containing the clothes and the other the body and head, then add material swaps to just the hair and clothing armor addons. (hair color might be done different using colour index numbers or something.. have not looked at how to get random hair colours just yet, but using hair as an example. I understand it will still be one Armor record that points to 3 armor addon entries. and the armor record is what goes into the LL. Also, I appreciate any help on this but please try to make explanation in laymans terms. I am new to this. Links to youtube vids would help if the explanation is lengthy and complicated. To be honest, I would rather not have to create material swaps at all, but I am willing to learn it if it is going to be beneficial for performance. I have kept all textures as original size and they are just edited vanilla ones. I originally was just pathing some of the nifs I created to use vanilla textures, but because some of the body shapes were custom made (just by manipulating verticies in Outfit Studio) and I had edited some UV maps for them, it was not compatible with players using Bodyslide bodies. Because Bodyslide must warp the vanilla textures to fit the warped body? Making copies of the vanilla textures and renaming them, then pathing the nifs to the custom textures should make it compatible I think. Link to comment Share on other sites More sharing options...
Thirdstorm Posted September 22, 2018 Share Posted September 22, 2018 Sorry if I missed a PM, household has been a little under the weather I'm Biased here... but... 1) Material Swaps allows you to reduce the total size of your mod, especially if some of it is Vanilla Textures remapped to a different / new target (aka the bloody meat textures on skin).Material files are more or less "free" when it comes to file size. 2) Material swaps allow greater flexibility and expansion, both by you and other authors.Using Vanilla material files inside the Nifs, when possible, makes it easier for others to make compatible swaps / changes. 3) You can make a material swap that has multiple target and swap textures in it.For example you can have one material swap that has 5 entries, so the Human skin points to X, the Bone points to Y, and the Meatcaps points at Z. Regarding BodySlide:You have (2) Problems here.1st and Most important.CBBE and Vanilla skin textures for Female ghouls are not compatible.The reason you swap black spots, warping and misallignment there were caused by that, and one of the edits I sent you included vanilla skin textures on a custom material file, mapped to your bodies.The same issue would occur with anyone using a EVB male body that is "Anatomically correct" 2ndThe larger problem, the stretching and other visual errors are being cause by having the wrong "root" skeleton selected.You have both the Human Bones and the Feral Ghoul Bones in allot of the outfits / NPC's, and once of the fixes I did was cleaning out the second skeleton. Link to comment Share on other sites More sharing options...
DeathMotif Posted September 22, 2018 Share Posted September 22, 2018 @Thirdstorm, everything you said is absolutely true. You'll get no argument from me. My discussion above is predicated upon well known mods like WIPAG and Kerrigan Bodysuit which both have many textures that, with few exceptions, bloat greatly due to creating many textures that are largely redundant due to minor changes. Keep in mind that the majority of these textures are new and don't use vanilla assets (aside from the power armor pieces) at all. I merely promote a method whereby the texture bloat can be mitigated to an extent. That said, I completely agree with you that material swaps themselves are inconsequential with respect to memory, and they add a profound amount of flexibility when modding, and should be used as much as possible...barring limits of practicality of course. Of course recycling existing textures is more efficient, but not always practical. It really depends on what an author is trying to do. In my experience, other than mashups, most authors create new assets rather than reuse old. I like to do both. I should point out that I always add material files to my nifs, even if they don't actually reference anything for display, just so that other modders have an easier time modding after me.As for the matter of BodySlide, not sure why they chose not to use vanilla assets. That would have been more convenient (not to mention more compatible). I guess they figured it wasn't worth the effort. However, the concept they have behind it should be put into use by Bethesda directly. Imagine having the ability to make all our humanoid races use a single mesh that takes in optional parameters (similar to how textures are an optional parameter) that natively to modify the shape of the mesh. With this "shape" file, you could have NPCs of all shapes and sizes, with the appropriate transforms for all worn clothing items and armor, without having to create duplicate meshes. To borrow a phrase from "Lord Todd", it just works. We could swap these shape files just like materials without bloating game assets. But I digress...Stretching is an artifact due to a system that wasn't designed to be modified in this way, being modified by an outside team who (possibly) doesn't have insider knowledge of the file structure, or perhaps they simply didn't design their software appropriately. Regardless, it's a great tool nevertheless, and would be my go to in the event I want to make my own custom body type (and you know I do. :wink:) Regardless, none of this changes the fact that your points are correct.@Oynlen Your texture problem shouldn't be that big of an issue. For one thing, the fact that the NPCs are of different races shouldn't matter. It's meshes and textures that are largely swapped. You are also able to swap other types of data as well, like stat buffs, perks and spells/effects. The race typically isn't involved with such stuff directly. Keep in mind that 3rd gen Synths are indistinguishable from humans, they use the same assets. I haven't looked into it, but I suspect that all that's different is that they are humans that merely add a synth component on death in the system. Possibly a bad example. Will have to look further into this another time. Back to the main point, hue change, color and especially clothes can all be swapped relatively easily using your existing setup provided you do so correctly.You are correct that the BSSubIndexTriShapes is where the actual mesh data is contained. Each one is a separate mesh within the nif, and thus may be modded separately. It's the way vaultsuits are set up. The body, trim and vault decal may all be individually modified and textures swapped. There are several examples of this on the nexus. Even I have a mod for this. The important thing to remember is what Thirdstorm said with respect to bones and weights. You need to make sure that the weights of the vertices are applied to the correct bone(s) for animations to look correct.Overall, it's your choice what to do. When it comes to NPCs and their meshes, I definitely defer to Thirdstorm. He is one of the most talented mod authors in this area. That said, If I were you, I'd definitely use material swaps. Otherwise your are doing things the FO3 way, and creating a separate mesh and texture for every variant you want to make. This is very wasteful. You should only need one or two meshes, and then use material swaps for your variability.Material swaps are not that difficult to make. However, they are not useful by themselves. Depending on how you intend to apply them, you will need at the very least an Object Modification (OMOD) to reference your material swap (MSWP). If you want your MSWP to be inventoryable, you will need a Misc. Item (MISC) reference to be used by the OMOD, and if you want to make your material constructable, you need a Constructable Object (COBJ) to reference the OMOD. There are many ways to reference OMODs beyond this. If you look at some of the armors (ARMO) in the game, they can hold references to OMODs. In fact, this is how many armor pieces populate with a variety of mods already applied. I recommend looking at combat armor, and you will see how it can be done. If you want something to use as a reference for how I applied much of what has been discussed, I recommend you look at my Jill's Armored Infantry of the Fusion Age mods. As for any "body work", I refer you back to Thirdstorm. Link to comment Share on other sites More sharing options...
DeathMotif Posted September 22, 2018 Share Posted September 22, 2018 Sorry for the WOT. :blush: Link to comment Share on other sites More sharing options...
Thirdstorm Posted September 24, 2018 Share Posted September 24, 2018 Pfft all good Link to comment Share on other sites More sharing options...
Recommended Posts