Jump to content

Remove Precombined Objects + Regenerate PreVis?


FiftyTifty

Recommended Posts

Alrighty lads, kinda in a bind here.

 

I'm turning the Federal Ration Stockpile interior into an interior workshop, but the damn precombined objects system is getting in the way.

 

If I "toggle" precombined objects by editing a vanilla one, great, I can scrap away 'n' all that. However, the workshop objects bug out by becoming invisible, due to the PreVis system throwing a fit with the lack of precombined geometry.

 

I then generated the PreVis, which created a new .uvd file. Nae difference; the workshop objects are still invisible.

 

So what do? I could tick the No PreVis checkbox in the cell window, but that's a no-no. We're not running Vulkan 'ere. Also, Sanctuary Hills doesn't have that checkbox enabled, yet it has precombined objects, previs as well as scrappable objects.

 

How the bloomin' heck do we replicate that for other pre-existing cels?

Link to comment
Share on other sites

Bloody hell, the solution was under my nose the whole time. You just have to regenerate the precombination data, and then regenerate the previs. Do this AFTER having made all the changes to the interior cell 'n' s#*!; it's the last step of yer mod, basically.

 

1. [Optional] Place a new, custom static into the cell. This step is optional if you've already got a unique object in the cell.

2. In the Object Window, right-click the base object for the custom static.

3. Select "Clear Affected Cells for PreCombine Data".

4. Save your mod.

5. Ensure that the interior is loaded in the render window.

6. Click the "World" tab at the top of the window.

7. Select "PreCombine Geometry for Current Cell".

8. Wait for the Creation Kit to finish.

9. Save your mod.

10. Click the "Visibility" tab.

11. Select "Generate PreCombined Visibility for Current Cell".

12. Wait for the Creation Kit to Finish.

13. Save your mod.

14. ~fin~

 

 

Honestly, my hat's off to Bethesda. When I thought that they couldn't have any more convoluted game systems, they somehow manage to one up themselves yet again.

 

I should write a book on all the caveats in getting these workshops to work. It's ruddy insane.

Link to comment
Share on other sites

The problem with interior cells is that, once previs is turned off, it re-enables room bounds and portals, which are an absolute mess in FO4 (from what I heard, the person who created the system left after FO3, and no one else knows how to do it right). Rather than putting in any actual work to fix it, they just slapped the previs on top and decided that was enough. So while you can get away with disabling previs in an exterior cell, doing so in an interior one will lead to the issues you were seeing. The precombined mesh stuff isn't actually the problem at all. It is good to have though, since it lets you prevent people from scrapping the walls of the interior cell and falling into the void.

 

I'm just glad they actually fixed previs/precombined mesh generation in the CK, for a while it didn't even work.

Link to comment
Share on other sites

The thing is, previs won't work unless you generate precombined geometry, and then generate the previs. Doing so without the static batching will make most of the cell invisible at all times.

 

It's just bad. The proper way to handle static batching 'n' culling, aside from using a robust real-time batching system, would be to generate the precombined geometry and previs data whenever the game is launched, after it has been modded. Check all mods for any changed previs/precombined timestamps, then process the files for a couple minutes if any are found.

 

But no, Bethesda decided to be dumb about it. Pah.

Link to comment
Share on other sites

  • 1 year later...

Thank you for this. I have this problem in a mod right now as well. I hope this guide works.

 

Is it possible to decide which statics actually make it into the previs, and which not? It seems that the previs stuff explodes and makes stuff invisible only after I scrap certain statics.

Link to comment
Share on other sites

  • 1 year later...

