Garry's Mod

Garry's Mod

2,591 hodnocení
Navmesh Optimizer
4
6
4
7
6
6
3
2
2
2
2
   
Ocenit
Přidat do oblíbených
Oblíbeno
Odebrat z oblíbených
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun
Velikost souboru
Přidáno
Aktualizováno
110.712 KB
21. říj. 2022 v 18.03
22. čvc. v 16.13
Poznámky ke změnám (67) – zobrazit

Klikněte na „Odebírat“ pro stažení položky
Navmesh Optimizer

V 3 kolekcích od uživatele StrawWagen
My Bigger Projects
30 položek
[CFC] Hunter's Glee
382 položek
[CFC] Map Sweepers
95 položek
Popis
Optimises navmeshes by finding and merging neighbouring areas.
On big maps, this can mean tens of thousands of navareas merged.

(And MUCH more!)


As you can imagine...
You will have much less lag running nextbots on an optimized navmesh.



HOW TO USE?

If you just want to optimise a navmesh, run...
navmesh_globalmerge_auto
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%



Some extras!

Nigh-INSTANT navmesh generation ( with 1000% less crashing! )
nav_generate_cheap_expanded
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... )


nav_generate_cheap_plyseeds
Clone of the above, nav_generate_cheap_expanded. Inital seeds are only placed under players


navmesh_ischeap
Tells you if a map's navmesh is "cheap" or not.


nav_mark_walkble_auto
Places generation seeds under every spawnpoint, door, teleporter exit, ladder dismount point.
This is automatically used by generate_expanded.
nav_mark_walkble_allplayers
Places seed positions under every player's feet.
I added this because nav_mark_walkable doesn't work in dedicated servers.

navmesh_trim_displacement_areas
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.

navmesh_trim_deepunderwater_areas
Removes areas under water that is X or more units deep.
Default 350 units deep.

navmesh_delete_allareas
Helper func, removes all areas.


Ladders!
navmesh_ladderusable_build
Creates a navmesh ladder on top of the nearest func_useableladder.

navmesh_ladder_buildmanual
Create a navmesh ladder anywhere.

navmesh_ladder_buildmanual_snap
Like navmesh_ladderusable_build, but allows for the changing of JUST the height of the top/bottom

navmesh_ladderusable_showall
navmesh_ladderusable_tp
Helper funcs for finding func_usableladder(s)


Happy navmeshing!


Extras

GLua Globals ( for addon developers! )
isCheap = getNavmeshIsCheap()
Returns true if the map's navmesh is cheap!

isCorrupt, corruptedRatio, corruptedAreas = navmeshIsCorrupted()
Returns true if >25% of the map's navareas are outside of the playable space, or high up off the ground.
Can happen if, for example, a navmesh was generated for a map with the same name as the current one.

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:
navoptimizer_done_gencheapexpanded
Ran when nav_generate_cheap_expanded/plyseeds is finished.
navoptimizer_done_globalmerge
Ran when the globalmerge commands are finished.

+Hooks that expose the seed position tables for modification
( Ctrl-f in the code, examples are next to every hook, )



& Finally..
Github [github.com]
Some related reading... Hunter's Glee
Populární diskuze Zobrazit vše (6)
68
31. kvě. 2024 v 12.22
Report Issues Here
Zeb
5
27. úno. 2024 v 8.46
questions
Pyxel Perfect
1
9. lis. 2022 v 10.58
Before I get this, one question.
⭒sirconcept⭒
Počet komentářů: 478
Ethosaur 11. srp. v 21.01 
Thanks :DS_Upgrade:
StrawWagen  [autor] 11. srp. v 20.45 
dude, you make awesome maps
thank u bro, glad i could help
:steamhappy:
Ethosaur 11. srp. v 15.43 
This has saved me so much time for my big maps,thank you :steamhappy:
Arckonte 10. srp. v 13.00 
I'm a bit new to this; does the optimized navmesh stay with the map or do I have to execute the command in console every time I boot up the map?
坤坤国王 30. čvc. v 19.40 
Some of the map team NPCs are too far away and won't follow me. Is this due to the so-called "grid navigation" issue? Can your mod fix this?
shackledlee 28. čvc. v 15.05 
ah, thanks. not sure if this increases the generation speed but atleast this way (i hope) it does not generate out of bounds as often
StrawWagen  [autor] 28. čvc. v 11.50 
generate cheap places one round of seeds, expanded never stops placing them until it's tried everywhere
shackledlee 28. čvc. v 10.57 
even after reading the changelog and a bit of the code, i still dont really understand the difference between nav_generate_cheap_expanded and nav_generate_cheap. because funnily enough, when playing on a map with a "teleport lobby" (examples are gm_mobenix, rp_amsterville and a lot of maps made by RileySV as he tends to use this so called lobby i am talking about). when using nav_generate only the lobby gets filled with navmesh, making the process INCREDIBLY fast, but of course the main map is just ignored completely, meanwhile nav_generate_cheap DOES include the main map, even if i never included a nav_mark_walkable in that area. so how does it work? does is still place some seeds? i assume a lot less entities than nav_generate_cheap_expanded but in the end, it did generate on the whole map and i havent placed a single mark walkable.
BecQuerell 26. čvc. v 9.22 
@LSD Dreamer, NAH you just have to restart the map when using "navmesh_globalmerge_auto" after making a navmesh. But it will do it automatically
LSD Dreamer 26. čvc. v 4.59 
Do I have to restart the map after saving the navmesh/ running "nav_generate_cheap_expanded"?