Jump to content

Modding Case Study: Sexy Bandit Captives (Part 2 - Navmesh Repair)


Hi folks, and welcome back. If you're in a hot part of the world right now, I hope you're keeping cool and comfortable - make sure you hydrate! In the previous entry in this series we walked through the initial cleaning and evaluation of Sexy Bandit Captives 0.98g. While the primary cleaning experience went mostly smoothly, this mod had a lot of deleted navmesh and also had many red flags relating to the structure of its scripts. You may recall that I also got a little heated about the particularly pointed examples of Parlor School modding in play here. Not only are all the scripts closed source (which makes troubleshooting the many papyrus errors a lot more difficult), but the mod goes so far as to inject a very intrusive EULA window on a new game - a move that brought to mind recollections of some of Giskard's later work. 

 

As you know if you followed the comments thread for that post, but the time I was done with that first session, I was starting to hold serious misgivings about the mod. Not because it was a bad mod - everything I've seen of it shows that it's a high quality production, just like its earlier edition was. Instead, my concern is that the way this mod is structured may make it functionally impossible to cleanly integrate into a large load order. Today we're going to talk about how to repair the navmesh defects in the plugin, and in the third and probably final volume that will follow, we'll talk about some of the technical challenges that this mod poses. At that point, its likely I'll have no choice but to put this one back on hold until the author is done working on it, since decompiling scripts to fix them is a very time consuming process and I'll definitely have to do that in order to get it working right. Actually, see the conclusion at the end of this article. 

 

Since I did my initial review, it has come to my attention that a hotfix patch (0.98 patch 3) has been released, and its this version that we'll be using today. The patch only contains script updates, so it won't impact any of the "above the fold" cleaning work that volume 1 touched on.

 

Why Does Navmesh Get Deleted

Spoiler

In my experience, authors almost never deliberately delete a navmesh, unless they've completely reworked a cell from scratch - and that's fairly rare. Instead, what I see is one of two things:

 

  1. The author makes edits to an existing navmesh in the CK. When they finalize the navmesh, the CK deletes the original navmesh and saves the edits as a completely new mesh.
  2. The author makes edits to an existing navmesh in the CK. When they finalize the navmesh, the CK merges the mesh with a nearby vanilla mesh and deletes the original.
  3. Both - the CK merges two adjacent meshes and deletes both originals.

 

In theory, within an isolated case of just the mod itself and the vanilla masters, a deleted navmesh shouldn't cause major problems. However, the more complex the setup becomes, the more likely it is that the deletion will wipe out changes to the original mesh made by other mods. In the case of highly modded areas, this can happen very fast. Additionally, the removal and replacement of the old mesh will result in edge link changes to adjacent navmeshes, creating pseudo-ITM records that can also wipe out changes from other mods. This can quickly escalate from a nuissance situation involving NPCs taking "the long way around" or refusing to move into a crash-to-desktop situation if, for example, door links reference a deleted navmesh or pathfinding ends up relying on a deleted mesh. 

 

Long story short, deleted navmesh getting into a mod isn't the author's fault. It is however a deficiency if the author doesn't fix it before releasing the mod to the public. This kind of issue is a major defect that we need to fix when integrating the mod into a complex load order.

 

Let's Look At The Deletions

Spoiler

Here's our 15 deleted navmeshes in the plugin, listed in the xEdit cleaning report:

 

image.png.6c64381982c0f6b783da2911e0d413e1.png

 

To assess each mesh, we'll start by holding down the control key and double-clicking on the navmesh form ID within this report. That will take us to the navmesh record.

 

image.png.53e80ea9bcbfa6f695427ecbe0c87c8f.png

 

Next, we'll control-left click on the SexyBanditCaptives.esp column header on the left. This will switch the SBC instance of the form ID, which should reveal the new SBC navmesh on the left.

 

image.png.7a2f493a3f72f4b4f5dfa88213f309b0.png

 

Well, that's interesting. If you recall from above, we should be seeing an SBC form ID navmesh here. This might in fact be a genuine player-initiated navmesh deletion... but before we jump to that rather disappointing conclusion, let's examine this further and see what's going on. The original has a single edge link to another mesh, so maybe that'll reveal a replacement mesh. Keep in mind the vertices we see above - if we see the same vertices on a linked mesh to that other ref, then we might have found a rather odd example of a Type 2 navmesh deletion. 

 