After actually having regenerated precombined geometry/visibility, I have some things to add:

  • After generated precombined geometry, you must run both "Generate Visibility" AND "Generate PreCombined Visibility", in that order. Sometimes it seems to work without the "not precombined" visibility, but without, sometimes objects become invisible.

    I had that issue when regenerating them for my Fairline Hills Settlement. It affected a (scrappable) shelf, and a mailbox (container). Maybe more, hard to tell if it's invisible. Only doing it as described above fixed it.
  • A static object reference will be excluded from precombines if:Navmesh precuts don't seem to matter.
    • The base object has a scrap recipe. Regular recipes most certainly count, too. If the "created object" of a scrap recipe is a formlist with the object in it, that counts, too.
    • The reference has an enableparent. Probably also if it is an enableparent.
    • The reference is scrap-linked to something else, that is, linked using WorkshopStackedParentKEYWORD to something else, or has objects linking to it like this.
    • Probably also if the reference is linked using any other or no keyword.
    • NOT if the reference has a navmesh precut. These don't seem to be enough.
  • Precombining geometry disregards matswaps. No matter if the matswap is on the reference or the base object, if there is one, it won't make it into the precombines.
    The only way to make it works seems to actually create new NIFs which use the correct material, and replace the base object in the references. After that, this can be undone.

    I made an xEdit script to automate this process, but it isn't quite ready to be released yet.

 

What I'd still like to know is:

  • Can the LoD be regenerated?
  • Can this whole thing be done via CLI parameters? The CK seems to accept some CLI parameters, for animations and such, but, does it have that for precombined geometry/previs?
Link to comment
Share on other sites

 

After actually having regenerated precombined geometry/visibility, I have some things to add:

  • After generated precombined geometry, you must run both "Generate Visibility" AND "Generate PreCombined Visibility", in that order. Sometimes it seems to work without the "not precombined" visibility, but without, sometimes objects become invisible.

     

    I had that issue when regenerating them for my Fairline Hills Settlement. It affected a (scrappable) shelf, and a mailbox (container). Maybe more, hard to tell if it's invisible. Only doing it as described above fixed it.

  • A static object reference will be excluded from precombines if:Navmesh precuts don't seem to matter.
    • The base object has a scrap recipe. Regular recipes most certainly count, too. If the "created object" of a scrap recipe is a formlist with the object in it, that counts, too.
    • The reference has an enableparent. Probably also if it is an enableparent.
    • The reference is scrap-linked to something else, that is, linked using WorkshopStackedParentKEYWORD to something else, or has objects linking to it like this.
    • Probably also if the reference is linked using any other or no keyword.
    • NOT if the reference has a navmesh precut. These don't seem to be enough.
  • Precombining geometry disregards matswaps. No matter if the matswap is on the reference or the base object, if there is one, it won't make it into the precombines.

    The only way to make it works seems to actually create new NIFs which use the correct material, and replace the base object in the references. After that, this can be undone.

     

    I made an xEdit script to automate this process, but it isn't quite ready to be released yet.

 

What I'd still like to know is:

  • Can the LoD be regenerated?
  • Can this whole thing be done via CLI parameters? The CK seems to accept some CLI parameters, for animations and such, but, does it have that for precombined geometry/previs?

 

You made a XEdit script that does all of that or just that material swap thing?

 

If you mada a XEdit script that does the whole precombined geometry and visibility thing, that would be great, because whenever i try to do that, the CK works for a bit and then just crashes to desktop.

Link to comment
Share on other sites

 

After actually having regenerated precombined geometry/visibility, I have some things to add:

  • Precombining geometry disregards matswaps. No matter if the matswap is on the reference or the base object, if there is one, it won't make it into the precombines.

    The only way to make it works seems to actually create new NIFs which use the correct material, and replace the base object in the references. After that, this can be undone.

     

    I made an xEdit script to automate this process, but it isn't quite ready to be released yet.

 

What I'd still like to know is:

  • Can the LoD be regenerated?
  • Can this whole thing be done via CLI parameters? The CK seems to accept some CLI parameters, for animations and such, but, does it have that for precombined geometry/previs?

 

Another thing that results in a mesh being excluded is if it is an animated static.

 

And for material swaps, yeah, making new base objects is probably the easiest way. You could, if you wanted to, directly edit the precombined .nif files that get generated, and change the listed material under the BSLightingShaderProperty. Only problem is nifskope won't actually display the meshes, so it takes a bit of getting used to when it comes to figuring out what to edit (particularly if one of the meshes that was combined into the mesh uses the same material you were rpelacing with the MSWP, and you wanted to keep it using that material while changing it for another part. Another thing that might help is the Precombined editor zilav made for me, as it makes it a bit easier to see which REFRs go with which .nif.

 

