Garry's Mod
2,700 lượt đánh giá
Navmesh Optimizer
5
7
5
8
2
8
2
6
4
2
3
3
3
3
2
2
   
Giải thưởng
Yêu thích
Đã yêu thích
Bỏ thích
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun
Kích cỡ file
Đã đăng
Đã cập nhật
110.712 KB
21 Thg10, 2022 @ 6:03pm
22 Thg07 @ 4:13pm
67 ghi chú thay đổi ( xem )

Đăng ký để tải xuống
Navmesh Optimizer

Trong 3 bộ sưu tập tạo bởi SkullWagen
My Bigger Projects
30 vật phẩm
[CFC] Hunter's Glee
394 vật phẩm
[CFC] Map Sweepers
98 vật phẩm
Mô tả
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
Thảo luận nổi bật Xem tất cả (6)
68
31 Thg05, 2024 @ 12:22pm
Report Issues Here
Zeb
5
27 Thg02, 2024 @ 8:46am
questions
Pyxel Perfect
1
9 Thg11, 2022 @ 10:58am
Before I get this, one question.
⭒sirconcept⭒
487 bình luận
Ozcar 28 Thg10 @ 6:27pm 
Isn't there a command that can remove the nav areas that aren't supposed to be there (like the blocked area)?
GOBLIN MAN 22 Thg10 @ 3:05pm 
nav_mark_walkble_auto doesn't mark anything on some maps
Davidbr4zuc4 15 Thg10 @ 7:02pm 
crashes some maps
SkullWagen  [tác giả] 13 Thg10 @ 8:08pm 
Not automatic
ThePickledOne 13 Thg10 @ 7:10pm 
does it optimize automatically or do you have to run the command?
¬_IDFK_~ 29 Thg09 @ 6:01am 
So with regular command, you need to save it to make sure it isn't deleted (I think), so will this save on the map on it's own or what?
NOOB 27 Thg09 @ 7:22am 
how do I turn off the scannner after using "nav_generate_cheap_expanded"?
DELTA_HELLJUMPER 25 Thg08 @ 1:00pm 
hai strawWagon :]
Freef 22 Thg08 @ 8:58am 
I absolutely love this addon. Great work!
Ethosaur 11 Thg08 @ 9:01pm 
Thanks :DS_Upgrade: