Generating AI Nodes

Overview

While the Nodemaker can be used to create a node list for AI to navigate maps with, it's usually better to make those nodes automatically through the console to save you time and frustration from human error. This short and sweet article is here to detail the process for you.

It can be helpful while going through this page to run SMOD in a window so you can quickly and easily switch back and forth.
You can do this by right-clicking on it in your Steam games menu, choosing Properties, choosing Set Launch Options, and adding -window.

How-To

Creating A Navigation Mesh

  • You can skip this step if the map you want to node already has a .nav file.

Start by opening up the console and type in nav_generate and you should see the words Generating Navigation Mesh and Sampling walkable space. Generation usually takes several minutes and slows the game to a crawl, so feel free to do other things during it.

You'll know it's finished when you see Generation Complete! shortly before the .nav file is saved to your maps folder and the game restarts the map.

Converting The Mesh

Once the map has a mesh to use, it can be turned into something more useful to our NPCs with the command nav_converttoainode. This process will take far less time than generating a mesh and once finished, you should see a large map of linked nodes if you've used the ai_nodes and ai_show_connect commands. The .ain file will be saved to your maps folder.

Saving To SMOD Format

Once all the nodes are made and linked, you can save them in SMOD's .snl format to to your mapadd folder. Mind that for the list to apply, it'll have to be moved to mapadd\nodes\.

Notes

  • The generated nodes will all be without hints, but those can be edited in through the .snl file.
  • Air nodes will usually be generated but climb nodes are never generated and must be done by hand.

Handling Errors

  • If while creating a mesh, you get an error (No valid walkable seed positions. Cannot generate Navigation Mesh), you'll likely have to hand-node the map with the Nodemaker. Larger maps are thought to have these problems more often.
    • An alternative and faster workaround is to manually mark walkable areas for the .nav generator to work with. Aim at the floor and type the console command nav_mark_walkable. Nav_mark_walkable marks an area for adding nodes. An example would be a 2 story building. Adding a nav_mark_walkable at the first floor will not necessarily mean that the upper floor will be noded. So keep that in mind, and add nav_mark_walkable on every "section" of the map (Floors, houses, hills, roofs, places with height differences) but keep in mind that you can never have too many. But try to place them sensibly. Once you are done, bring up the console and type nav_generate. This will create a navigation file using the information from the "nodes" you have placed manually. After this, follow the usual steps to turn the navigation file into an AI mesh.
  • If while converting the mesh to AI nodes you get an error or the game crashes, this is most likely a problem when connections are automatically made between nodes. If you think you have the patience for it, you can disable the auto-linking by setting nav_converttoainode_nolink to 1 and link these hundreds or thousands of nodes together with the Nodemaker. Some if not most will find hand-noding preferable to this.
    • An error can also occur if an .ain file is already present. Counter-Strike: Source in particular has .ain files with no useful data in them that can cause this problem.


Customization

Mapadd Command Reference (Non-LUA)Command Reference (LUA)Getting StartedPorts 'n' Doors
Alarm, Alarm!Color Correction in SMODDoor BreachingMobile APCsWorking With Dropships
Supply Drop (LUA)Countdown (LUA)
kh0rn3's Mapadd Generator
Scripts addcontentsoverride_classsmod_custom_explosivesmodaclistSMOD Soundscripts

npc_gib_modelnpc_replace_modelnpc_shieldsetnpc_weapon_randomizenpc_weaponweight

excludeweaponsweapon_categoryweapon_customConsole Command List
Other Crosshair CustomizationGenerating AI NodesUsing the NodemakerSubViewCam
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License