[INFO][RELZ] PyFFI-Python File Format Interface

Post » Mon May 02, 2011 10:13 pm

I'll assume you mean the PyFFI performance, not game performance, and I doubt a regex helps that much if any. Especially with Python, regexes probably have more overhead than simple substr-type tests w/o regex. It's simply a more concise and intelligent way of matching the filenames. "Keeping them" isn't a choice. If you don't have them PyFFI will try to optimize all meshes. This would be bad.

Basically, just copy the two INI files Arthmoor suggested, and use them. :)

Buf if you really want a glossary:

"." =  Matches anything but a new line (\n)"*" =  Means 0 or more"+" =  Means 1 or more"?" =  Means 0 or 1, or makes the previous "non-greedy" (*?, +?, or ??)"^" =  Means the start of a string"$" =  Means the end of a string"[]" =  Is a set of chars"|" =  Means OR"\" =  Escapes special chars

And there's also craziness like

{m}{m, n}{m, n}?(...)(?...)(?:...)(?=...)  lookahead assertion(?!...)  negative lookahead(?<=...)  lookbehind(?
And then there are about 30 bajillion special characters.

Basically, I think the point is, "Leave regex alone, it doesn't like to be messed with!" It's a curmudgeon. :)


Right on. I will just leave them as-is.
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am

Post » Mon May 02, 2011 9:26 pm

http://www.tesnexus.com/downloads/file.php?id=36882

I went ahead with releasing a new batch script which actually works, with up-to-date patches. It's based on the original Patch Scripts mod, but I rewrote the scripts and it supports Windows VIsta/7. It seems from viewing the originals that it had some oddly XP-specific syntax in there, that I still don't quite understand. Whatever it was no longer works. However, there's nothing I can see that would prevent my batch script from working in Windows XP. I followed the book with the syntax and I'm pretty sure mine will support XP. Please let me know if you are on XP and if you have any issues.

I've uploaded the PATCH file archives for both the vanilla Oblivion meshes BSA and the Shivering Isles meshes BSA. I also have an archive for QTP3 Redimized, though you do not follow the BSA extraction/creation instructions for that and instead unpack from the OMOD/BAIN archive and repack again.

One thing I noticed from the original patch scripts is that not everybody had FORFILES.EXE on their OS. I found it hosted on Microsoft's website, and I have it linked to in the Mirrors section. You only need to download it if you receive any "command not found" errors during the patching. Place it in the Patcher folder if you need it.
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Tue May 03, 2011 3:15 am

Arthmoor:

Why do you skip clutter and ground nifs?
User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Mon May 02, 2011 8:24 pm

Arthmoor:

Why do you skip clutter and ground nifs?


He doesn't. There are two INI files. You have to run both of them.
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Mon May 02, 2011 11:17 pm

He doesn't. There are two INI files. You have to run both of them.


Clutter and ground nifs are on the skip list for the main Optimize.ini. I thought that meant they get skipped? Let me take a look at the OP again...

EDIT:

Oh I see. So what does the second INI do that warrants a separate INI?
User avatar
Eve Booker
 
Posts: 3300
Joined: Thu Jul 20, 2006 7:53 pm

Post » Tue May 03, 2011 9:18 am

I'm not sure why the clutter nifs were included in the regex I'm using. There was some kind of reason, but it's buried in a past thread somewhere and I can't find it right now.

The second ini file is going back to cover what the first one misses. Which is the clutter folder and the _gnd.nif meshes. It skips the _gnd.nif files in the first run because many will overlap with the detection for helmets and such, but they're safe to optimize and so need to be picked up in a second pass. Usually that second pass is done in a fraction of the time because it skips over the stuff that's already done.
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Mon May 02, 2011 10:50 pm

what mesh files other than EGM should not be pyffi?

Are LOD safe?

what about KF?
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Mon May 02, 2011 10:38 pm

Yeah, this OP is in desperate need of an overhaul... I've been working on a candidate, but I want to let this thread run its course to make sure I've got everything. :confused:

These are the incompatible meshes:

-Any hair mesh
-Roothavok meshes
-Any mesh with a .EGM association (commonly helmets)
-Any mesh with a .TRI association (teeth, eyes, etc.)

_far.NIFs are ok, in fact, PyFFI is capable of further optimization specifically for them. Here's the batch script to call the Modify_makefarnif spell (courtesy of Vorians):
cd C:\Python26python.exe Scripts\niftoaster.py modify_makefarnif  --only _far.nif$ "C:\Program Files\Bethesda Softworks\Oblivion\Meshes"


Both of these will be covered in the OP overhaul I have waiting.

I've never seen PyFFI play around with .KF when running optimize, so I'd assume it doesn't optimize them. .KF files exist to tell the engine how to move skeleton bones for an animation, not much more. PyFFI is, however, capable of working a few tricks on them, such as reversing the animation or speeding it up/slowing it down.
User avatar
Eire Charlotta
 
Posts: 3394
Joined: Thu Nov 09, 2006 6:00 pm

Post » Mon May 02, 2011 9:45 pm


_far.NIFs are ok, in fact, PyFFI is capable of further optimization specifically for them. Here's the batch script to call the Modify_makefarnif spell (courtesy of Vorians):
cd C:\Python26python.exe Scripts\niftoaster.py modify_makefarnif  --only _far.nif$ "C:\Program Files\Bethesda Softworks\Oblivion\Meshes"






Shouldn't that be "C:\Program Files\Bethesda Softworks\Oblivion\Data\Meshes"?
User avatar
Janette Segura
 
Posts: 3512
Joined: Wed Aug 22, 2007 12:36 am

Post » Tue May 03, 2011 10:14 am

Actually that batch file from Vorians is intended for use in trying to generate _far.nif files. I think. It's been awhile, but that command structure looks obsolete. Which is where mine comes in:
"C:\Python26\python.exe" "C:\Python26\Scripts\niftoaster.py" --noninteractive opt_cleanfarnif --dest-dir= --source-dir= --pause --overwrite "%1" > "PyFFILog.txt"


You'll be sure it gets everything it should this way. I've also noticed that spell performs the normal geometry optimizations as it works.
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Tue May 03, 2011 8:30 am

When you say any hair mesh you mean even Hair.nif. Any nif that is for the hair slot in the game right?

And what about mesh NIF files that have EGM, do BOTH the myfile.nif AND myfile.EGM need to be removed from the Pyffi process or JUST the myfile.EGM?

LOD are ok then? Cool!


Yeah, this OP is in desperate need of an overhaul... I've been working on a candidate, but I want to let this thread run its course to make sure I've got everything. :confused:

These are the incompatible meshes:

-Any hair mesh
-Roothavok meshes
-Any mesh with a .EGM association (commonly helmets)
-Any mesh with a .TRI association (teeth, eyes, etc.)

_far.NIFs are ok, in fact, PyFFI is capable of further optimization specifically for them. Here's the batch script to call the Modify_makefarnif spell (courtesy of Vorians):
cd C:\Python26python.exe Scripts\niftoaster.py modify_makefarnif  --only _far.nif$ "C:\Program Files\Bethesda Softworks\Oblivion\Meshes"


Both of these will be covered in the OP overhaul I have waiting.

I've never seen PyFFI play around with .KF when running optimize, so I'd assume it doesn't optimize them. .KF files exist to tell the engine how to move skeleton bones for an animation, not much more. PyFFI is, however, capable of working a few tricks on them, such as reversing the animation or speeding it up/slowing it down.

User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Tue May 03, 2011 6:36 am

When you say any hair mesh you mean even Hair.nif. Any nif that is for the hair slot in the game right?

And what about mesh NIF files that have EGM, do BOTH the myfile.nif AND myfile.EGM need to be removed from the Pyffi process or JUST the myfile.EGM?

LOD are ok then? Cool!


You are correct on the first one.

For #2, PyFFI doesn't do anything with the .EGMs, but it cannot optimize any meshes that have an associated .EGM, so in essence, both must be removed from the optimization process.

LOD meshes are just reduced quality meshes with all uneeded data (Specular, Vertex coloring, etc.) stripped from them, other than that they behave exactly as you would expect a run-of-the-mill mesh would as far as PyFFI is concerned. But as was stated, you can tell PyFFI to create or further optimize VWD meshes if you want.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Tue May 03, 2011 10:16 am

A clarification requested for the batch files suggeted here by Arthmoor and Vorians.

I have used the context menu option right-click->"Optimize with Pyffi" in the past. How do I run these batch files posted (I know that I have to double-click on them), but where are they supposed to be placed? In the Oblivion folder? Or it does not matter?

Do the batch files optimize the extracted Oblivion - Meshes.bsa, or just files that are in the Oblivion/Data/Meshes folder?
User avatar
TWITTER.COM
 
Posts: 3355
Joined: Tue Nov 27, 2007 3:15 pm

Post » Tue May 03, 2011 12:14 am

Here's a question for those much more knowledgeable about PyFFI than I...
I recently just finished running every single mesh (except hair, helm, hood, and other excluded items) through the latest PyFFI/Python combination. I have since noticed a few graphical oddities, but am unsure whether they are related.

(1) A rock in a cave I visited recently (Grayrock Cave I think), was exhibiting some strange graphical glitches. The textures themselves appeared to be flickering, much like what appears when you have two meshes in the exact same position.
(2) Water now has a noticeable tiled surface effect. That is, an entire "tile" of water is evenly shaded.
(3) When approaching a light source from a distance, the light will suddenly "turn off" instead of slowly dimming as I approach. For example, a stationary city lamppost will have roughly the same brightness until I get within 100 or so units of it, and then it will not provide any ambient light at all (though the flame is still present).
(4) Torches in caves, etc. will light distant rocks unevenly. For example, half of a flat-faced rock will be fully lit, while the other half won't be lit at all.

Any idea what might be going on? I have a tough time believing PyFFI is responsible for all of this. After all, most of it seems related to shaders, not meshes. But I haven't touched the shaders in ages. At roughly the same time, I upgraded to the latest Nvidia drivers and also turned on Ambient Occlusion and Anisotropic Filtering. I suppose I should try rolling those back and see if it helps...
User avatar
Melly Angelic
 
Posts: 3461
Joined: Wed Aug 15, 2007 7:58 am

Post » Mon May 02, 2011 10:53 pm

A clarification requested for the batch files suggeted here by Arthmoor and Vorians.

I have used the context menu option right-click->"Optimize with Pyffi" in the past. How do I run these batch files posted (I know that I have to double-click on them), but where are they supposed to be placed? In the Oblivion folder? Or it does not matter?

Do the batch files optimize the extracted Oblivion - Meshes.bsa, or just files that are in the Oblivion/Data/Meshes folder?


When you unpack your meshes to optimize, copy the batch files to that folder and double click them from there. My files are intended to be used from whatever folder they're sitting in. So some caution is probably warranted that you don't want to execute them from the wrong place.

Any idea what might be going on? I have a tough time believing PyFFI is responsible for all of this. After all, most of it seems related to shaders, not meshes. But I haven't touched the shaders in ages. At roughly the same time, I upgraded to the latest Nvidia drivers and also turned on Ambient Occlusion and Anisotropic Filtering. I suppose I should try rolling those back and see if it helps...


All of that sounds like the Ambient Occlusion is messing things up. Oblivion does not support it, and I've never seen anyone have good things to say about forcing it to try via the nVidia drivers. Anisotropic Filtering shouldn't be an issue. I run that at maximum, and the last time I had an nVidia card it worked fine.
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Tue May 03, 2011 3:38 am

Anisotropic Filtering shouldn't be an issue. I run that at maximum, and the last time I had an nVidia card it worked fine.

I would second that. I run with 16x AF set to "High Quality" on my Nvidia card (GTX260) and pretty new drivers 263.14 (I believe), and these AF settings still work fine today. Just saying... :)
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Tue May 03, 2011 3:32 am

