Jump to content

Use of "Clear Affected Cells For PreCombine Data" to make scrapable objects in workshop


danielmzbr

Recommended Posts

Hey there, short-version of the problem/question upfront:

 

I'm trying to create a mod that allows me to scrap a few selected objects (mostly bushes and shrubs) while in workshop mode, among other things. The problem is it only worked in-game after I used the "Clear Affected Cells For PreCombine Data" option on each static object that I included in the list. Am I good to go or it will mess performance/gameplay?

 

Detailed version:

 

I've watched a few tutorials about making objects "scrapabble" in the workshop and decided to give it a try. This is how I done it (I'm using only Bethesda.net Creation Kit + Steam to launch the game and test the mod)

 

1 - Created a FormList with the ID "workshopScrapRecipe_ScrapFoliage"

 

2 - Added some objects to it by dragging them from the World Objects list (all of them are the statics, no REFRs)

 

3 - Created a Constructible Object with the ID "workshop_co_ScrapFoliage"

 

4 - In the Constructible Object window, I added the keyword "WorkshopRecipeFilterScrap" and set "workshopScrapRecipe_ScrapFoliage" as the Created Object.

 

5 - Added c_Wood_scrap as its component (by draging it directly from the item list and setting the quantity).

 

6 - Saved the file, launched Fallout 4 on Steam, enabled the mod via in-game menu and.... nada. Nothing.

 

It simply wouldn't work. I followed the tutorials to the letter before doing what I described above, and tried it many times, with different objects, slighly different ID/names (like "workshopscrapreciper_scrap_scrapX", for example) but it just didn't work.

 

So I read about the "Clear Affected Cells For PreCombine Data" option and decided to use it (you just have to right click the object in the main list, find the option and click it). I used it on every object that I had previously added to the FormList, saved the file again and launched the game. This time it worked. Don't ask me why, but just like that I can now scrap the selected brushes and shrubs in my settlement via workshop mode.

 

I'd be happy with the result but I read somewhere that tinkering with precombine stuff (and visibility overall) may lead to seriously bad issues, both on performance and gameplay. So I would like to ask for some help here. Should I proceed the way it is, if it worked for me? Did I do something wrong along the way (before "Clear Affected Cells...")? Is there any other way to do it?

 

Well, any thoughts are really apreciated, hope this also helps other people who have simillar issues.

 

Thanks a lot!

 

Link to comment
Share on other sites

Your problem was precombined meshes, which combine nearby objects so the parts that intersect don't get rendered (saving on performance). The problem is, you can't scrap precombined meshes, so if you want that stuff to be scrappable you have to disable those precombined meshes.

 

As far as performance/gameplay, the main problem comes from using ini edits to disable precombined meshes/previs globally. Doing it the way you are is fine, and is unlikely to cause any performance issues.

Link to comment
Share on other sites

Your problem was precombined meshes, which combine nearby objects so the parts that intersect don't get rendered (saving on performance). The problem is, you can't scrap precombined meshes, so if you want that stuff to be scrappable you have to disable those precombined meshes.

 

As far as performance/gameplay, the main problem comes from using ini edits to disable precombined meshes/previs globally. Doing it the way you are is fine, and is unlikely to cause any performance issues.

 

That's good to know, thank you, sir.

 

I feared that using the "Clear Affected Cells For PreCombine Data" option would also mess with performance, although not globally as using the .ini file command. There are bushes and shrubs everywhere after all, and the majority of the world's cells seemed to be "affected" in-editor (though I don't know exactly how). One quick extra question:

 

How exactly does "Clear Affected Cells For PreCombine Data" work?

 

For future reference, this is what the Creation Kit's Precombine Options page have to say about that option:

 

"Replacing NIFs
When a NIF is changed out from under an existing reference, that reference doesn't know it was changed, so precombination isn't disabled. Poking that reference, or any other combined reference in the cell, to get it into the plugin will disable precombined data though, and when the game tries to load the actual 3D for the reference, the game finds the new model and loads that model correctly. For similar changes to base objects, there is a Clear Affected Cells For PreCombine Data option in the Object Window right-click menu that should wipe the combined data from any cell containing that base object."

And these are the .ini file lines that were mentioned:

 

[General]

bUseCombinedObjects=0

bPreCulledObjectsEnabled=0

 

I'll keep working on the mod, again thanks a lot!

Link to comment
Share on other sites

You could populate your cell (workshop) with duplicate bushes, so you would only affect the things touched by your mod.

 

Thanks so much for this by the way - I had the same question a week or so ago, and you found the answer! :smile: :smile:

 

