I’ve made a few navmeshes for some massive maps, I’ve been thinking about writing a tutorial on what i’ve learned, if I don’t get around to it:
gmod will crash trying to generate meshes for massive maps, use source sdk base 2007
- install source sdk base 2007
- copy your_map.bsp to /steamapps/common/Source SDK Base 2007/sourcetest/maps
- open console, type “map your_map”
- when you’re in your level, open console again, “sv_cheats 1” “nav_edit 1”
- go around to anything “multi-level” buildings, sewers, ect. and look at the ground on each floor, type “nav_mark_walkable”, you should see a little purple cone indicating it’s been marked. (the navmesh generation is sometimes bad at stairs and ramps, this forces it to generate a navmesh for the whole level)
- once you’re sure you’ve got everywhere walkable maked, start “nav_generate”. This will take a long time, I recommend doing it over night.
Not all navmesh commands after this work in source sdk base 2007, so copy the map and navmesh back to gmod.
after the navmesh has been created (it will be automatically saved) you’ll want to look at it and potentially hand edit a few things
If the navmesh is big, be super careful to only allow nextbots to walk somewhere they can get to. If you tell them to go somewhere that the navmesh doesn’t think they can get to, it’ll kill your server’s processor searching the massive navmesh trying to find a way around. This will frequently happen in doorways. You can “hook up” two areas of your navmesh by “nav_edit 1” “nav_mark” look at another area “nav_splice”. If you want to manually create areas with “nav_begin_area” “nav_end_area”, be sure to “nav_connect” it to all the things it should be connected to, (it only connects one way, so you need to do it 2 times to connect two areas to eachother.)
Make sure you actually want all the parts of your navmesh, the generation will make a lot of things like jump zones in and out of windows that nextbots will try to use. It will also allow stuff to fall from great heights, and occasionally makes long connections between areas that shouldn’t be connected (especially down stairs)
If it didn’t create stairs correctly (it rarely does) you can create your own stairs by creating an area and marking it as stairs with “nav_mark_attribute STAIRS”. Be sure to “nav_save” after you do, it might decide you placed stairs badly and un-mark the stairs. If you’re haveing trouble with your nextbots using small steps, make sure their step height
CLuaLocomotion:SetStepHeight attribute is set.
Give a wide birth to little bits and corners of the map. “nav_mark” then where the white line is “nav_split”, if you overdo it by accident, you can “nav_merge”
Remeber to “nav_save” often.
Fuck this was longer than I meant it to be.