And along those lines, I know that it is possible to make an xEdit script that changes things in .nif files, so it may be possible to make one to swap the material files (i.e. input the material file path\name you want replaced, and what you want to replace it with). Though again, you would have issues if the same material was used in multiple places and you only want to change it in some. So new statics is probably easiest.

 

For your questions:

1) You should be able to regenerate LOD in the CK, but it isn't something I have messed with so I don't know what is involved. I have also heard that LOD gets baked into a save file, so the new LOD might only work on a new save (not sure on that one).

2) There are commandline parameters for generating precombined and previs, yes. However, last I heard there is a single integer that needs to be changed in the CreationKit.exe for those parameters to work (no idea which integer), and I could never get it to actually work myself*. One advantage to commandline-generated files is that they use shared-geometry precombineds, same as Bethesda-generated precombineds. Those tend to be 5-10 times smaller than normal CK-generated precombineds, which is a nice bonus.

 

edit: In case they fixed it with the recent CK updates (last time I tried to use this was several CK versions ago), here are the commandline parameters to use:

-GeneratePreCombined:<plugin> clean all

-GeneratePreVisData:<plugin> (this apparently works without fixing the .exe file)

-CompressPSG:<plugin>

-BuildCDX:<plugin>

 

For GeneratePreCombined and GeneratePreVisData, you have to have the plugin flagged as an ESM, because they generate CombinedObjects.esp and Previs.esp with the respective data changes you would see from generating them in the CK normally, and if the plugin is not already flagged as ESM it will rip out the plugin as a master, resulting in a bunch of "could not be resolved" record errors.

 

As I said above, I couldn't get it to work myself, no idea why, but the person who was helping me had no issues.

 

 

 

Someone was working on a tool to automatically generate previs/precombineds for your whole load order, but they kept having random CtDs when they tested the generated files.

 

*though the person I learned about them from was able to, mine always just gave me an empty plugin (created as part of the process) and no .nif/.uvd files.

 

 

 

You made a XEdit script that does all of that or just that material swap thing?

 

 

 

If you mada a XEdit script that does the whole precombined geometry and visibility thing, that would be great, because whenever i try to do that, the CK works for a bit and then just crashes to desktop.

 

 

Pretty sure the script is just for generating new base objects and replacing the record in the the REFRs with MSWPs. xEdit is incapable of generating previs/precombineds, and it is EXTREMELY unlikely that that will ever change.

 

How much RAM do you have free for the CK to use? I have never had any issues with the CK crashing while generating previs/precombineds. That said, I have only done it for interior cells (albeit pretty large ones: Vault 88 and The Mechanist's Lair), so if you are trying to generate for large groups of cells you might have more issues. At the very least, I would recommend 32 GB of RAM with at least 64GB virtual memory if you want to do 3x3 Cell chunks of precombineds (less might work, but in any case the CK is gonna take a lot of memory).

Link to comment
Share on other sites

Went back over the conversation with the person who told me about the fixed value and found that he had given me the info needed to find the integer that needs to be changed.

If you want to try applying the fix to the CK so commandline precombined generation works, you need to open CreationKit.exe with a hex editor, search for the hex values:

2b 02 B9 01 00 00 00

and

74 11 B9 01 00 00 00

and replace the 01 with a 00, so they look like this:

2b 02 B9 00 00 00 00

and

74 11 B9 00 00 00 00

Edit: I got some help from someone else on what to search for, it is two bytes that need to be changed, and the updated groups of bytes will work for both the older CKs and the newest (1.10.162.0). I would recommend making a backup of CreationKit.exe before editing it just in case.

*If using HxD (what I used), make sure you change the search parameters to Hex Values, default datatype is Text-String, which won't find it.

Link to comment
Share on other sites

×
×
  • Create New...