Glad to know this helped you too.

 

If you find any issues (be it about performance, gameplay, compability, etc), or find anything noteworthy while using "Clear Affected Cells For Precombine Data" to enable scrap, please post it here, if possible. I'll do it as well. For now, it seems like it's working with no problems, and as VlitS said on #2, it shouldn't cause any performance issues.

 

Quick question remais, just so ourselves and future readers can understand it better:

 

How exactly does "Clear Affected Cells For PreCombine Data" work?

 

Last but not least, I forgot to link the tutorials I mentioned. Here they go, for reference:

 

Fallout 4 Creation Kit Tutorial (part 9) (Adding items to scrap list) by FelloutIsLife

 

Making an item scrap-able in game from creation kit answer by WallaceMacDuich

 

Fallout 4 Creation Kit Tutorial - How to make scrapable objects #1 by Ray

Link to comment
Share on other sites

I would recommend using FO4Edit to remove any cell edits for cells you don't care about (didn't realize it applied it globally to all instances of that base record). If it does what I would guess (just edits the cells to selectively disable any precombined objects that contain that record), it should still have a fairly negligible impact on performance, but it's a bit messy to edit a few dozen cells when you mean to edit one. If it disables precombineds completely for any cell that contains that records (unlikely, but definitely possible knowing Bethesda), you definitely want to clear out any extraneous edits.

Alternatively, if you are trying to make everything in a given cell scrappable/removable, I'd recommend using FO4Edit to just disable precombineds and previs for that cell. Scrap Everything is a good example of how to do it, just look at the edits made to the Worldspace cells to see what's needed.

Really, I've found it's a good idea in general to use xEdit to look at any mod you make that messes with cells, as the CK is notorious for making dirty edits/references, particularly with regards to cells and placed objects.

Link to comment
Share on other sites

I would recommend using FO4Edit to remove any cell edits for cells you don't care about (didn't realize it applied it globally to all instances of that base record). If it does what I would guess (just edits the cells to selectively disable any precombined objects that contain that record), it should still have a fairly negligible impact on performance, but it's a bit messy to edit a few dozen cells when you mean to edit one. If it disables precombineds completely for any cell that contains that records (unlikely, but definitely possible knowing Bethesda), you definitely want to clear out any extraneous edits.

 

Alternatively, if you are trying to make everything in a given cell scrappable/removable, I'd recommend using FO4Edit to just disable precombineds and previs for that cell. url=http://www.nexusmods.com/fallout4/mods/5320/?]Scrap Everything[/url] is a good example of how to do it, just look at the edits made to the Worldspace cells to see what's needed.

 

Really, I've found it's a good idea in general to use xEdit to look at any mod you make that messes with cells, as the CK is notorious for making dirty edits/references, particularly with regards to cells and placed objects.

 

Sounds like a good call and I'll certainly give it a try.

 

