Garry's Mod

Garry's Mod

447 évaluations
Nav Generation - A guide to using Nextbots on your favorite maps!
De roachisserie chicken
Do nextbots not behave as intended when you spawn them on your favorite maps?
This guide will fix that issue.
2
6
   
Récompenser
Ajouter aux favoris
Favoris
Retirer des favoris
Introduction
A Navigation Mesh(Nav for short) is a selection of Nodes that are placed around a map so that Nextbots can move around.

Nextbots are NPC's that use advanced AI, this typically means that Nextbots can do things most ordinary NPC's can't. (Like climbing ladders)
To use some examples:-
  • The NPC Terrorists/Counter-Terrorists in Counter-Strike Source/Global Offensive use Nextbot.

  • The hostages in Counter-Strike Source/Global Offensive use Nextbot.

  • Every form of NPC in Team Fortress 2 uses Nextbot.
    (I.E MvM robots or the boss NPC's in Halloween maps)

  • Every zombie in Left 4 Dead 1 and 2 uses Nextbot.

Now, lets move on to the next section, generating a basic Nav.
Step 1 -- Generating a basic Nav.
This section assumes you have already started your game on the map you want to generate a Nav on.

When your game has loaded, simply open the Developer console. If you haven't enabled it or else don't know how to open the console. Follow these steps:-
  • Pause the game using the ESCAPE key (Esc on most keyboards)

  • Go to your options

  • Click the advanced button

  • Tick the box that says "Enable Developer Console"

Once the Developer Console is open, simply type in the box:-
"nav_generate"

The game will pause briefly and some text will appear in the console
DO NOT UNPAUSE YOUR GAME
If you unpause, your game will lag horribly and will sometimes crash, its best just to keep it paused.

When the generation is complete, your game will reload and when you respawn on the map, you'll be able to use Nextbots.

NOTE: Generation can take up-to half an hour depending on how big and how complex the map you have chosen is. Usually though generation won't take longer than 10 minutes.

If you have a problem with the generated Nav, or else your map has a spawn room seperate from the actual map, follow the next step.
Step 2 -- You get the error "No walkable seed positions"
If you followed the section above closely, and you DON'T get this error, move on to the next step.

If you have put "nav_generate" into the console and it returns the error above. Then the solution is simple.

Unpause the game and look at the ground, (it doesn't matter where) and then re-open the console.
Type "nav_mark_walkable"

When you unpause, if you did it right, you'll see a purple triangle made out of wireframe.
Open the console once more and then type "nav_generate".

The Nav should generate now. If it generates but your map has a spawn-room that's seperate from the actual map, then follow the next step.
Step 3 -- If a map has a separate spawn-room OR if you crash when attempting to generate.
Nav-Meshes generate from the player spawn-point. Thus if the map you want to use nextbots on, has a seperate spawn-room...

...There are 2 solutions.

Solution 1 requires a lot of patience, especially if the map is a big and/or complex one.
You'll need to generate a Nav-Mesh manually.
First, begin by typing "nav_edit 1" into the console. You'll get a funny-looking crosshair.

Then while looking at the ground type into the console
"nav_begin_area"
You'll notice that the crosshair will begin to draw a square/rectangle depending on how you move your mouse.
When you've fitted the square into a portion of your map, type in the console
"nav_end_area"

Note: You might want to bind these commands to make manual generation easier and less time-consuming.

You'll need to rinse and repeat the above until every part of your map has a Nav-Mesh.

Note: The above method will only generate a SIMPLE Nav-Mesh. Meaning that nextbots will most-likely be unable to do various advanced things they can do in maps with a generated mesh.
==============================================================================
Solution 2 is much easier.
Simply browse the workshop for a custom Nav-Mesh by the creator of the map, most popular maps like gm_bigcity or gm_mobenix_v3 have separate workshop addons for the Nav-Mesh.

Warning: This solution will not work if the creator hasn't uploaded a Nav-Mesh.
Ending
Congratulations. You have successfully generated a Nav-Mesh.
This is my first fully-fledged guide and if you enjoyed it. Share or +rep it.

The purpose of this guide was to instruct and/or teach people how to generate a Nav-Mesh if they were new to the concept.

Thanks for reading!
277 commentaires
roachisserie chicken  [créateur] 16 janv. à 16h15 
this was written before the options menu got revamped, i'm not sure where it is now, but there's an enable console option somewhere, i'll edit this next time i launch gmod
Wonz 16 janv. à 11h46 
there is no Advanced option in my settings
roachisserie chicken  [créateur] 6 nov. 2024 à 9h00 
try following step 3 :)
Just 6 nov. 2024 à 8h31 
I solved the problem by deleting the .nav generated in the maps folder, and everything is now working perfectly.
roachisserie chicken  [créateur] 6 nov. 2024 à 6h06 
you generated a nav in a map with a spawn room?
Just 6 nov. 2024 à 5h26 
Hello I don't understand, the npc were working but I did a nav_generate after that, the NPC don't work anymore, they only attack when I'm stuck. I really need help
roachisserie chicken  [créateur] 18 avr. 2024 à 13h19 
some do, but i don't recommend that, as they try to generate a nav mesh while the game is unpaused, which causes IMMENSE lag
also, there's nothing to be afraid of, if your game crashes, the only thing you've lost is time
questionable 18 avr. 2024 à 5h27 
dont some nextbots automatically do this? anyways im scared to do this because ive heard alot of people get a crash from this
CharmyTheCharizard 17 déc. 2023 à 16h06 
"Uhoh! Screpps doesn't know this map. Would you like Screpps to learn it?"
That was enough for me to click "yes."
roachisserie chicken  [créateur] 8 juin 2023 à 14h58 
that's not my addon