@amorilla: Would it be practical/feasible to automatically run clean_far_nifs (after the regular optimize spell) when choosing the "Right-click -> Run PyFFI" option via the ini?
User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm

Post » Mon May 02, 2011 7:58 pm

Sorry if I'm not following everything here - just to wrap up potential improvements for the next release:

  • include Arthmoors improved skip list (I kind of hope that it would be possible to merge the two ini files into one... but probably not before I switch to Python 3 and argparse)?
  • look into possibly integrating clean_far_nif into the optimize spell?
  • add batch files to run the optimizer spells, and make the shell integration optional
  • integrate jonwd7's patcher? (actually pyffi has a patching spell directly, although I guess this is most likely not well known!!)


Any other low hanging fruit I missed?
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Tue May 03, 2011 3:21 am

Sorry if I'm not following everything here - just to wrap up potential improvements for the next release:

  • include Arthmoors improved skip list (I kind of hope that it would be possible to merge the two ini files into one... but probably not before I switch to Python 3 and argparse)?
  • look into possibly integrating clean_far_nif into the optimize spell?
  • add batch files to run the optimizer spells, and make the shell integration optional
  • integrate jonwd7's patcher? (actually pyffi has a patching spell directly, although I guess this is most likely not well known!!)


Any other low hanging fruit I missed?

