Garry's Mod

Garry's Mod

2,026 ratings
NPC Navmesh Navigation
21
11
17
4
2
7
3
5
5
9
2
7
6
4
2
3
3
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Roleplay
File Size
Posted
Updated
109.020 KB
23 Dec, 2022 @ 10:17am
28 May, 2023 @ 4:38am
16 Change Notes ( view )

Subscribe to download
NPC Navmesh Navigation

In 1 collection by 〔cout〕➜ Brainless❓
[2]-Brainless-[4]'s mods
17 items
Description
This mod allows NPCs to use the navigation mesh as an alternative to AI nodes.
This means you can play on pretty much any map with NPCs.
All you need to do is ensure the map has a navmesh, If not you can use the nav_generate console command to generate one.

How It Works

The navigator will monitor all the NPCs in the game and detect if they want to move to somewhere. If the navigator detects that the NPC can't reach its destination, The navigator will then take control and try to guide the NPC to its destination using the navmesh.

Features

* Compatible with maps that have or don't have AI nodes.

* Customizable settings in the spawnmenu.

* You can disable the entire mod in one click of a button using the spawnmenu.

* NPCs can actually use dropdowns on the navmesh, Which can lead to some more advanced movement which they could not do easily with AI Nodes.

* A debug tool, ( Found in your tools section of the spawn menu ) This lets you preview the path an NPC is following VIA the navmesh.

Additional Information

* For better mod performance, Its a good idea to edit the navmesh with nav_edit 1 console command. ( Not required but encouraged )
This tool could help with that....
https://steamoss.com/sharedfiles/filedetails/?id=527885257


* You may notice that some NPCs may be opressive when using the navmesh.
This is because without AI nodes, NPCs have slightly reduced AI behaviour.
I have done my best to override this and keep them close to their original AI behaviour as possible.

* The Navigator pathfinder prefers smaller navmesh nodes since NPCs have a better time with smaller nodes.

* If NPCs get stuck near tight spaces, You may need to tweak the navmesh slightly with nav_edit, But normaly things should be fine.

* No, This does not support VJ Base NPCs for now... Because they use a different way of marking the destination.
Yes, Support may be added in the future.

* Also keep in mind the addon is new, So there could be bugs! If you find any, Please report them. Thank you.

For Developers

Developers can call some of my global functions in their mods if they want.

-- Make an NPC move to a point using the navmesh.
Z_NPC_SetNewGoal( npc , Vector = Position )

-- Clear an NPCs navmesh movement.
Z_NPC_ClearNavigation( npc )

-- Returns the NPCs navigator destination that the NPC is trying to navigate to. ( Not the NPCs goal ) for that use NPC:GetInternalVariable( "m_vecLastPosition" )
Z_NPC_Navigator_GetNavGoal( npc )

-- Makes a waypoint for the NPC to move to, If shouldact is true, The NPC will start moving.
Z_Navigator_SetWaypoint( npc , Vector = Position , Bool = ShouldAct )

-- Marks the current waypoint an NPC is trying to get to as reached!
Z_Navigator_WaypointReached( npc )

Credits

Zenlenafelex and [2]-Brainless-[4]

If anyone wants to make an expansion on this they can, I am a bit busy trying to step away from gmod now, So i can't work on this as much.

You may and can reupload this mod to the workshop, Providing you credit ( [2]-Brainless-[4] )
Popular Discussions View All (12)
20
19 Jan @ 1:15am
PINNED: FAQ
〔cout〕➜ Brainless❓
4
27 Dec, 2022 @ 8:40am
Are you a brain surgeon?
uncommon saucers
1
8 May, 2024 @ 5:34pm
Npcs still jump even when i turn it off in settings
how do i remove him
311 Comments
Pickle Peterson 22 Jan @ 1:01am 
my experience with this mod had lots of lag on my friends server, personally in a singleplayer save I never experienced any lag, but it appears to be very laggy in multiplayer
GOOSE3413 22 Jan @ 1:01am 
this makes the game lag
Eraclide 10 Dec, 2024 @ 5:47pm 
for some reason when i use the tool to make npcs pathfind they are fine, but when i make them follow me they go braindead
GalaKitty 24 Nov, 2024 @ 3:54pm 
I second the Extended AI Navigation question. Are they both compatible?
Man 15 Nov, 2024 @ 10:34am 
npcs lag the game when i go on a platform that they cant reach. is there any way to fix it?
Icery 8 Oct, 2024 @ 7:25am 
Node making for maps is in the past now. This is truly amazing and revolutionary. So many maps without a nodegraph now playable. Thank you.

Also for people complaining about the "bugs" it's not a fault of this add-on. Garbage navmesh will always be garbage and auto generated one needs fixes!!!
With just a few touches results are very promising.
GlassPrisms 2 Oct, 2024 @ 6:29am 
Since the jumping is a common problem already, I might as well give out a warning.

The lighthouse map in the HL2 campaign, when the first dropship lands, combines won't even come out unless this mod is disabled or deleted. Keep that in mind folks.
Mr. Enderman 22 6 Sep, 2024 @ 5:08pm 
how can i tell if its working?
Autumnis 5 Sep, 2024 @ 9:42am 
Is it possible to make npcs prefer to use a regular nodegraph, and only use the navmesh when nothing else is available?
Baby Wizard 26 Aug, 2024 @ 6:49pm 
Truly amazing!