News:

Rings of Reznor!

Main Menu

Cleaning FF Nifs in NifSkope

Started by Symon, May 04, 2013, 09:11:32 PM

Previous topic - Next topic

Symon

Introduction
What do I mean by cleaning? Well, if you examine meshes in Nifskope, it's not uncommon to see redundant nodes. Unlike other games, I generally find FF Nifs fairly clean, with most of the flock in a nif down to the quality of the exporters used to create it. Note that the Irrational released exporters are some of the best available (for a long time the advice to Morrowind modders was to seek these out and use them instead of the ones Bethesda used). Even so:
1. The 3DStudioMax exporters seem to have a wretched habit of producing inefficient nifs.
2. Especially I think with Character Studio.
3. The Niftools 3DSMax exporters are not the most supported.

The better question is why do this cleaning? Well, for one thing you'll make the Nifs smaller. Usually only by a few kilobytes (This isn't Oblivion, where a badly produced Nif can be nearly 10Mb oversized!!) That's good for your disk space, memory and it means your processor doesn't have to look at and and then ignore these nodes. One particular cleanup is to 'share properties'. Instead of having 20 properties all the same, taking up space and with your processor treating them as different (it doesn't know they are identical), you substitute one property. Now cleaning up one mesh isn't going to transform your machines performance. But cleaning them all always helps. Cleaning all your meshes, while slow and tedious to do, will be a big help to your rig. My advice to anyone who uses Blender, Maya, 3DSMax or any meshing software to produce meshes would be to optimize the resulting Nifs.

All these cleanups are simple NifSkope 'spells'.

There are no screenshots in this tutorial. Firstly because I despise them, and secondly because if you need screenshots, you aren't comfortable enough in NifSkope to attempt this (yet). Be aware as always that if you delete the wrong things, you can break the Nif, so have a backup in case of disaster. Remember that NifSkope doesn't say, 'are you sure'? It assumes you KNOW WHAT YOU ARE DOING!!!

Step one: Open the Nif you intend to clean. Don't bother looking at the image. You are interested in the block list, usually on the left.

Step Two: Inspect the Block list. You should see one node, 'scene root'. Sometimes you'll see two or three nodes, experience will show these are ok. In either case, move on to step three. What you don't want to see, is a huge list of nodes, with names like 'NiTriShapeData' or 'NiSkinInstance' (uncommon in FF, but I'll include this anyway). These should have an NiTrishape as parent, themselves children of the scene root, and so should not be visible at all until you open the scene root. These are corrupt nodes taking up space but doing nothing, that usually result when someone did block>remove rather than block>remove branch!
You need to delete them ALL! It's tedious if there are 12 Mb of them, which I have seen. The best way is to right click on the scene root and select 'crop to branch'.

Step Three: Select Spells>Optimize>Combine Properties. There is no point to having the same property defined 20 times in a Nif. This replaces identical properties with one node. Decent optimization. Note that a property called Eve is NOT the same as a property called eve. (The capitals). You can fix this by changing the names to be consistent and then repeating the step.

Step Four: Select Spells>Optimize>Remove Bogus Nodes. This step removes valid nodes that are redundant. Do NOT does this on an animated head mesh though. NifSkope sees the Camera node as bogus. If you let it remove that the head is now broken.

Step Five: You've done all the basics, so save the mesh. Check how much space you saved. It might only be 10k, or it could be more, depending on how much work you had to do.

Step Six: There are more advanced techniques you can try, for example, you can colapse redundant UV maps. A mesh with Base, gloss (refl) and glow textures will usually have the same UV map defined three times. You only need it once. Open the NiTexturingProperty node. Open the base, gloss and glow texture branches. You'll usually find base uses UV0, gloss UV1 and glow UV2. Change them all to use UV0. Then open the NiTriShapeData node. Find the number of UVSets and change it from 3 to 1. Then rightclick on the UVSets array and select 'array update'. You have just eliminated two redundant UVmaps.

As you gain confidence and experience, you start to know 'what looks wrong' when you inspect a Nif and what you can do about it. Start small and build up your confidence.

This article is FF specific though many if its principals also apply to FF3R. Please report any optimizations you feel don't work. I do intend to do an FF3R specific version.
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.

Helix

Thank you for that, Symon. That was ridiculously informative. I'm going to give this a shot since your directions were so clearly stated.

Cyber Burn

Since I skope mainly for  :ffvstr:, I look forward to your  :ffvstr: version of this tutorial.