If all I need to enable scrapping* is clearing precombine data on specific cells (settlement cells in this case, the ones where I'll actually scrap stuff), then clearing it for so many other cells is really overkill. And I bet 99% of the worldspace's cells uses the items I'm making scrapable by using "Clear Affected Cells For PreCombine Data" on them. I didn't notice any major performance hit or bug so far, and I tested it with Unofficial Fallout 4 Patch on. But as you said, it's messy to say the least, and I'd like to make it as clean as possible.

 

Anyway, I'll report back with any new findings. Only thing I'm still not 100% sure is how "Clear Affected Cells For PreCombine Data" works. Does it literally wipe all the PreCombine data from cells containing the object I used it on? Or does it just rules that specific object out of the PreCombine generation? I noticed that in my game folder, in Data > Meshes > PreCombined, there are 79 visible .NIF files all marked as modified today, at the time I last tested it. Any thoughts on this?

 

Thanks again!

 

*In addition to setting up a respective constructible object, formlist, etc.

Link to comment
Share on other sites

 

If all I need to enable scrapping* is clearing precombine data on specific cells [...]

 

Anyway, I'll report back with any new findings. Only thing I'm still not 100% sure is how "Clear Affected Cells For PreCombine Data" works. Does it literally wipe all the PreCombine data from cells containing the object I used it on? Or does it just rules that specific object out of the PreCombine generation? I noticed that in my game folder, in Data > Meshes > PreCombined, there are 79 visible .NIF files all marked as modified today, at the time I last tested it. Any thoughts on this?

 

Thanks again!

 

*In addition to setting up a respective constructible object, formlist, etc.

 

You also have to disable previs, or scrapping certain objects will cause the occlusion bug (disappearing objects depending on where you are standing), but Scrap Everything does that as well so looking at it will tell you how to do so.

 

No idea how that feature works though, and don't really have time to test it right now. I can say that precombined meshes have the cell id as the first part, so if they have a bunch of different initial parts*, it's editing the precombined meshes for a bunch of cells.

 

*as an example, for 00000FEC_2B9A2464_OC.NIF, the 00000FEC part is the cell name.

Link to comment
Share on other sites

Using Scrap Everything to compare results and reading more about the subject, I did a lot of testing and here's what I got.

 

First, "Clear Affected Cells For PreCombine Data" seems to work just as it states: it literally wipes all precombined meshes and visibility data from every cell containing a reference of the object you used it on. So when you right-click a given object in Creation Kit and use this option, then you look for the affected cells' data in FO4Edit, you get the following changes (in my tests, I used it on TreeSapling04, a static):

 

- All values for "VISI - PreVis Files Timestamp", "RVIS - In PreVis File Of" and "PCMB - PreCombined Files Timestamp" are removed. (image 1)

 

- All combined meshes for "XCRI - Combined References" and each and every reference are removed, regardless if they were related to the object you used it on or not. (image 2)

- Physics data is not removed, as long as the object doesn't involve them. If you use it on an object which is not a simple static, it'll probably remove this too.

 

- The Data Size value of the affected cell is reduced.

 

Doing so does allows you to scrap objects as long as you set up their respective Constructible Object and FormList in the Creation Kit (here's what I did for TreeSapling04) but at the cost of wiping precombined and visibility data from all cells containg it, even ones where you won't be doing any scrapping at all. In my case, using the option on TreeSapling04 was enough to obliterate precombined meshes and visibility data of over 250 cells across the Commonwealth. That's a lot of "deoptimized" cells and that's for a single object; imagine when you start adding more stuff to your scrap list. In short: "Clear Affected Cells For PreCombine Data" does get the job done, but goes way beyond what you really need to enable scrapping on vanilla settlements.

 

To minimize precombined and visibility data removal, you can go with the Scrap Everything approach. You remove data only from the cells that really involve scrapping, and you do it directly on FO4Edit. It's more work because you'll need to identify the exact cells and do it "by hand", but worth it as it is expected to cause less impact on performance. Gameplay-wise, I can't say if it has any negative effects, but I can say FO4Edit showed me no critical conflicts while doing it. And finally, I can't predict how it affects mod compatibility since I'm really new to all of this, but from what I've read, it potentially does. Take this all into account when you're trying to create your own "scrap list".

 

I ended up with a customized version of what Scrap Everything does, which is nice and pretty much sums it up for me. Doing anything other than that is beyond my knowledge at the moment. Anyway, thanks a ton, VlitS, for your input (the cell naming tip helped me a lot to understand the whole thing in FO4Edit). I hope this helps other people as well, so I'll leave some additional reads about the subject.

 

- Edits to *ANY* Cell Records Can Block Mesh Overrides

 

- Precombined References

 

- [Fo4]What is the progress on the Pre-combined mesh issue created by editing a cell?

 

Additional thoughts or findings are always appreciated, and I'll probably report back if I have any new info. Best regards.

Link to comment
Share on other sites

Really, the only conflict you'll have are with mods loading after it, overwriting the edits you made to the cell record. I don't know of any mod that actively relies on previs/precombined meshes, so as long as your mod goes at the end, it'll actually act as a compatibility patch if you have multiple mods touching the same cell.

 

The only other mod I have ever seen that actually relies on edits to the cell record itself was a Fog removal mod, and I think that was primarily interiors*.

 

*It's best to remake previs/precombineds to exclude the items you want scrappable for preexisting interior cells, as just disabling them will reveal the mess Bethesda covered up with previs (and just disabling precombineds will result in occlusion bugs). Alternatively, you could try and fix the roombounds and portals for said cell, and just warn people not to scrap the outer walls lest they peer into the void. They should just not scrap walls in general, as even properly made roombounds/portals will cause the occlusion bug if you scrap the walls you used as guides for placing them. If a cell is small enough, they might not be needed, in which case people could freely mess with any non-exterior walls without worry.

 

Feel free to ignore the bits about roombounds/portals unless you plan on messing with interior cells, they aren't used in exterior (Worldspace) cells so you don't need to learn about them (I just know the basics myself). Hell, most of the Bethesda devs never learned how to use them right, judging by the mess revealed by disabling previs in an interior cell :tongue:.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...