Jump to content

Recommended Posts

Posted (edited)

It's been 4 years and I cannot remember where (or even which forum) we had the old thread, so here's a new place to discuss. AFAICT, this hasn't been improved in the SE CK.

The first principle of navmesh modding is: never delete or merge navmeshes! That way lies CtD (crash to desktop).

The second is like unto it: to reduce the number of conflicts, border triangles should not be renumbered!

Every adjacent cell navmesh has a link table with pointers into these border triangles. If a navmesh is deleted, or merged, or a border triangle is renumbered to be anyplace else, creatures/NPCs will "jump" into that triangle number as they cross the cell border. Sometimes they become stuck in place. Sometimes this also may make it impossible for the PC to move.

If possible, have the same number of triangles as the original. When you delete any triangle, the CK renumbers. This often changes border triangles.

Therefore, great care must be taken. It is usually better to first create a new triangle over the old, then delete the old triangle so that the new triangle is renumbered with the old triangle number, then join/merge the final vertice in place. (This technique is also used to repair border triangles.)

When you "Find Cover" for a cell, sometimes the CK renumbers triangles. Up to 2 sides of cover are saved (the 3rd side is assumed to be flat to the adjacent triangle), so triangle vertices sometimes need to be rotated to allow the cover data to be in side "0-1" and/or side "1-2" (as shown in xEdit). Apparently, the CK deletes the triangle (causing renumbering), then adds a new one in the proper orientation. Yet the CK already has a user tool for rotating a triangle without renumbering; it fails to use it internally.

When you Finalize a navmesh, the CK doesn't just touch the one you are changing. It also saves adjacent cell navmesh. In the outdoors, this results in 4 cells around the square. Presumably, this is to update border links caused by deletion or renumbering -- even when there have been no changes.

The CK works reasonably well only having Update.esm, but is a disaster waiting to happen with multiple modders updating adjacent cells. Each changes 5 cell navmesh, so the conflicting border link tables cause massive confusion.

(Following posts have more detailed information.)

See also:

 

Edited by DayDreamer
Following posts have more detailed information

Share this post


Link to post
Share on other sites

To avoid deleting or merging navmeshes, use an edge link instead. The same link table that crosses cell borders is also used to create triangle connections within cells, usually where developers want NPCs to "jump" from ledges. Link edges between existing navmeshes without creating a new triangle. (Such links usually appear in pink.)

Note a new Finalize will often remove some of your carefully constructed internal links. So place all door exits and Finalize before hand linking.

Share this post


Link to post
Share on other sites

There exist both indoor and outdoor cells with auto-generated navmesh that is not internally connected. Finalizing such cells or adjacent cells will cause the original navmesh to shrink (renumbering its border triangles), and new island navmeshes to be created. Needless-to-say, this is a potential disaster.

Always examine your changes with xEdit, and delete these extraneous navmesh in adjacent cells.

After deleting extraneous navmesh, re-load in CK, carefully select 1 good navmesh vertice (this will usually set the changed flag even though it has not been moved), then save to update the NAVI table.

Share this post


Link to post
Share on other sites

CK usually reorders border link tables in unpredictable ways, even with no other changes.

After Finalizing, quit the CK, load xEdit, then Apply Script "Skyrim - Clean edge links in navmeshes" before Apply Filter to Clean.

This will return link tables to their original order, so any otherwise unchanged adjacent navmesh will be reported as ITM and be removed.

After Remove "Identical to Master" records, re-load in CK, carefully select 1 good navmesh vertice (this will usually set the changed flag even though it has not been moved), then save to update the NAVI table.

Share this post


Link to post
Share on other sites
1 hour ago, DayDreamer said:

It's been 4 years and I cannot remember where (or even which forum) we had the old thread, so here's a new place to discuss. AFAICT, this hasn't been improved in the SE CK.

There is still Arthmoors Knowledgebase topic for oldrim

 

Share this post


Link to post
Share on other sites

I'd just like to point out that it's probably unavoidable to change the number of triangles in the navmesh when you're building anything of significant size outdoors. It would create an even bigger mess for people to ignore the proper layout of the cell than it would be to leave it alone. Using navcut boxes is only effective as a solution when there's no need for doors to access attached interiors.

