Navmesh Optimizer
On big maps, this can mean tens of thousands of navareas merged.
(And MUCH more!)
Each box is a singular navarea, there’s nearly a dozen of them on this curb alone.
They’ve all been combined into bigger navareas.
As you can imagine…
HOW TO USE?
If you just want to optimise a navmesh, run…
This command will automatically run the merging process, losing all of the precalculated visibility data between merged areas and their neighbours. To fix this, a nav_analyze will be run when the merging process is over.
This will start the dreaded "calculating navmesh visibility…" and as you can imagine, will take a very long time.
Once the nav_analyze finishes, the optimized navmesh will automatically save, and your session will restart!
After letting this command run it’s course, a map’s navmesh will be ready to share.
Expect area count reduction of 20-50%
Nigh-INSTANT navmesh generation ( with 1000% less crashing! )
Incrementally generates a navmesh, dynamically places seed locations in walkable areas across the map. Navareas will cover the entire map, rooftops, inacessible areas, sometimes even the skybox.
Basically a ‘Nuclear Option’.
This will never really "miss" a spot, like the default generator always, always does, but expect to have to cut corners after it’s done generating! ( or at least, if you need a truly, "polished" result… )
Clone of the above, nav_generate_cheap_expanded. Inital seeds are only placed under players
Tells you if a map’s navmesh is "cheap" or not.
Places generation seeds under every spawnpoint, door, teleporter exit, ladder dismount point.
As i said above, this is automatically used by generate_expanded and both generate_cheap variations
Places seed positions under every player’s feet.
I added this because nav_mark_walkable doesn’t work in dedicated servers.
Goes through the entire navmesh, and removes tiny areas with >3 connections that are on displacements.
Best used after globalmerge_auto. Leaves small holes in the navmesh, but on huuuge maps with lots of displacements this can probably help with nextbot lag while losing very little of real importance.
Happy navmeshing!
GLua Globals ( for addon developers! )
isCheap = getNavmeshIsCheap()
Returns true if the map’s navmesh is cheap!
validMerge, mergedSurfacearea, createdArea = navmeshAttemptMerge( area1, area2 )
Attempts a navmesh merge between two areas!
( in my experience, can crash sessions if nextbots are spawned & pathing when this is ran )
validMerge, mergedSurfacearea, createdArea = navmeshAutoAttemptMerge( navArea )
Automatically runs navmeshAttemptMerge beween navArea and every one of it’s neighbors.
+Hooks that expose the seed position tables for modification
( Ctrl-f in the code, examples are next to every hook, )
& Finally..
Some related reading… Hunter’s Glee