image.png.1e761f100b124855d0666758d36832fe.png

 

Hmmm. That's concerning. It looks like this other mesh - F0673 - contains no edge links... they're all deleted in the override.

 

image.png.be4235f98354744d7c24683d6f3f8b3b.png

 

Something funky is going on here. We better open this up in the CK and take a look within the GUI. By the way, this is a great case of a situation where you must use the CK if you want good results. There are many other functions where tools like xEdit or external script compilers or whatever do the job better, but positioning objects in 3D and working with landscape and navmesh are all CK activities, for better or for worse.

 

image.png.99efc59a114943ef20a5a706643d6ac5.png

 

The green shaded area that I circled in yellow is the deleted navmesh. I don't see any reason for this deletion so when we get back we'll just undelete it entirely. But what about that adjoining mesh with no edge links?

 

image.png.fde8dd82ae97b4c085a24a0a41ff9642.png

 

That's it there, the inside of the green square. It goes without saying that those edge links were removed in error - we can clearly see that its meant to interface with other adjacent cells. Fortunately, if we click "finalize navmesh" for this cell with no other edits and then save it, the CK should automatically repopulate the links.

 

image.png.f88face8ed893b84c5a8edb7d97d33f2.png

 

Here's what we see when we go back into xEdit:

 

image.png.66f953a99999144e59cac2f57fe7a22d.png

 

So its an easy fix, but now we've got another red flag... beyond just repairing the deleted meshes, we'll want to look at all navmesh edits in this mod to make sure there aren't similar defects.

 

Now here's the next deletion, below:

 

image.png.216ff0b0b8bbec7ea236e46cc88723f2.png

 

This is another straight-up deletion with many edge links to other meshes. Let's examine it in the CK.

 

image.png.ac7a9d168708c3140050db85c5615db1.png

image.png.585473cce866db342d6b00419d4db963.png

 

So that's the deleted navmesh. This, again, is a major problem but its pretty easy to fix by just undeleting the original navmesh.

 

Surely They Aren't All Like This?!

Spoiler

So that's the first 2 (+1 not deleted but defective) of 15 deletions. I hope they're not all like this. Let's review the remaining navmeshes and see what we find.

 

[NAVM:000E9049] - Deleted with no replacement. Had edge links. Linked mesh also deleted
[NAVM:00108270] - Deleted with no replacement. *Note - cell has a new EDID from this mod, so presumably this is an active content location for this mod. Had edge links to multiple cells
[NAVM:00108BE8] - DNR
[NAVM:000F065B] - DNR 
[NAVM:001020F3] - Type 1
[NAVM:00105F89] - DNR
[NAVM:000FFDB3] - Probable Type 2
[NAVM:000FFDB1] - Probable Type 2
[NAVM:000FFDAA] - Probable Type 2
[NAVM:000E8404] - DNR
[NAVM:000ED011] - DNR
[NAVM:000ED01E] - DNR
[NAVM:00016630] - DNR

 

So we're looking at 73% of the navmesh deletions being actual deletions rather than CK replacement issues. While these are almost always easily fixed by undeleting the mesh, it's a needless pain in the neck and you as the end user are still going to want to look at the cells to make sure the author hasn't made a major change to them that the vanilla mesh will cause problems interacting with.

 

We do however have examples of Type 1 and Type 2 navmeshes, and for educational purposes let's review them.

 

Type 1 Navmesh Deletion - Remove and Restore

Spoiler

image.png.0e56cad8198542e32b39e15b97ad4b42.png

 

The sole Type 1 deletion we have here involves Tamriel -31, -4, which based on its SBC Editor ID is a quest location for this mod. Note how the deleted navmesh's first vertex was at -124096, -16256, -4600. A quick look at the new SBC navmesh (04002411) reveals that it covers the same area.

 

image.png.3ef6f9a84b40cae6525fb198653dccbc.png

 

This is pretty easy to fix. We'll copy the original navmesh down, then delete the deleted record in xEdit. 

 