As long as the work being done does not result in navmesh deletions, it's fine to remove or add triangles since finalization would be necessary no matter what when doors become involved.

Share this post


Link to post
Share on other sites
On 4/4/2018 at 3:42 PM, Arthmoor said:

I'd just like to point out that it's probably unavoidable to change the number of triangles in the navmesh when you're building anything of significant size outdoors. [...]

Absolutely! Because of the border triangle issue, it's better to increase the number (so the borders stay the same). But a building on or over a border – or that reduces the number of triangles so that border triangles with larger numbers are also renumbered – are where the adjacent cell also needs to be included, and where conflicts between plugins will ensue.

This is really about reducing the number of conflicts, and avoiding the link jumps into nowhere that cause CtD.

Finalize the doors, then Apply Script "Skyrim - Clean edge links in navmeshes" before Apply Filter to Clean, will repair cases where the adjacent cell navmesh DOES NOT need to be included.

Share this post


Link to post
Share on other sites

As an example, consider Whiterun. We discovered early on that there was a pair of missing border links on the road, causing all the NPCs to run around through the farms instead. Fixed in US*P by Finalize.

But that led to conflicts with Cutting Room Floor, and with Touring Carriages (and both its predecessors). We hadn't decoded the border link table yet (until 2014), so we had no idea what was going on.

US*P cells

a b c d
e f G h
i J K L
m n O p

J and K were joined by the US*P Finalize. But that also inserted G, L, and O, with unneeded modified edge links.

When CRF added a building kitty-corner at 'f', it generated b, e, G, and J. TC added 4 triangles at G. The double conflict at G caused CtD.

We eventually worked it out (in 2013), and that gave us enough information for decoding the link tables in xEdit.

IIRC, we simply coordinated. US*P Finalized at J instead. Then TC modified G in place. CRF slid its door over the border and Finalized G. Or something like that (details after 5+ years are hazy).

But now that we know better, we could have built CRF entirely within 'f', and cleaned them all.

So US*P should only have 'J' and 'K'. CRF should only have 'f' (and 'h' for the other house). And TC should only have 'G'.

Anyway, other folks have since reported problems building at 'm' and 'p', for the same reasons. As long as everybody cleans their edge links, it works. With overlapping altered link tables, it fails.

 

 

Share this post


Link to post
Share on other sites

So the still unfinished demo for my farmhouse kit which places an inn on the Markarth-Whiterun road could easily lead to issues with Touring Carriages ? Good to know.

 

Share this post


Link to post
Share on other sites
8 hours ago, Sclerocephalus said:

So the still unfinished demo for my farmhouse kit which places an inn on the Markarth-Whiterun road could easily lead to issues with Touring Carriages ? Good to know.

With Touring Carriages? Unlikely. TC makes as few navmesh changes as possible. And it's clean.

Anyway, this is about how to ensure your demo conflicts with as few others as possible, by cleaning your navmesh.

Share this post


Link to post
Share on other sites

But cleaning your navmesh edge link tables isn't always enough. When it finds an issue, it prints a message explaining. Sometimes, it fixed part of the issue, and adds that to the message.

For example, in the raw SE Update.esm, there's a cell where they did a Finalize (or something) that drastically changed the number of border triangles, but the changes were not saved properly. Obviously, they aren't using the same CK, or it was an older version, or they saved conflicting navmesh from different edits. There's also a deleted navmesh in this cell.

So the link table is suddenly much shorter. It had 9 border triangles, but now has only 3. These error messages indicate where you will need to hand repair.

Spoiler

