Declaring war on the NavMesh

Post » Sat Oct 16, 2010 3:41 am

:flamethrower: :brokencomputer:

I'm an absolute disaster when it comes to arranging navmesh for an interior cell. And the automatically generated once always turn out crappy. I don't quite understand how exactly the navmesh triangles influence the pathing behaviour of NPCs yet. I've followed some tutorials but they're not very clear on what the triangles themselves do, rather than the general shape of the thing.


In the game, I have a character who does the following, after succesfully walking a few meters and up some short stairs.

http://i18.photobucket.com/albums/b120/iamerik/Bethesda%20Modding/stupidnavmeshingame01.jpg, http://i18.photobucket.com/albums/b120/iamerik/Bethesda%20Modding/stupidnavmeshingame02.jpg, and then turns back again to repeat screenshot #1 and so on.

I've spend forever trying to fix it (I'm supposed to spend that time on designing quests damn it! :swear:), redoing the navmesh a billion times, starting with a clean save to test with every time, but I can't figure it out. If I change the navmesh he'll walk a little differently of course, but he always ends up glitching around that corner.

http://i18.photobucket.com/albums/b120/iamerik/Bethesda%20Modding/StupidNavmesh01.jpg. The NPC is supposed to walk from slightly below the stairs in the LOWER right corner, to a door at the top of the screen. Instead, he walks into that corner from the screenshot forever. I have no idea why. Is there something obviously wrong with my navmesh? What IS happening? Is he trying to walk straight towards the door in the upper screen somehow?

The AI package is making him travel to an Xmarker in another cell through that door. I managed to use the console to cheat him past the glitchy corner, and even though he walked right back sometimes, sometimes it also allowed him to continue.I've also tried both using it as an esp, and masterupdating it. Doesn't seem to matter.


And to think that this is just a tiny cell leading to the actual vault costing me hours already. I really need to figure this out. Any ideas? :sadvaultboy:
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

Post » Fri Oct 15, 2010 10:07 pm

I don't see the edge colored lines in the photo. Did you 'find cover edges' and 'finalize' the navmesh? Do you have one contiguous navmesh, or perhaps there are separate navmeshes that are so close, its hard to tell they are split. There is a http://geck.gamesas.com/index.php/Pathing_Tests on the navmesh toolbar as explained here. Those tool are very useful for figuring out what path an NPC will take going from point A to point B.
User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Sat Oct 16, 2010 3:27 am

The regular pathfinding test says he should make it from point A to B. The entire path it shows is marked green. It's also one contiguous navmesh, I checked by pressing F. I think I got it working now, I'll have to test it a couple more times to be sure.

I hadn't finalized the nav mesh or do the find cover edges thing yet but I have now, but I don't see any difference in the GECK (are the lines supposed to go black? It happened to just one small edge in the entire thing). What exactly does it do? Thanks for the pathfinding tool info, that looks useful indeed.


Also a general navmesh question, does the complexity of a navmesh influence/improve the pathfinding? Lets say I create a very large square out of several very large triangles. If I create the exact same sized square out of many more smaller triangles instead, does this make the pathfinding more precise? Or is it just the general shape (the large square) of the navmesh that matters?


One of the navmesh triangles seems to have turned a light blue/green'ish colour after doing the edge cover thing and finalizing the navmesh. Any idea what that means?


For Oblivion you could often get away with having no pathfinding at all for some cells, the NPCs would still move through them alright. And otherwise it was just connecting a few dots. Of course the navmesh system is better, but it sure takes some time getting used to. :)
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Sat Oct 16, 2010 2:31 am

The edges can come in different colors and mean various things - like full cover (behind a cabinet for example) or half coverage (behind a desk). Check out http://geck.gamesas.com/index.php/Navmesh_Creation_Workflow for some explanations of the different colors. I don't think the complexity means a whole lot. You will often find that after you finalize the navmeshes, the Geck will have redrawn or split some up into smaller triangles. The triangle that is beneath your teleport marker will turn green. This is the triangle that actors are placed about when teleporting into the cell.
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Sat Oct 16, 2010 3:06 am

I had an incredibly difficult time building the Navmesh for Hightown. It took about 3 weeks and close to a hundred tries. Each time I thought I figured a solution out, it proved incorrect in the end. Most of the issues revolved around using doors. This was in an exterior cell however.

