Overview
If you're unfamiliar with nodes, know that they're important for playing SMOD because they map out all the places that NPCs can move through, climb to and so on. Without nodes to follow, NPCs will simply stand in place and bore you to death. The Nodemaker tool featured in SMOD almost functions as a streamlined interface for Source's map_edit mode, wherein you can create and link nodes for a map in real-time.
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.
Setting Up
Before doing much else, you'll be using a few choice console commands. It's best if you put these all in a CFG file so you can just execute that instead of entering them in one by one.
give weapon_nodemaker // Gives you the Nodemaker tool.
give item_suit // Helps you move around easier.
ai_nodes // Allows you to see where nodes are placed
ai_nodes // and displays a tiny bit of information about each.
ai_show_connect // Allows you to see connections between ground nodes.
ai_show_connect_fly // Allows you to see connections between air nodes.
ai_show_connect_jump // Allows you to see connections between jump nodes.
ai_show_hints // Allows you to see hint nodes.
ai_moveprobe_jump_debug 1 // Allows you to see NPCs' "moveprobes" when using jump nodes.
Also relevant:
- ai_snl_save
Saves the map's node setup to your mapadd directory as an .snl (SMOD node list) file. These files will have to be moved to mapadd\nodes to apply.
Normal saves will not save your node data.
Ground Nodes
The map used in this and the next few sections will be dm_powerhouse from HL2DM. This map was chosen because it has ladders, parts where jumping is more useful to the NPCs, and is unlikely to have SMOD nodes already in place, but feel free to try any other map. Execute the batch of commands above so that you'll have the Nodemaker and can fully see the nodes interacting with one another. Once you're set, spawn a citizen (npc_create npc_citizen) so that you can see your nodes in action.
Now, face the floor and use the primary fire key. You should see a green cube appear with some numbers above it.
This is a ground node, used to let grounded NPCs like antlions or rebels know where and how to move around. Right now, if you try to order your companion any significant distance, you'll notice that they'll just stand still and look at you funny. Ground nodes are the way to fix that.
Below, I have a hall that I want to order my companion across, but can't because there aren't any nodes to be found. To remedy this, you would have at least a pair of linked ground nodes between the two. To begin you might fire at the floor to make a node, then run across the hall to place the next one.
Once you have the two, you would use secondary fire to select one, then use primary fire on the other to link them. Once they're connected, the companion can make it across just fine on his own:
That's about the short and long of ground nodes and their links. Other things to note:
• Connections between nodes can hypothetically be of any length, so long as their paths aren't broken up by walls or other permanent obstacles. NPCs will usually make their way around cars, crates and similar objects without problems.
• If you're willing to take the time, more linked nodes usually make NPCs' movement more fluid and unpredictable, while also improving their ability to find suitable cover. A plus to making soldiers a bit more challenging.
Intro to Hints (Cover Hints)
A variant of the ground node that you can use is a "crouch node", a normal ground node with a hint node attached. In this case, the hint will advise your NPC to treat an area as low cover, and they can duck down when they're in this spot. Below you can see a low wall that the companion could huddle next to.
After perhaps placing some nodes along the higher walls to the sides, you would use your reload key to switch to crouch mode. Once you pick a spot along the low wall (close, but not too close) and fire, you see a ground node and inside it, a dark blue hint node. Continue creating crouch nodes along the wall and link them while still in crouch mode. Once that's done, link the rest and that should be that.
If you were to try ordering her to the low wall right now however, she would just stand in place; keep in mind that hints are suggestions, not strict orders. To better persuade her to take cover, you could spawn an Overwatch soldier further down the room with his back turned. As you can see, she thinks twice about standing straight with one around.
Other tidbits on cover hints:
• Keep in mind that NPCs may follow hints from previous nodes for a while. The companion above has crouched behind the much taller walls, before realizing she's outside the soldier's line of sight.
• The hint type you've created in crouch mode is #101 for low cover, where about 40 units of vertical space should cover the NPC's head. Use the impulse 90 command to get trace positions from the floor and the top of the cover, so you can see how tall in units it is.
• For taller bits of cover, you could change this type to #100 for medium cover (~100 units). See the editing section below.
Jump Hints
Aside from a basic ground graph, you can also set jump hints for NPCs that can jump such as soldiers or citizens. These typically will be used to hop across gaps or hop down from broken staircases and the like. This author will be using them to get his companion to make his way to the opposite side of the room. Below, a look at where I want him to be.
First, you'd use your reload key to switch to jump mode, and then fire. While still in jump mode, connect the jump node with a ground node up top, then switch to ground mode and connect the same pair of nodes again. After that, our man should be able to jump around to his heart's content.
Below, I've linked the jump node to a few more ground nodes and then repeated the process for a slightly different jump. Success!
Small things to keep in mind about jump hinting:
• Just because you've connected two nodes across a giant canyon doesn't mean the NPC will make the jump. In fact, the NPC won't even attempt it and will see it as a faulty connection. A good rule of thumb when gauging distance is to see if you can make the jump at normal speed. By the same token, NPCs will also skip jump hints that would hurt them.
• You can instead use un-hinted ground nodes so long as you link them the same exact way as jump hints.
• Antlions and aces don't need jump nodes, thanks to their AI. They may have trouble navigating if there aren't ground nodes on the new surface, however.
Climb Nodes
If you've ever played through Ravenholm, you're bound to remember a few occasions where the faster zombies have climbed up pipes to reach the roof of your building. Climb nodes play a significant part in this, marking where the zombies begin climbing and how far up they should go. In this case, we'll be teaching a zombie how to use a ladder to chase us.
Be mindful that it can be tricky getting a climb path set up just right but persistence (and a few .snl saves) should see you through. Below you can see the ladder to dress up for the zombie.
Before laying down some track, use the mouse wheel to change the 0 near your crosshair to a 10. This will add an offset of 10 units to your node's spawn position, keeping the climb nodes a small distance from the ladder.
Next, hit the reload key until you've switched to climb, then aim for the middle of the ladder's base and fire to create a purple climb node. Climb to the top of the ladder and carefully place another climb node, ideally lined up with the one below so that the zombie won't turn to its side during the climb.
After that, you can switch to ground mode and link the top climb node with a ground node on the ladder's side. Back in climb mode, link the two climb nodes together, switch back to ground, and link your last two nodes. Now once you spawn a fast zombie (npc_create npc_fastzombie) and get his attention, you should see him climb up successfully!
Pointers on climb nodes:
• Ideally, zombies at the end of their climb will only climb out forward of the ladder or they may fall back down. In this example, if you were directly behind the zombie as he finished coming up, he'd take too long trying to face you and start to plummet.
• If left with no other option, zombies can also climb back down to give chase.
Air Nodes
The map shown in this section is gpk_orangecity, a user-created Garrysmod map, chosen because it's simple and large with plenty of airspace and no NPCs or other live distractions, but any large and open map should do.
Air nodes are used to guide flying NPCs around the map, including the big, bad strider. The usual method of setting down air nodes is slightly different for a simple reason: there's no surfaces in the air to fire nodes at. It's otherwise straightforward though, so gear up your noding CFG and then use noclip so you can fly around the place.
Once you're ready, hit your reload key until you switch to air mode and your use key so you see the words Direct Target. Whenever you use the Nodemaker to lay down a node while in this mode, the node's origin will be your position instead of whatever you're pointing at. You still use the mousewheel to offset the node's position, and can switch back to Trace mode by hitting the use key again.
Anyway, from this mode you can create a series of air nodes with ease by flying around the map and placing them like you would ground nodes. Just create nodes wherever you're hovering, then select them by touching them and link them up like you normally would, minding that you allow a little space from buildings or other obstacles; air NPCs can be big and aren't guaranteed to be graceful.
Some small things to know about air nodes:
• Gunships don't make use of air nodes, instead using path_tracks. You can see Working With Dropships about how to setup tracks in a mapadd script.
• Striders will need to have their air nodes set up with hint #904 (strider node). See the editing section below.
Out-Of-Game Editing
Not everything can be done from within SMOD, so in some cases you'll want to manually edit the node list using a text editor. It's definitely helpful here to have a text program like Notepad++ that will number the lines for you.
Editing Hints
To demonstrate, I'll go back to dm_powerhouse using an .snl file containing crouch hints. Say I wanted to change all the hints that mark low cover, to instead mark medium cover. For that, I'd run the map and then walk over to the node, noting the numbers on top. These show the node's ID (25) and its normal offset (z:4), and for the hint, its type (101) and node it applies to (25).
After making a copy of the .snl file I'd open it up in N++ and find line #26 (node numbering starts at 0), where I'd replace the second part, 101 for low cover, with 100 for medium cover. The same technique can be used for other purposes, like marking certain air nodes for use with striders by replacing 000 with 904.
Editing Links
So you're about to finish meticulously laying out nodes for a map and - whoops - you linked two nodes you really didn't want together. Unfortunately, you don't have any recent backups, and redoing everything just to fix one link sounds nuts. This is usually not a problem but if need be, it's not difficult to fix.
If I wanted to disconnect the node from the last section, I'd grab the node's ID and this time look at the link list (where everything is preceded by an L), getting rid of any links involving 025. Unlike nodes themselves, links can be deleted without making the game crash.
Spare The Nodemaker
As useful as the Nodemaker is when given time and know-how, it's not usually the most efficient tool for the job. That title belongs to nav_generate, which can be used to automatically create a complex map of nodes that would take an eternity for a user to create and link together on their own, saving them a good deal of time and frustration. See Generating AI Nodes.
For the most part, you should be using the Nodemaker to patch up or add to a generated node graph. For example, an automatic graph for gm_construct can skip over parts of the map, including the walkway that starts by the large open-roof building.
Customization |