Applying script...
Had old Edge 2-0 link 7 > new limit 3
^^^ Check triangle 79 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Had old Edge 2-0 link 6 > new limit 3
^^^ Check triangle 91 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Had old Edge 2-0 link 4 > new limit 3
^^^ Check triangle 92 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Had old Edge 2-0 link 8 > new limit 3
^^^ Check triangle 93 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Had old Edge 0-1 link 5 > new limit 3
^^^ Check triangle 97 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Want match for triangle 86 in [NAVM:0010391C] (in GRUP Cell Temporary Children of [CELL:00009B06] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-10))
via old Edge 2-0 link 3
^^^ Check triangle 99 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Was old matching link 9 > new limit 3
Have match (9) for triangle 174 in [NAVM:000E80C0] (in GRUP Cell Temporary Children of CradleStoneTowerExterior01 [CELL:00009AE4] (in Tamriel "Skyrim" [WRLD:0000003C] at -25,-9))
via new Edge 0-1 link 1
Had old Edge 2-0 link 9 > new limit 3
^^^ Check triangle 108 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Want match for triangle 3 in [NAVM:00103932] (in GRUP Cell Temporary Children of [CELL:00009B06] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-10))
via old Edge 2-0 link 0
^^^ Check triangle 290 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Want match for triangle 4 in [NAVM:00103932] (in GRUP Cell Temporary Children of [CELL:00009B06] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-10))
via old Edge 2-0 link 1
^^^ Check triangle 325 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Want match for triangle 7 in [NAVM:00103932] (in GRUP Cell Temporary Children of [CELL:00009B06] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-10))
via old Edge 2-0 link 2
^^^ Check triangle 326 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))

Have match (0) for triangle 108 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))
via new Edge 0-1 link 18
Want match for triangle 108 in [NAVM:0010391E] (in GRUP Cell Temporary Children of [CELL:00009AE5] (in Tamriel "Skyrim" [WRLD:0000003C] at -26,-9))
via old Edge 1-2 link 0
^^^ Check triangle 174 in [NAVM:000E80C0] (in GRUP Cell Temporary Children of CradleStoneTowerExterior01 [CELL:00009AE4] (in Tamriel "Skyrim" [WRLD:0000003C] at -25,-9))

Have match (24) for triangle 103 in [NAVM:000E89EC] (in GRUP Cell Temporary Children of [CELL:0000925D] (in Tamriel "Skyrim" [WRLD:0000003C] at -20,26))
via new Edge 2-0 link 22
^^^ Check triangle 223 in [NAVM:0010FEA1] (in GRUP Cell Temporary Children of ThalmorEmbassyExterior02 [CELL:0000923C] (in Tamriel "Skyrim" [WRLD:0000003C] at -20,27))

[Apply Script done]  Processed Records: 15263, Elapsed Time: 00:17

 

(This is not currently repaired by USSEP, although I'd prepared a patch years ago. Maybe I've forgotten.)

