Silgrad Tower from the Ashes

Full Version: Essential mesh optimisation tips
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This thread is to draw attention to the fact that many meshes for Oblivion can have junk and unoptimised portion in it. Even Bethesda's own meshes have this problem. Fortunately there is a way to get rid of the junk and optimise the meshes.

The first solution involves using the program PyFFI. It automatically analyzes a mesh for any junk and unoptimised portions and then does the necessary repairs if any problems are found. PyFFI also provides a plugin for Blender and Maya which might automatically optimise the mesh when it is saved in either of these programs (not sure though, I'm getting Pacific Morrowind to confirm this).

Anyway, I think that every mesh that is used in this project should be optimised before it is released to the public.
Aye, that's what Koniption is doing with the audit. It's a big task but she's coping with it.
Quote:Originally posted by Ibsen's Ghost
Aye, that's what Koniption is doing with the audit. It's a big task but she's coping with it.

Yes, I've been scouring the meshes folders, optimising the meshes as I come across em.

I am using PYFFI. The problem is I have to individually open each nif to look through it to make sure that it does not contain things that would interfere with PYFFI (like morph animations, other stuff).

I also am looking for nifs that use non-MOPP collision type, and changing them to MOPPed collision type. I also try to "combine properties" of each nif using that Nifskope spell, which helps further reduce the file size.

I look out for other things, too, some minor, some not so minor (and some things I could totally choose not to do, though I end up doing them anyway - OCD nature of mine). I chunk away at the files a little at a time.

I'm working my way from the top of the meshes tree hierarchy, on down. I'm currently in the "meshes\blackmarsh\architecture\ruins.." folder. Architecture is the most labor intensive to fix, because they are so complicated most times. Between that, and the fact that my body/mind slows down in winter, and the RL duties of mine, it's a slow process...

Koniption
Quote:Originally posted by Koniption
I am using PYFFI. The problem is I have to individually open each nif to look through it to make sure that it does not contain things that would interfere with PYFFI (like morph animations, other stuff).
If you don't mind a suggestion, maybe you should go to the official forums and ask either PacificMorrowind (no space in user name) or Amorilia whether the latest version of PyFFI doesn't already check for some of the things you are looking for. If so, then less work for you. If not, suggesting it probably wouldn't be a bad idea so that those kind of meshes can be checked in future. I do know that checking for associated .egm and .kf files was a recent adition.

Quote:Originally posted by Koniption
I also am looking for nifs that use non-MOPP collision type, and changing them to MOPPed collision type. I also try to "combine properties" of each nif using that Nifskope spell, which helps further reduce the file size.
I will add a question to the PyFFI thread concerning MOPP collision types sometime today and see what they say and that might be another good candidate for addition to PyFFI. As for "combining properties", I recently had a PM conversation with Pacific Morrowind concerning a tutorial he wrote about mesh optimisation. Basically, he said that the only things in that tutoral that aren't applied in PyFFI is the "combine properties" spell and checking the NiNodes for redundant data, most notably unparented NiTextures/NiMaterials. He did mention that these two will probably be added in the near future though.

Quote:Originally posted by Koniption
I look out for other things, too, some minor, some not so minor (and some things I could totally choose not to do, though I end up doing them anyway - OCD nature of mine). I chunk away at the files a little at a time.
Again, you may want to get those suggested in the PyFFI thread so that those things can be optimised in the future. One thing I read recently was that PyFFI used to optimise meshes to reduce file size but now that has changed to optimise for performance.

For example, NiTriStrips are smaller than NiTriShapes. However, a problem found with this is that if an NiTriStrip's length is less than 10, lower FPS and increased stuttering will occur when that mesh is rendered. So a check was put in place to ensure that the strip length would be greater than 10 and if it wasn't, it would remain as a NiTriShape, even though it took up more space.


Quote:Originally posted by Koniption
I'm working my way from the top of the meshes tree hierarchy, on down. I'm currently in the "meshes\blackmarsh\architecture\ruins.." folder. Architecture is the most labor intensive to fix, because they are so complicated most times. Between that, and the fact that my body/mind slows down in winter, and the RL duties of mine, it's a slow process...
I would probably agree to that. I think actor meshes would be quite complex as well though. Anyway, I wish you the best of luck.

@IG
Koniption may be auditing the meshes but I think a policy of optimising these meshes should be put in place to ensure that an optimisation audit isn't necessary in future. I'm still waiting for a reply concerning the PyFFI plugins for Blender and Maya though.
Hi XJDHDR,

I posted on the PYFFI thread to ask about morphs just now. It'll have to be much later today until I'm home to see a response.

I read the pYFFI instructions in the OP, and it doesn't seem to be able to yet change regular bhkPackedNitriStrips/Shapes to its MOPP'ed counterpart. It has a feature that "changes collision type", but this only changes it from things like "static" based to "clutter" based, etc.

Yeah, I have a version of PYFFI that optimizes for performance.

As far as putting a policy in place to pre-optimize meshes that people will use, that will be hard to implement, for the most part. We use a lot of modders resources, and oftentimes those resources were made "back in the day", when certain features did not exist. Also, beginner-ish modelers might not know just how important optimization is for a game, nor know what nif features and details make an optimized mesh. I've come across many who did not know about PYFFI, and certain collision facts. I myself have been guilty of most of this before, when I was a newbie, and even when I was well into modeling.

Koniption
Quote:Originally posted by Koniption
I posted on the PYFFI thread to ask about morphs just now. It'll have to be much later today until I'm home to see a response.
I saw that post. You only mention morph animations though. What about everything else you know that causes problems (...that would interfere with PYFFI (like morph animations, other stuff)). If you have a list of things that cause problems with PyFFI, you may as well give them the whole list.

Quote:Originally posted by Koniption
I read the pYFFI instructions in the OP, and it doesn't seem to be able to yet change regular bhkPackedNitriStrips/Shapes to its MOPP'ed counterpart.
I've made a post in the PyFFI thread concerning MOPPed collisions.

Quote:Originally posted by Koniption
As far as putting a policy in place to pre-optimize meshes that people will use, that will be hard to implement, for the most part. We use a lot of modders resources, and oftentimes those resources were made "back in the day", when certain features did not exist. Also, beginner-ish modelers might not know just how important optimization is for a game, nor know what nif features and details make an optimized mesh. I've come across many who did not know about PYFFI, and certain collision facts. I myself have been guilty of most of this before, when I was a newbie, and even when I was well into modeling.
My post regarding the PyFFI plugins for Blender and Maya got a reply sometime this morning. Apparantly, the Blender plugin does either a partial or full PyFFIcation of the mesh depending on the options selected in the "Export NIF" window.As for Maya, Pacific Morrowind couldn't say since he doesn't use it. 3DSMax though doesn't have a PyFFI plugin.

So if Blender and Maya(?) users could install PyFFI on their PC, that would mean that the mesh gets PyFFIed when it gets saved, taking care of that problem then and there. Meshes created in 3DSMax though would still need to be run through PyFFI.

Otherwise, I agree that modders resources and the work of beginners would need to be checked. I will stand behind whatever works best for this project.
Quote:Originally posted by XJDHDR
Quote:Originally posted by Koniption
I posted on the PYFFI thread to ask about morphs just now. It'll have to be much later today until I'm home to see a response.
I saw that post. You only mention morph animations though. What about everything else you know that causes problems (...that would interfere with PYFFI (like morph animations, other stuff)). If you have a list of things that cause problems with PyFFI, you may as well give them the whole list.

Well, I'm not for sure if it matters, but I don't optimize meshes with flame nodes and light nodes, unless i separate out the nodes from the nif first before optimizing, then putting them back in afterwards. It might just be superstition on my part. I think I started doing this because of something I read, but I must have read about it a long time ago, because I can't remember where I read such info. So it may be outdated or misinformation I read.

There might be other things, but it's been a long and tiring day, and my brain is fried. If I remember if/what they were, I'll be sure to post on the Beth thread.

Koniption
While you seem to be talking about optimising meshes post export, maybe it's worth mentioning a few things about optimising meshes while in the 3d software? This is what I'd recommend:

Once the main construction of the mesh is finished, but before UV mapping, be sure to consolidate the mesh by merging vertices where sensible. Obviously, you wouldn't want to optimise to the point of changing the silhouette of the mesh, or distributing the faces across the mesh unevenly. This sort of thing goes hand in hand with the other things that one should be doing when constructing a model; turning edges to be the shortest length possible, and so on.

Personally, I find that optimising in this way makes the mesh easier to UV map afterwards, since there is effectively less mesh to work with.
Just a quick hello to nick_op. Nice to see you're still around! :goodjob:
Quote:Originally posted by Ibsen's Ghost
Just a quick hello to nick_op. Nice to see you're still around! :goodjob:
Hi! I've been both quite busy and fairly ill recently, I've got far less time these days for modding, though I am currently working on a project with Koniption that will hopefully find it's way over to Black Marsh and Silgrad once it's done. Wink