image.png.fc0a852ed9d3ec17b5e7fcdaf51700a7.png

 

With that done, now we'll go into the SBC navmesh and rename it to the deleted one.

 

image.png.24c82a3783b01b9984eb37f52d94e003.png

 

Now the form ID deletion is resolved.

 

image.png.c445c6cb929b419641ec10b7ea0da889.png

 

Out of curiosity, let's see what the difference is between vanilla an SBC.

 

image.png.4f83eabc1e8888652c0acd6768642ee1.png

 

Groan. Edge Link deletions. Based on what we've seen before, I don't know if I really trust this. Let's open up this navmesh in the CK and see if its a legit deletion. So, check it out below, here's the first triangle with a removed edge link. The yellow seam is the edge of the navmesh. You tell me, do you think it was correct to remove the edge link from this cell?

 

image.png.912b87b7baa46f0542522331add1cf0b.png

 

I think at this point we have to make a change to today's discussion plan.

 

Type 2 Navmesh Deletion - Trim and Drop

Spoiler

I was really hoping that this blog could offer more educational value, but I feel like instead I'm just beating on this mod. Fortunately, the Type 2 deletion seems to be less problematic, so we can get some good demonstration content out it.

 

In this case, the three deleted navmeshes appear to be the interior of one of the Riften watchtowers, and they've been merged into the main cell for that area. That main mesh does appear to actually change some of the vertex coordinates, so it might be a legitimate type 2, but I think we need to determine what this changes before we decide if its worth putting effort into fixing.

 

image.png.0a65145691a5b15df32360f97932b748.png

  

Let's overlay the two meshes and see how they look in the CK. First, the green highlights show the new mesh from SBC.

 

image.png.dd86c832a75ed0101cdb547cc035d33a.png

 

Now compare to the original - it looks like they are basically the same but of course it doesn't include the deleted areas. And those areas do in fact appear to be navmeshes that don't offer a lot of value being separate, or even opportunities for conflicts. 

 

image.png.e6bb66552f87fd86e433f504e811c064.png

 

To fix a Type 2 deletion, we need to do two things. First, we need to identify the new "winning" navmesh, which we've already done. Second, we need to undelete the losing navmeshes in xEdit. Once that's done, and those meshes are again visible in the CK, we're going to delete everything from them except for triangle zero, and then we drop that last triangle well below the Z plane of the cell. 

 

image.png.ed69532e4d3d7b31c7b841f1b2f14b59.png

 

image.png.20b6fc72bf75bec02296b50702ce3473.png

 

With all those done, we can hit "finalize navmesh" and save the file.

 

image.png.e7df1787bbbcdd53f9799263454aea08.png

 

This will allow the mesh parts to remain undeleted without duplicating triangles in the merged mesh, and it'll make it immediately clear to us in the future if some future mod tries to edit this mesh - that'll ensure we know to go in and pass off those changes to the "winner" mesh.

 

This Isn't The End of Navmesh Work...

Spoiler

So to recap, we reviewed three different ways to repair navmesh. In some cases, when the mesh was deleted in error, we just undelete it; we might also have to go back into the CK and finalize it to restore deleted edge links, though that's really more of a conflict resolution & dirty edit cleanup type deal than strict deleted navmesh repair. Second, we might hit a Type 1 deletion, where we need to replace the deleted record with the edited version that the CK spun off into a new record. Finally, we might see a Type 2 deletion where we need to trim down superseded navmesh and then hide it deep underneath the terrain. We didn't see a Type 3 in this case study, but the solution is to just do the Type 1 fix and then the Type 2 fix (rename the "winner", undelete the rest and then trim & drop). 

 

After that, the next step would be to rebuild the Navmesh Information Map for the main mod. To do this, just delete the NAVI record from the plugin, load it up in the CK, and save. Then, you'll almost certainly be revisiting these navmeshes during conflict resolution... but that's a topic for a different blog.

 

...But Its The End Of The Case Study