Nevertheless, in the end what saved me was the Advanced NavMesh Generation. I found that if I used the first four passes, namely Cleanup, Remove Unwalkable, Simplify Edge Collapse and Simpify Edge Swap, then follow with a Finalize and Find Cover, I could generally create a near perfect NavMesh. Using Balance(Optimize) destroyed the NavMesh every time, rendering it useless.

Using the pass I described left you with a few areas that are disconnect, usually around stairs. I would patch those in and then finalize again.

Try this method and see if it helps. It took me 3 weeks to settle on it, and so far my NavMesh is holding up to serious NPC and Door abuse.
User avatar
JD FROM HELL
 
Posts: 3473
Joined: Thu Aug 24, 2006 1:54 am

Post » Sat Oct 16, 2010 4:43 am

Navmeshing is definitely an art, it just takes time to get used to it. :) You'll get the hang of it if you keep meshing!

Here are some tips I've picked up over the months:

1. Use the "W" key to quickly switch between NavMesh viewing modes, this is very important as you will see.

2. Use the "B" key outside to show the cell boundaries, which is critical for Navmeshing the cell boundaries correctly in exterior cells.

3. Try to make as large of triangles as you can, but in general (as Echonite points out), don't try to get elaborate as the GECK is going to re-write it when your done. Your key goal with NavMeshing should be to cover the areas where NPCs can go.

4. Do not make too-extreme of angles with the triangles, or the GECK will whine about it.

5. You cannot have more than 2,000 Navmeshes in any cell. More than this, and the GECK will error-out. Furthermore, Joystick Monkey says any more than 2,000 is bad for frame rate.

6. The cell boarders in exterior cells are Tricky. What you have to do is Navmesh each side of the boarder and line-up the edges as closely as possible. Each exterior cell has its Own mesh, and they don't physically connect to boardering cells. If you get the meshes at the boarders close-enough, a fat green line will appear at the boarder when you Finalize (see below step 9).

7. The "Tab" key is Huge. You will see this in the tutorial, it allows you to switch which two vertices from the last triangle that you have selected, so you can quickly "walk" your mesh across.

8. The "Test Cell Navmesh" is fabulous, you click it, then click a To and From spot on your mesh (click triangles), and the GECK will draw a fat line across the mesh where it Would send the NPC if it was trying to get from A to B. Its very effective in letting you know where the game would send your NPCs in specific game settings.

9. This takes time to do right, and I strongly recommend the tutorials from Bethesda. I started with them, and thanks to the short-cuts and methods they use I have since Meshed about 12,000-15,000 triangles. Their techniques and short-cuts REALLY make a big difference.

10. When your done with your mesh, do the following:

a. Save.
b. Click the, "Balance for Optimization" button. This will re-write the mesh in a more efficient form and you'll notice the number of triangles drops.
c. Check the mesh, as sometimes Balance can remove triangles if the space is too-narrow for NPCs or too angled. Fix any missing spots as necessary.
d. Click the, "Find Cover Edges" button, which finds the good corners that NPC's can use for cover while in combat.
e. Click the, "Finalize Cell Navmeshes" button, which will finish things up. If you have any errors, they will show up here.
f. Save Again.

You already have path-testing down, which is great!

Good luck :)

Miax
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Fri Oct 15, 2010 10:28 pm

One thing I would add from my experiences with navmeshing is to ensure that you leave enough space around static objects. If you navmesh too close, NPCs can get hung up on those objects. On the other hand, do make sure that your navmesh is close enough to furniture markers to allow NPCs to use them (if that's what you want) - I had one NPC continually jerking about at one point then discovered he was trying to get to a chair to sit down.
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Sat Oct 16, 2010 12:31 am

You can never have enough quick keys for everything. :D

Thanks Miaximus and everyone else for the tips! I think I'm getting the hang of it. And I won't have to do any exterior navmeshing, so I don't have to worry about that either. I'm definitely trying to keep the number of triangles down, because one of the cells I have to work with is rather big and with the way it is built it would be difficult to split it up in separate cells. So far so good.

So hopefully soon I'll be able to return to the more important (and fun) part of the mod: quests! :grad:
User avatar
Princess Johnson
 
Posts: 3435
Joined: Wed Feb 07, 2007 5:44 pm


Return to Fallout 3