Optional shell integration is much appreciated. :)

If you want to integrate patching in some way, that sounds good to me. I don't know if my batch file is anything special. The old version by didn't work on anything but XP, and I still haven't gotten around to testing my batch file in XP Mode in Virtual PC. The thing is that I'm finding some people with GOTY version say their BSA differs, some say their BSA is the exact same. So I don't know who is right. I had somebody verify for me that their GOTY BSA had the exact same MD5/SHA-1 checksums as my original release BSA. The script also still relies on Forfiles.exe which not all Windows versions have, apparently. What this means is extracting the BSA and patching the files and recreating the BSA instead of PyFFI-ing is currently about as hard to get the head around as PyFFI-ing itself, for novice users. The only current benefits to patching is time.

I was possibly going to do a more robust EXE file... A commenter had some good ideas like BSA extraction/creation automation with BSA commander, which would help people with patching the vanilla BSAs, and I could verify checksums and what not even.

Of course, that all deals with just the vanilla meshes... Most PyFFI-ing doesn't take nearly as long, so what exactly is the need for patching in PyFFI? I'm not against it, just curious. :)

I could see it working in the In/Out environment. An additional Patches folder which generates the Patches after PyFFI has finished running (although the two-part INI process kind of mucks that up). The optimize-in-place PyFFI-ing seems more tricky. Of course the In/Out/Patches environment is identical to the way the patcher is currently set up, which is why it'd work well there.
User avatar
Alkira rose Nankivell
 
