Fritzbot ET Basic Waypointing

From Bots-United Wiki

Jump to: navigation, search

This article forms the second section of the FritzBot ET waypointing tutorial. If you are looking for the RTCW tutorial go Here.

THIS ARTICLE IS UNDER CONSTRUCTION. IF YOU WANT TO HELP FEEL FREE TO USE THE DISCUSSION PAGE. OTHERWISE PLEASE COME BACK LATER

Contents

[hide]

The Node HUD (Heads-Up Display)

So you entered /draw_nodehud 1 as mentioned in the previous section. And to the middle right hand of your in-game screen a text list like this appears;

Image:node_HUD.jpg

Now lets explain what each of the above options mean.


NODE NUM: = Each navigation node has an unique ID number. This number is displayed above the node itself (see pic below). The number in the HUD is the for the node closest to you.

NODE FLAGS: = A node may have a logical flag value to tell bots how to behave as they approach it. A value of 0 means that the node has no special flags set and the approaching bot behaves normally. (We will learn more about flags later.)

NODE GROUP: = A non-zero value is used to group certain Nodes together. The script system can then make the group available for bots to use. The default is zero (no group). (More later...)

NODE ENTNUM: = Map objects that can change during the game are called entities and have a unique number. Neighboring nodes that need to reference those entities (e.g. Spawn Flags) have their entnum set to match the number of that map object. The default value for all nodes for this option is 1023. (More on this later...)

NODE TEAM: = This indicates which team can initially use this node. A value of 0 means the node is open to both teams. (We will learn more about this later).

NODE RADIUS: = This is the radius of the sphere that the node covers. You can see the projected area that the node covers when you set the display to show the radii spokes (see image below). A general default value is 70 but you can change the default radius. (See section III for more on node radii.)

NODE CONNECTIONS: = This displays which nodes the nearest node connects to. It does not tell you which nodes connect to it in the opposite direction. If you have made a mistake this helps to troubleshooting incorrect paths between nodes.

Creating Nodes

"The routes of a thousand points begin with a single step, '/node_add'"

That is not exactly what Lao-Tzu said but if he had waypointed bots he too would have had to add his first navigation node. And that is the way. Since actions hints and routes depend on navigation nodes the nodes get placed first. Generally I like to place most of the nodes in an area before adding any of the actions, and the routes I leave until much later.

You can add nodes either as a spectator or after joining a team. The latter is generally best since the nodes you add you place at normal play height. You can always switch to spectator when a node has to go someplace where you cannot remain standing still (mid-air, a slippery slide etc.)

To place your first node in our example join et_slide as an Allied team member (engineer is best). Generally you start placing nodes from where you spawn since the bots need their nearest node to be less than 500 units from any and all spawn pads. In our example there are two ways out of the spawn (slide and ladder) so place your first node where you could go straight to either exit. When in position open the console and type

/node_add

and then enter. A red spindle should appear at your position. Back up and take a look at it and the green number above it (one greater than the last node in this map). Review the values in the HUD. Note that the flags are zero, team is zero and radius some value (possibly 70).

Image:Etslide_NodeAdd1.jpg

Generally the next node you would place would be 1-3 seconds away as the bot runs, but sometimes you will put them closer to reflect something in the map. So in our example walk to the top lip of the slide without going over the edge. Now add your next node there. Back off again till you can see both of your nodes.

Image:Etslide_NodeAdd2.jpg

(Side note: If you are waypointing a large map you may have to be careful to not place nodes too close in general. A waypoint has a maximum of 1024 nodes)

Creating a Path between Two Nodes

Now 2 nodes with no connections do not form a path. So for the Allied bots to be able to get to the slide there must be at least a one way connection leading from the first node you placed to the second. In our example that is from node 34 to node 35. So at this point in our example open the console and type

/node_connect 34 35

and enter. A white line should appear going from the top of node 34 towards the bottom of node 35.

Image:etslide_1waycon.jpg

This line is the graphical representation for a connection or path. But this path only allows the bots to go one way, and waypoints should use two way connections wherever possible. So in the console again, type

/node_connect 35 34

and enter. Now there are two white lines crossing in the middle. This means the bots may go in either direction between these nodes.