I know, I know. I said I'd do an article about the risks related to the closed source scripts as well as the compatibility concerns and the papyrus errors. But honestly, why? This mod clearly isn't ready for integration into a complex load order. The only purpose that third chapter would accomplish would be to crap on a mod that's still being developed and get me heated up about the parlor school again. And the thing is... it wouldn't even be a comprehensive review. The discovery that the edge link deletions goes beyond the deleted navmeshes drove home that there are probably even more lurking problems in the plugin that still need to be fixed, so just rattling off the problems related to the closed sourcing wouldn't be a comprehensive risk analysis of running this version.

 

Now, I hope things will change. The mod is still in development and aspects of it are pretty high quality. Even the parts I intensely dislike (read: that EULA pop-up) show a degree of polish that suggests the author isn't just ham-fisting things. I'll certainly be monitoring its progress. But I won't be using it, and it doesn't make sense to dig into the scripts and do a lot of deep analysis when they may change - and indeed, when they're likely to change. Hopefully we'll be back some time in the future to give this mod a second look and find ourselves pleasantly surprised by its progress. Until then, however, it's going into storage in my "not used in this build" folder.

6 Comments


Recommended Comments

Regarding Navmesh (example is from fallout4 but i am sure skyrim creation kit has same problems) just "opening" main .esm in editor gave 471 errors including navmesh the editor thinks needs to be deleted so this is the "start" of alot modders that just install the creation kit and maybe dont know (including myself ) how to prevent this in first place thinking if i open just the basic .esm  i am just guessing you need a vanilla install without other mods to start.

creation.jpg

Link to comment
5 minutes ago, Haraldh said:

Regarding Navmesh (example is from fallout4 but i am sure skyrim creation kit has same problems) just "opening" main .esm in editor gave 471 errors including navmesh the editor thinks needs to be deleted so this is the "start" of alot modders that just install the creation kit and maybe dont know (including myself ) how to prevent this in first place thinking if i open just the basic .esm  i am just guessing you need a vanilla install without other mods to start.

creation.jpg

 

Oh for sure. Running the CK without the community patches, whether on Skyrim or FO4, is a frustrating and risky process. And honestly this is the first mod in a long time where I've actually seen "real" navmesh deletions - most of the time, it's clearly procedural errors caused by the CK's navmesh finalization logic. As I said in the blog, I don't blame authors for having navmesh problems come out of the CK, I only blame them for not fixing them afterwards when they clean their mod (assuming they clean their mod) before they release it to the public. Deleted navmeshes are really obvious on the cleaning report in xEdit.

Link to comment

Thanks for all the info. Though it makes me even more unsure if I even want to really learn about Navmeshes. ? (Actually it's pushing me more into the 'uagh, better don't bother with' it direction ^^)

Remains to be seen if that mod is ever going to see a cleaned, stable state. I hope so, but only time will tell.

On a completely different note, have you ever considered using Immersive Citizens (https://www.nexusmods.com/skyrimspecialedition/mods/173)? I keep eyeing it, as it seems the most comprehensive and nifty NPC AI overhaul there is. Sadly it appears to have issues with most serious city/town overhauls and patching for it sounds very non-trivial.

Link to comment
55 minutes ago, Talesien said:

Thanks for all the info. Though it makes me even more unsure if I even want to really learn about Navmeshes. ? (Actually it's pushing me more into the 'uagh, better don't bother with' it direction ^^)

Remains to be seen if that mod is ever going to see a cleaned, stable state. I hope so, but only time will tell.

On a completely different note, have you ever considered using Immersive Citizens (https://www.nexusmods.com/skyrimspecialedition/mods/173)? I keep eyeing it, as it seems the most comprehensive and nifty NPC AI overhaul there is. Sadly it appears to have issues with most serious city/town overhauls and patching for it sounds very non-trivial.

 

I like a lot of the ideas in Immersive Citizens, but it has a reputation for causing compatibility issues in modded setups and the author actively discourages people from trying to do compatibility work on their own. I may explore it in more detail some time, but currently is on the "nice idea but I'll decline" list. That may change if my confidence with editing packages and my patience with making lots of idle markers around in the CK both increase.

Link to comment

@gregaaz

 

Thank you very much for this article. Through the content of the article, I have learned more about what you have taught before, especially which record to remove, why to remove that record and renaming the record??

Link to comment

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use