[Nota Bene: This was an example run. We don't actually run this cleaning script on Update. We treat the Update file as canonical, because most modders will build on a non-repaired Update file. Only run the cleaning script on your own plugin.]

Quite frankly, it's amazing that there are so few apparent problems. But that's because we aren't actually looking for problems. The clean script only cleans the edge links. For detecting problems, we needed a check script. I'll describe that in the next post.

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Several problems are detected by Apply Script "Skyrim - check edge links in navmeshes".

  • xEdit shows a triangle flag that is labeled "Found" (value 2048 or 0x0800). This is set by the CK Finalize whenever it successfully finds a path to that triangle from somewhere else. Triangles without the Found flag cannot be traversed. This is usually due to a bad triangle somewhere, or an entire section of the navmesh isn't connected to the rest.
  • a border triangle might point (via the edge link table) to a triangle in another cell, but that cell triangle does not point back to the same place. This indicates a bad triangle vertice or a moved border triangle.
  • small island triangles often cannot be reached.

For example, try running on USSEP. While many/most of these problems have been fixed, currently POISnowy03 [CELL:00009372] has dozens of Not Found triangles.

*** Not Found Triangle 213 in [NAVM:00103591] (in GRUP Cell Temporary Children of POISnowy03 [CELL:00009372] (in Tamriel "Skyrim" [WRLD:0000003C] at 0,17))
No match!
Referenced triangle 390
^^^ ERROR Triangle 214 in [NAVM:00103591] (in GRUP Cell Temporary Children of POISnowy03 [CELL:00009372] (in Tamriel "Skyrim" [WRLD:0000003C] at 0,17))
*** Not Found Triangle 255 in [NAVM:00103591] (in GRUP Cell Temporary Children of POISnowy03 [CELL:00009372] (in Tamriel "Skyrim" [WRLD:0000003C] at 0,17))

The above shows the latter triangle references the former, but not vice versa (no match). (In this case, it was apparently an unusual CK error generating the navmesh.) Frequently this is an inverted triangle (wrong way around), done by the CK or by hand. Fixing this will also fix all the missing Found flags.

[See below for detailed demonstration.]

 

Edited by DayDreamer
See below for detailed demonstration

Share this post


Link to post
Share on other sites

Screenshots or even movies of the Navmeshes in the render window would illustrate the points in the OP. Also how to barf with deletions & bad triangles with pictures would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
On 4/5/2018 at 11:01 PM, lmstearn said:

Screenshots or even movies of the Navmeshes in the render window would illustrate the points in the OP. Also how to barf with deletions & bad triangles with pictures would be appreciated. Thanks.

Sorry, I started to reply to this, and do some navmeshing updates, but then the next version USSEP beta came out that weekend. So waited for stability. The newer CK has some ease of use issues, too. But now that we've given up on USLEEP, at least now I don't have to worry about doing everything twice.

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/5/2018 at 8:14 AM, DayDreamer said:

As an example, consider Whiterun. We discovered early on that there was a pair of missing border links on the road, causing all the NPCs to run around through the farms instead. Fixed in US*P by Finalize.

Illustrated as requested. Vanilla has no green link on the road (yellow line below the farm), but there is one in the farm itself:

1083466988_WhiterunExterior15before.thumb.PNG.f9c740d46627f713ae0b7320300c53ac.PNG

Finalized (big check mark in the navmesh menu) with the CK (the yellow line has been replaced with green):

1778600994_WhiterunExterior15after.thumb.PNG.880f6ca1c24b8afa16e8ec5221a399d1.PNG

SSEEdit shows us that the CK actually saved a lot of ITM navmesh (gray in left panel). And saved 5 changed navmesh (green on yellow in left panel).

Note that a lot of indexes were apparently randomly altered in the target navmesh (right panel) obscuring the actual change to Triangle #147. Likewise in the 4 other adjacent navmesh:

313646934_WhiterunExterior15linksCK.thumb.PNG.2c93015f7383d11df068d9c1fb9c94a7.PNG

So we select our new .esp and Apply Script "Skyrim - Clean edge links in navmeshes". Now we have only the necessary changes (compare right panels); one changed Triangle, and its new Edge Link #45 appended at the end of the table:

1950038658_WhiterunExterior15linksclean.thumb.PNG.4d0eee18131ba5fcb52e2024abcfeace.PNG

Quit and reload, filter and clean ITMs, and all the unnecessarily included navmesh are removed as well (compare left panels above and below). Only the 2 actual changed navmeshes are present, preventing neighboring conflicts with other plugins:

170574998_WhiterunExterior15linkscleaned.thumb.PNG.341821140610f78c4946d0c45d6847c0.PNG

Hopefully that's clear now. Questions?

Edited by DayDreamer
added italicized directions for reading legibility

Share this post


Link to post
Share on other sites

Thanks. :) Couldn't find any difference in the graphic #1 & #2- where to look for the 5 navmeshes on the map? No difference between graphic #4 & #5 either.

Another approach for a guide like this is to go in some kind of bulleted point form- with complicated things explained in a separate section later.

A can do this & a do not do this tabulation in a pictorial guide might help as well. It's terrific for this good info to be out there, notwithstanding navmeshing having been a longtime bugbear for most at the best of times.

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, lmstearn said:

Couldn't find any difference in the graphic #1 & #2- where to look for the 5 navmeshes on the map? No difference between graphic #4 & #5 either.

