Garry's Mod

Garry's Mod

55 ratings
Making a proper navigation mesh
By NextKuromeThe76Soldier
I see almost no mappers make a navigation mesh for thier map, but when they do and include it into thier addon, it ends up being terrible and have a lot of inperfections that will cause trouble for nextbots. They seamingly have no idea what they are doing with that singular command they keep hearing, enter it in console and call it a day.

So this will explain how you make a proper navmesh so that your nextbots don't end up getting stuck on some stairs or tight doorways, it will also describe how you can make a navmesh generate in more than 1 area if spawn is seperated by a box.

This is a guide for navmeshes, and not AI nodes, i repeat, they are NOT the same thing. Navmesh is for nextbots like sanic clones, Zetta Players or DrGBase NPCs, AI nodes are for your typical combine, rebels and VJ NPCs.
2
5
   
Award
Favorite
Favorited
Unfavorite
The simple way
How you would go about this is the following:
1. Launch a map that doesn't have a navmesh
2. Turn on sv_cheats 1 in the developer console
3. Enter the command nav_generate

This will start a generation process from the spawnpoints and it will take a while to generate depending on the map size. This is the way everyone does it, and it can lead to an unoptimized mesh and faulty connections on some areas.
The way i do it
This is how a professional would go about this and overcome any issues along the way.

1. Do steps 1 and 2 from the last section
2. Stand in an area
3. Type nav_mark_walkable in console, that will place a sample point for the navmesh generation
4. Fly to a new area and repeat step 2 and 3 until you think you got the map covered (use on map seperated areas like zones accessable only via teleporters or high rooftops)
5. Type nav_generate_incremental_range 90000 in console, this will increase the generated radius around the marked spots
6. Type nav_max_view_distance 2000 in console, this will speed up generation process
7. Type nav_generate_incremental in console, this will begin generating the navmesh from the marked spots, the map will not relaunch which can avoid crashes, don't leave the map when completed or you will have headaches later on if the map is really large and has a lot of mountains.
The way i do it pt.2, Navmesh Editor
This part can be skipped and everything is complete when you generate on an open map that doesn't have any interior or buildings.

I advise you to get the Easy Navmesh Editor, it will be critical for this section.

The tool will be your problem solver once your navmesh has been generated, you would use it like the precision or weld tool. A few things to note first:
1. Blue lines between areas = 1 way connections, from area that is hovered
2. Cyan lines between areas = 2 way connections
3. Yellow area = currently highlighted
4. Red area = area linked to highlighted area
5. Pink line on a area's corner = hiding spot

Begin patching:
1. Get the navmesh tool and select the merge setting
2. You now wanna go around and check all of the stairs and see if they have a proper connection, if they aren't, you will have to fix them (if they have a blue line instead of cyan).
3. Click on the area you want to merge with the other, they will form 1 singular stair mesh with an non oneway connection (also you can manually apply a connection if only a one-way connection or none is present)













4. Next you should go and delete fencetops, they give nextbots a headache, some intelligent ones can climb them but some might just teleport thru them.
5. select the delete setting and try to aim at the incorrect areas

















5. As finisher, you need to remove 2-way connections that seem unlogical
6. Go about this by removing the area (if its a roof normally unreachable), or select the disconnect option and hit the 2 linked areas to unlink them

















6. If all is complete, you should fix up potential absent connections, this mostly happens between doorways
7. Link them by selecting the connect option and hitting the 2 areas you want to link (or create an new area if the gap is too large), sometimes merge also works.















7. Then you can finally save, doing this will also automatically compress and lower the .nav file size, making the map load way faster compared to how it would launch with an unmodified navmesh
13 Comments
Skid Row 4 Jan @ 11:04am 
alright thanks
NextKuromeThe76Soldier  [author] 4 Jan @ 11:01am 
mostly
Skid Row 4 Jan @ 10:54am 
so they are the cyan ones then?
NextKuromeThe76Soldier  [author] 4 Jan @ 10:46am 
yellow becomes the square you look at, its a highlighter
Skid Row 4 Jan @ 10:44am 
fencetops are the yellow ones?
Skid Row 3 Jan @ 5:00pm 
good guide:steamhappy:
John Fortnite 16 Jul, 2022 @ 5:11pm 
i will probably be to lazy to do this with the navmesh editor, but atleast i know how to make a bad navmesh on a map that doesnt have one
NextKuromeThe76Soldier  [author] 25 Jun, 2022 @ 3:45pm 
decompile a map and place info_node entities everywhere using the hammer editor
John Fortnite 25 Jun, 2022 @ 3:25pm 
how to make nodes?
⋆ ˚。 Megurine Luka ౨ৎ˚ 7 May, 2022 @ 4:00am 
Finally