Image:etslide_2waycon.jpg

Now as you add more nodes you will have to connect them logically so the bots can move about. Later you will want to connect some nodes like 3 and 4 way intersections. Just remember a node can only have 4 connections going out from it. But we will discuss this again later.

Be careful not to accidentally (or purposely) connect two nodes that are too far apart. The bots have a safety time out. If the bot can't get to the next node in about 2.5 seconds it may give up and look for a new nearby node and path to follow. And think to place the nodes in a way that mimics natural human movement. Avoid 90 degree turns when space allows for say 45 degrees. Like Humans, bots want to take the shortest distance so allow for that. Bots don't know to take cover, so path along the place you would move, protected by that edge, or roof etc.

Now almost all paths need to use 2 way connections. But it is a lot of typing to enter 2 node_connect commands for every node added. And binding node_connect to a key is not useful (you cannot specify the changing node nums). But there is a single command that will doubly connect the just-added node to the previous node. And this command /node_autoconnect can be bound to a key.

TO BE CONTINUED

Disconnecting Node Paths

So you made a mistake or want to make a change to remove a connection path? Maybe you want to remove a node and correct the node connections to and from the other nodes. Well the console command to delete a connection is just like the connect command with "dis" prefixed;

/node_disconnect <start_node> <end_node> 

where <start_node> and <end_node> are replaced by the 2 connected node's ID numbers.

Suppose there is a 2 way connection between nodes 0 and 1 and you wanted to delete the connection path starting at node 1 and ending at node 0. Open the console and enter /node_disconnect 1 0 and then press enter, and voila, one path deleted. Now as an exercise in our et_slide example try disconnecting the path from 34 to 35. Notice the connect left is coming back from the slide. Well that was a silly thing to do right? We can't go backwards up the slide. So go back and reconnect the two as you did at the beginning of Creating a Path between Two Nodes .

Special note: Unfortunately FritzBot allows you to make a mistake and repeat a connection between the same 2 nodes. The duplicate connection then limits how many more connections can be added. A single use of /node_disconnect <node #> <node #> will delete both of these identical connections. You then have to repeat the original node_connect (one time only) to reconnect the nodes.

Moving Nodes

Sometimes you will want to slightly adjust the center of a node to correct how the bots approach it. Other times you may want to disconnect it and re-use it somewhere else in the map. In the former you don't need to disconnect the connections with other nodes, while in the latter it is best to do so before moving the node. When you are ready to move the node, note the node number (lets say it is node 176) then walk\fly\etc. over to the new position, open the console and type

/node_move 176

(or whatever node number you are moving) and hit <enter>. The node disappears from its old position and is center on your position dragging with it any remaining connections.

Deleting Nodes

Since node numbers are used elsewhere in the waypoints and script system it would be too awkward to actually delete nodes and renumber the rest. So at present the only way to delete nodes are to delete all of them. This is not really a problem since nodes not needed can be re-used elsewhere or disconnected and moved to a place bots can not get to. If you use the latter option to store unused nodes in a disused location you should also ensure that they do not impact on the game performance. Open the console and enter /node_team 1 -1 and press <enter>. This will make node 1 is unavailable to every bot, axis or allies. The internal code and bots will now ignore this node. This way it does not use up resources and it's the only thing you can do to get rid of single nodes that you can't reuse.

The better suggestion is try to re-use the node you plan on deleting. Try not to create a massive collection of nodes you don't plan on using. Instead just use caution when placing nodes, so you don't place too many unused nodes.

Now let's say you decided to delete EVERY single node on the map. Naturally you could do this by deleting the .nav file for the map. But to avoid having to reload ET and the waypoints you can use /node_clear. This command is dangerous to accidentally use and the fact that it leaves the actions and routes alone is not much value because actions and routes all have attributes that use node numbers (and are therefore wrong after node_clear). So DO NOT BIND A KEY TO THIS COMMAND! and in general I recommend you do not use this command ever if you can avoid it.


Node Info

The HUD display gives all the waypointing information needed for the node you are closest to. However if you wanted information on some other node you would have to move to that node's position for the HUD to update. Instead of moving you can just query for the information in the console; Example

/node_info 25