Added parenthetical and italicized directions for your reading pleasure. The 5 navmeshes are a cell in the center, with the 4 bordering cells (nominally up, left, right, down, although SSEEdit by FormID can seem somewhat random; it's just the order they were initially created). The road edge is below the farm. The change is in the left panel.

Edited by DayDreamer
explain FormID numbering

Share this post


Link to post
Share on other sites
On 4/5/2018 at 10:04 PM, DayDreamer said:

... currently POISnowy03 [CELL:00009372] has dozens of Not Found triangles.

Turns out that this problem is present in vanilla. But in fixing another problem, US*P made the issue slightly worse for wear.

US*P changed a single vertex (#186) of a border triangle, dropping it to the ground to match the adjoining cell. Presumably this was an issue for followers. (I cannot find it in the log.) This was likely done at the same time a number of placed objects were fixed (although this vertex is not near any of those objects).

In so doing, two triangles (#185 and #422) were swapped. Blame it on the CK?

636252122_POISnowy03Triangleswapped.thumb.PNG.c3d88c97a87c829dcffac6f25799bc0e.PNG

But at the time of saving, the CK also gives these error messages:

PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 185 Edge 0 and Triangle 401 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 214 Edge 1 and Triangle 390 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 390 Edge 0 and Triangle 214 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 401 Edge 2 and Triangle 185 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 185 has a link to Triangle 401, but Triangle 401 doesn't have the matching link
PATHFINDING: Navmesh 00103591 Cell 'POISnowy03' (00009372) (0, 17) in WorldSpace 'Tamriel' (0000003C), Triangle 214 has a link to Triangle 390, but Triangle 390 doesn't have the matching link

Here's a demonstration of how to fix all these problems at once.

First, we need to put the triangles back. We also want the CK to find the adjacent triangles at the same time. As mentioned in the OP, we Find ('^F') each triangle and make a new triangle on top of the old ones using 2 of their vertices. Use the vertex section tool. While there are 4 mentioned, they can be fixed by replacing only #185 and #214 (and swapping back #422 with #185).

Then, one by one, lowest numbered to highest: Find ('^F') , Remove ('R') the old triangles, and join ('Q') the 3rd vertex. Here's a picture of #422 just before joining. Note the selected vertices are green:

199018613_POISnowy03Triangle422fix.thumb.PNG.3665f8ee5fdffc3ac6f0fee419952f9a.PNG

The triangles are back in place (#185 matches vanilla vertices), and they are joined to their neighbors. The Found flags are present throughout the cell, so NPCs can traverse the area:

509934603_POISnowy03Triangle185214fixed.thumb.PNG.d0bef80af024f85ed46243fef0d02ab7.PNG

(Note #185 is a preferred road segment, but now also has a Found flag. This was probably the real reason NPCs had problems here. I'd already fixed this in Touring Carriages.)

Share this post


Link to post
Share on other sites

I've now posted bug trackers for a fair number of the road navmesh issues that I'd found building Touring Carriages. But trying to fix a road segment near Fort Sunguard turned out to be one of the most challenging. Finalizing there found that nearly every navmesh in the area (more than 20) is badly broken. So many warnings that you have to copy and paste them into a document for analysis. Each interdependent with the others.

Initially, I tried making all the fixes in the area, then Finalizing. But I always found another mistake. It's almost humanly impossible. It's been 4+ years, so I'll try to describe some of the methods that I used to fix them more independently.

Let's start away from the road, the easiest: FortSungardExteriorEdge. This is full of missing Found flags. No NPC can cross this cell.

The CK tells us:

PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 13 Edge 2 and Triangle 409 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 193 Edge 1 and Triangle 242 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 242 Edge 0 and Triangle 193 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 409 Edge 1 and Triangle 13 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 421 Edge 1 and Triangle 461 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 461 Edge 0 and Triangle 421 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 13 has a link to Triangle 409, but Triangle 409 doesn't have the matching link
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 193 has a link to Triangle 242, but Triangle 242 doesn't have the matching link
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 421 has a link to Triangle 2, but Triangle 2 doesn't have the matching link
PATHFINDING: Navmesh 000e85c6 Cell 'FortSungardExteriorEdge' (00009A59) (-18, -5) in WorldSpace 'Tamriel' (0000003C), Triangle 461 has a link to Triangle 421, but Triangle 421 doesn't have the matching link

So we take a look. T13 and T409 are the easiest. They are adjacent and T409 is simply missing a link. Skyrim.esm was corrupted somehow.

1395334016_FortSungardExteriorEdgeT13T409.thumb.PNG.4f0a05f81592fc58de2473d4b7d4a5f9.PNG

T193 and T242 are above them.

1282044545_FortSungardExteriorEdgeT193T242.thumb.PNG.27cfd49431e49660988f5c28f12c2e8c.PNG

T421 and T461 are similar, nearby, but on two borders. Repairing is difficult, because we would have to Finalize afterward. But we don't want to do that.....

13917891_FortSungardExteriorEdgeT421T461.thumb.PNG.6d174661d9006eb8a8ee282936ab88d5.PNG

Finally, T2 (incorrectly linked from T421) is on the far side of the cell next to a cliff. Its links seem OK, so we ignore it.

238881574_FortSungardExteriorEdgeT2.thumb.PNG.26297feda900cc266ecf7778978f1c95.PNG

Instead, use SSEEdit to correct the half linked triangles without affecting the border links. Copy navmesh 000e85c6 into a new .esp. Change Triangle #421 edge 1-2 from 2 to 461, and change Triangle #242 edge 0-1 from -1 to 193. Easy enough.

But we still have a third half-linked pair that we've saved for last. Load the new .esp in the CK. Navmesh tool. Find ('^F') bad Triangle 409. Using the triangle tool ('T'), look very carefully at the vertex information: "Vert1 350, Vert2 361, Vert3 148". (I've not been able to figure out how to include it in a screen shot.) Switch to the vertex tool ('V'), and select (click or swipe over) vertex 350 followed by (control click/swipe) 361, then control right click a new triangle over the original.

This new triangle is numbered higher than any other triangle, but shares 2 vertices.

1218670249_FortSungardExteriorEdgeT409overlay.thumb.PNG.17e785ae03478a95bb76535acfae8f1f.PNG

Find 409 again (just leave the dialogue box open from a moment ago), and Remove ('R') it. This changes the new triangle to the old triangle. (Thank heavens it doesn't renumber any others!) Then select the remaining vertices (showing green):
588277081_FortSungardExteriorEdgeT409readytojoin.thumb.PNG.ad32685e4dbaa52118a791bc1d547a82.PNG

Join ('Q') them. Tada!

835081508_FortSungardExteriorEdgerepaired.thumb.PNG.87ef58fb179b93a6d7cee2953bd80af9.PNG

Then save. The CK will mark all the properly connected triangles as Found. (The reason we saved a CK repair for last.)

Share this post


Link to post
Share on other sites

Let us examine FortSungardPath (navmesh 000798F0). This is the most pernicious navmesh problem that I've encountered, taking weeks to debug. We have non-Euclidean geometry here....

Also, there are no cover triangles generated.

This Path cell (and the Edge cell in the previous demonstration) are home to the major forces for the battle. They must be having problems deploying.

There are a large number of pathfinding errors here:

PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 40 Edge 0 and Triangle 113 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 47 Edge 1 and Triangle 242 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 64 Edge 1 and Triangle 316 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 113 Edge 1 and Triangle 40 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 121 Edge 0 and Triangle 261 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 146 Edge 2 and Triangle 154 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 154 Edge 0 and Triangle 146 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 212 Edge 2 and Triangle 228 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 228 Edge 0 and Triangle 212 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 242 Edge 0 and Triangle 47 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 261 Edge 1 and Triangle 121 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 316 Edge 0 and Triangle 64 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 316 Edge 2 and Triangle 381 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 381 Edge 2 and Triangle 316 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 40 has a link to Triangle 113, but Triangle 113 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 121 has a link to Triangle 261, but Triangle 261 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 154 has a link to Triangle 146, but Triangle 146 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 228 has a link to Triangle 212, but Triangle 212 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 242 has a link to Triangle 47, but Triangle 47 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 316 has a link to Triangle 64, but Triangle 64 doesn't have the matching link
PATHFINDING: Navmesh 000798f0 Cell 'FortSungardPath' (00009A7B) (-19, -6) in WorldSpace 'Tamriel' (0000003C), Triangle 381 has a link to Triangle 316, but Triangle 316 doesn't have the matching link

Not mentioned is Triangle #447. Count the sides between vertices. So we have a 5 sided "triangle"?

620104055_FortSungardPathT447(T183).thumb.PNG.bfa78327ed5355bdaac1ab01578d64ca.PNG

No, the triangle you can see is actually #183, attached to the adjacent cell on the right. There is an invisible line connecting the 3 upper right vertices. That is "triangle" #447. It jumps to #50 (not #183) on one side (Edge 0-1):

1494633454_FortSungardPathTriangle447.PNG.6afffbc9b7a6cd119108f3c6750447de.PNG

Its other two sides (Edge 1-2 -> Link #61 and 2-0 -> #70) are impossibly attached to two triangles in the next cell (via the three upper right vertices)!

169816874_FortSungardPathEdgeLink61.thumb.PNG.0eb26678fddaf18f6a566dbabd05a44d.PNG

592940574_FortSungardPathEdgeLink70.thumb.PNG.35cd1bc56ac579d3682e0a91f7c96798.PNG

Triangle #50 is also invisible, attached to #183 and #447, and on its third side to the border cell above (via leftmost two vertices).

1923835900_FortSungardPathTriangle50.PNG.5c1fc785f04f307baa0be5b64210895e.PNG

1968328611_FortSungardPathEdgeLink52.thumb.PNG.2de9ebea20ade602cb5004bb323d8341.PNG

As you can see, none of these triangles have been Found, so NPCs cannot walk here.

I'm not going to do a step-by-step, it is just too much; every time I do it I get a different answer. Just wanted to illustrate one of the worst case scenarios....

 

Share this post


Link to post
Share on other sites

Having repaired nearly every cell in this area, we have a couple more nearby cells with missing Found flags: FortSungardExterior01 and FortSungardCourtyard.

Both provide an example of another kind of pathfinding error, for example:

PATHFINDING: Navmesh 000fb3ec Cell 'FortSungardExterior01' (00009A9B) (-18, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 419 Edge 2 and Triangle 421 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ec Cell 'FortSungardExterior01' (00009A9B) (-18, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 421 Edge 0 and Triangle 419 Edge 2 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ec Cell 'FortSungardExterior01' (00009A9B) (-18, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 419 has a link to Triangle 421, but Triangle 421 doesn't have the matching link

PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x020099ae, Tri 0, Edge 1) - Navmesh 0x000356b9, Tri 23, Edge mismatch, portals are:
	1: Navmesh 0x000fb3ec, Tri 572

When examining FortSungardExterior01 with the 3rd navmesh view mode ('w') - navmesh only - it becomes apparent that there are two navmesh, but one of them has two disconnected parts. This should never happen! (But appears in a dozen or so cells.)

Together with the single half-linked triangle, this is the reason that we have missing Found flags in this cell.

When you save, the smaller part (hopefully) will be split into a new third navmesh (here named 0x020099ae, although that changes every repair attempt). There is nothing that can stop this problem. We are fortunate in that the smaller part also has the highest numbered border triangle, so the rest of the cell is unchanged.

This new third navmesh will no longer have border links. So it must be Finalized.

At which point all hell breaks loose, because the adjoining FortSungardCourtyard has no less than 8 disconnected parts!!! :wallbash: And they have doors, so all the connected interiors update, too. :cry:

Here is the pathfinding error list:

PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 83 Edge 0 and Triangle 200 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 137 Edge 0 and Triangle 357 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 187 Edge 1 and Triangle 429 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 197 Edge 0 and Triangle 431 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 200 Edge 1 and Triangle 83 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 357 Edge 0 and Triangle 137 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 429 Edge 1 and Triangle 187 Edge 1 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 431 Edge 1 and Triangle 197 Edge 0 should be linked, but they are not.
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 83 has a link to Triangle 200, but Triangle 200 doesn't have the matching link
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 187 has a link to Triangle 429, but Triangle 429 doesn't have the matching link
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 197 has a link to Triangle 431, but Triangle 431 doesn't have the matching link
PATHFINDING: Navmesh 000fb3ef Cell 'FortSungardCourtyard' (00009A9A) (-17, -7) in WorldSpace 'Tamriel' (0000003C), Triangle 357 has a link to Triangle 137, but Triangle 137 doesn't have the matching link

PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 399, Edge 0) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 490
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 458, Edge 0) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 358
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 459, Edge 0) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 343
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 464, Edge 2) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 426
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 519, Edge 1) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 491
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 520, Edge 0) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 492
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 522, Edge 1) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 493
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 524, Edge 2) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 276
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 527, Edge 0) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 495
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 529, Edge 2) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 496
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 576, Edge 2) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 497
PATHFINDING: BSNavmesh::GetMatchingEdge() for (Navmesh 0x000fb3ec, Tri 578, Edge 2) - Bad matching triangle index: Navmesh 0x000fb3ef, Tri 494