Posts: 3417
Joined: Tue Feb 27, 2007 10:56 pm

Post » Tue May 03, 2011 6:24 am

include Arthmoors improved skip list (I kind of hope that it would be possible to merge the two ini files into one... but probably not before I switch to Python 3 and argparse)?


Just remember to credit H2DOK instead since they're his improved skip lists, not mine :)
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Mon May 02, 2011 6:10 pm

Any idea what might be going on? I have a tough time believing PyFFI is responsible for all of this. After all, most of it seems related to shaders, not meshes. But I haven't touched the shaders in ages. At roughly the same time, I upgraded to the latest Nvidia drivers and also turned on Ambient Occlusion and Anisotropic Filtering. I suppose I should try rolling those back and see if it helps...


I would also make a backup of your Oblivion.ini file and try running with a default .ini file to see if the issue persists. Reason for this... I recently started using Deadly Reflex 6 and one of the suggested .ini tweaks for 1st person view to work properly was to edit fNearDistance=0.0000

Doing this caused all sorts of shader weirdness. Grass and distant LOD textures started to move rapidly as if the timescale was set to 1000.

Point being, any minor changes to the .ini can cause all sorts of weirdness.
User avatar
Laura Ellaby
 
Posts: 3355
Joined: Sun Jul 02, 2006 9:59 am

Post » Mon May 02, 2011 9:25 pm

All of that sounds like the Ambient Occlusion is messing things up. Oblivion does not support it, and I've never seen anyone have good things to say about forcing it to try via the nVidia drivers. Anisotropic Filtering shouldn't be an issue. I run that at maximum, and the last time I had an nVidia card it worked fine.


Yep, it was the Ambient Occlusion all right. Thanks! When I forced AO off, most of the described symptoms disappeared. My FPS dramatically increased to boot. I still need to check on that flickering rock and tiled water however.
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Tue May 03, 2011 5:11 am

Tiled water sounds similar to something that cropped up when I switched to using ATI cards. Make sure you aren't messing with the uNumDepthGrids value in your ini. It should remain set at 3 or you'll get anomalies with the water.
User avatar
xxLindsAffec
 
Posts: 3604
Joined: Sun Jan 14, 2007 10:39 pm

Post » Mon May 02, 2011 10:13 pm

Alright, after reading through all the posts, I want to make sure I'm doing this right.

I've unpacked the Oblivion Meshes.BSA, using OBMM, into the toaster/in folder. Do I have to go through and delete all the files below, before I run the optimization:

- Any hair mesh
-Roothavok meshes
-Any mesh with a .EGM association (commonly helmets)
-Any mesh with a .TRI association (teeth, eyes, etc.)
User avatar
Chloe Lou
 
Posts: 3476
Joined: Sat Nov 04, 2006 2:08 am

Post » Mon May 02, 2011 10:53 pm

Don't delete them, PyFFI comes with a skip list that automatically skips them in the optimization process. Just unpack the meshes BSA to the in folder, select run PyFFI on the oblivion_optimize.INI, go get a sandwich, and when PyFFI is finished, place the contents of the out folder back into the in folder, overwriting as necessary, and repack the BSA.
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

PreviousNext

Return to IV - Oblivion