then <enter> will display the information similarly to the HUD.

Image: et_slide_node_info_console.JPG

To test a different node use a different <node #>. Note: just like the HUD the connection information is for paths exiting the node not entering the node.

There is a related command

/g_node_info <node #>

where in our previous example <node #> would be 25. This gives the current gamestate information for that node, that is the attributes loaded when the match started and possibly later modified by a scriptable game event. But more on that in a later lesson on scripting.

Node Draw Distance

Drawing the nodes etc. on the map takes some of the processing power of your PC. To allow for a cleaner and quick operation the editor only draws those waypoint nodes etc. that are within a set distance of your position. With older PCs this helps reduce the graphics lag when play-testing with the editor on.

The command

/node_drawDist 345 

creates an invisible bubble of radius 345 around you. Those nodes, actions, routes and connections fully within this bubble are those that may then be drawn in the display. The smaller the radius the smaller the number of items to display and the lower the demands on your PC. Values between 128 and 1024 generally work well. Values above 1024 may be problematic, and values below 128 are pretty useless.

One of the useful things about this command is you can use it to help you evenly space the nodes you add. I generally use /node_drawDist 256 on smaller maps placing the nodes while walking backwards. The next node in an open area then gets added at the point where the previous node just disappears making the distance about 256 between them. On very large maps I may use a larger setting of up to 512. node_drawDist values above 512 I mainly use for just reviewing the waypoints.

Saving waypoints

You should save your work often, and also make backups periodically so you are not dependant on one copy of your files. Mistakes do happen, ET may crash, computer hardware may fail. To save your current work, open the console and type

/node_save 

and hit enter. Note the editor must be enabled and your current work displayed. If your work is not displayed it may not actually be loaded in which case you would be overwriting your previous file with a blank waypoint!

The /node_save command writes a single file automatically named <mapname>.nav, <mapname> being the name of the map you are in (/g_mapname displays your current mapname). This file is written to the subdirectory ~\fritzbot\bots\maps\ . If a previous copy exists in that path it will be overwritten (with no warning!). And if you used /node_clear you may not want to save just yet so BE CAREFUL. If you forgot to backup recently it may be a good idea to switch to Windows explorer to do a quick copy of the file to a backup directory (And if you run ET in a window then switching back and forth between Windows and ET is simply alt-tab).

Console Command Quick Lookup

/node_add = Adds a navigation node at your current location.

/node_connect = creates a connection (path) between two nodes. (ex. /node_connect 0 1 creates a one-way path from node 0 to node 1, entering /node_connect 1 0 afterwards changes the one way path to a two way path between node 0 and 1.)

/node_move <node #> = Moves the location of the given node to your current location. (Ex. /node_move 1 moves node 1 to your position)

/node_team <node #> = specifies which team may use this node initially.

  • Note: /node_team -1 = Makes the given node unavailable to every bot no matter which team, we'll get into this command more later (ex. /node_team 1 -1 makes node 1 unavailable to each team)

/node_clear = Deletes every single node on the map. (Use with caution!)

/node_info <node #> = Displays in the console, saved waypointing information on the specified node

/g_node_info <node #> = Displays in the console current waypointing information on the given node. (ex. /g_node_info 1 displays node 1's properties in the console) The current information includes dynamic information from playing the game that is not saved.

/node_drawDist <0-1024> = Sets the editor's drawing distance for your nodes, actions, routes and connections. Nodes etc. that are further away from you are not drawn. (Ex. /node_drawDist 256 sets your waypointing draw distance to 256). This command does not affect the HUD display.

/node_disconnect <node #> <node #> = Deletes the connection path between the two specified nodes. (ex. /node_disconnect 1 0 deletes the path leading from node 1 to node 0)

/node_save = Saves all the nodes, actions and routes including their attributes for the current map.

Next Tutorial

There are a few test questions you can try for review Here (I suggest you open it in a new window or tab)

Alright, now that we've covered the easy stuff, let's move onto the more complex stuff. Actually it isn't too hard but can be tricky. To continue the tutorial go to FritzBot_ET_Intermediate_waypointing.

Further Reading

Credits

Special thanks go to Denny for his RTCW tutorial on which this article is modeled and borrows from.