So we have to start over. Fix all the half-linked triangles in both cells. Then save. Then Finalize both cells. Then save again.

UPDATE: Further complicated in the 4 years since I'd originally figured out how to fix this, US*P has updated FortSungardCourtyard (the navmesh has already been split), probably during Finalize of adjacent FortSungardExterior04 (edge cover and removed triangles on mountainside and updated door). Nothing other than the door in the logs. Missing the border connections. So we get to do it all over again, with US*P as a base. Conflicting navmesh is hard.

Share this post


Link to post
Share on other sites

As mentioned in the OP, "Find Cover" will often renumber cell border triangles. The adjacent cells will no longer link. So  must always Finalize.

In this case, the vanilla navmesh 000EDB5E roadway is missing preferred flags. Touring Carriages fixes those. In addition, US*P did "Find Cover". Unfortunately, US*P didn't Finalize, so it's missing half of its border links. (I'll not illustrate, as this is easy to reproduce and surely US*P will be fixed soon.)

Combining the two changes from scratch, cleaning navmesh, repairing the renumbered border triangles, Finalizing, cleaning navmesh again, you'll see the following somewhat interesting xEdit messages from the cleaning script:

Have match (40) for triangle 298 in [NAVM:000EDB67] (in GRUP Cell Temporary Children of [CELL:000094D3] (in Tamriel "Skyrim" [WRLD:0000003C] at -23,7))
via new Edge 0-1 link 40
Want match for triangle 298 in [NAVM:000EDB67] (in GRUP Cell Temporary Children of [CELL:000094D3] (in Tamriel "Skyrim" [WRLD:0000003C] at -23,7))
via old Edge 1-2 link 40
^^^ Check triangle 284 in [NAVM:000EDB6B] (in GRUP Cell Temporary Children of [CELL:000094F4] (in Tamriel "Skyrim" [WRLD:0000003C] at -23,6))

Have match (0) for triangle 1 in [NAVM:00104FB9] (in GRUP Cell Temporary Children of [CELL:00009514] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,5))
via new Edge 0-1 link 0
Want match for triangle 1 in [NAVM:00104FB9] (in GRUP Cell Temporary Children of [CELL:00009514] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,5))
via old Edge 1-2 link 0
^^^ Check triangle 423 in [NAVM:000EDB5E] (in GRUP Cell Temporary Children of [CELL:000094F3] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,6))

Have match (34) for triangle 233 in [NAVM:000EDB6B] (in GRUP Cell Temporary Children of [CELL:000094F4] (in Tamriel "Skyrim" [WRLD:0000003C] at -23,6))
via new Edge 1-2 link 34
Want match for triangle 233 in [NAVM:000EDB6B] (in GRUP Cell Temporary Children of [CELL:000094F4] (in Tamriel "Skyrim" [WRLD:0000003C] at -23,6))
via old Edge 2-0 link 34
^^^ Check triangle 519 in [NAVM:000EDB5E] (in GRUP Cell Temporary Children of [CELL:000094F3] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,6))

Have match (7) for triangle 430 in [NAVM:000EDB5E] (in GRUP Cell Temporary Children of [CELL:000094F3] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,6))
via new Edge 0-1 link 7
Want match for triangle 430 in [NAVM:000EDB5E] (in GRUP Cell Temporary Children of [CELL:000094F3] (in Tamriel "Skyrim" [WRLD:0000003C] at -22,6))
via old Edge 1-2 link 7
^^^ Check triangle 416 in [NAVM:000E879E] (in GRUP Cell Temporary Children of [CELL:000094F2] (in Tamriel "Skyrim" [WRLD:0000003C] at -21,6))

You really don't need to check triangles, unless you really want to see what changed. Note the only differences are the old and new Edge links. These are triangles that were rotated for Finding Cover, and that also happen to be on cell borders. (They also will be some of the triangles that you repaired.)

Because reported triangle numbers and link numbers are the same, you can have confidence that the adjacent cells will jump into the correct triangle and vice versa.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Support us on Patreon!

×