NNBot Waypoint Guide
- Based on the Botmans HOWTO_waypoint.txt

What Is A Waypoint?

Waypoints are locations in the maps that the bots will use when navigating. They allow the bot to roam about the map without having to blindly bump into walls. Waypoints can be thought of like the bread crumbs in the Hansel and Gretel story. They are something marking a path to make it easier to follow. The waypoints are not displayed while the game is being played. The bots "know" which way to go by following the path laid out by these waypoints.

In order to get the bots to cover the entire map when playing the game, waypoints should be laid out all over the map. Without the waypoints the bots will just randomly run around and will tend to stay in the same area. Waypoints also allow the bot to know where specific goals are in the game.

This page describes the commands needed to create or edit a waypoint file with the bot. When creating or editing a waypoint file it is best NOT to have any bots wandering around at the same time. Having a single bot on the map can sometimes help verifing the layout of the waypoints, but if you change a path(look below), the game might crash. Create a LAN game, and join using one team or the other, kick all bots (if any) and lay out waypoints for a map. Save the waypoint file, add some bots to see how well your waypoints are located.


What Do Waypoints Look Like In The Map?

The waypoints are displayed using vertical lines that look like lightning or electric streams. Each team has its own set of waypoints. The waypoints are draw in different colors to distinguish between teams. Ter. (team 1) waypoints are drawn in blue. CT (team 2) waypoints are drawn in red. The vertical line used to draw the waypoint is the same height as the player. The point in space at the center of this vertical line is what is actually used as the waypoint.

To create waypoints for a specific team, you must join the game using that team. You can display waypoints for just your own team, or for both teams, but you can ONLY edit waypoints for your team. If you wish to change waypoints for the other team you will have to switch teams and then edit the waypoints for that team.

Waypoints are stored in a file with the same name as the map file name but using the extension ".nwp" instead of the map file extension of ".bsp". For example, the waypoint file for the map de_nuke would be de_nuke.nwp (it will be stored in the Half-Life\cstrike\maps folder where the de_nuke.bsp file would be). Waypoint files are automatically loaded when the map is loaded (if they exist), after this a algorithme calulates all the possible paths automaticaly (see the "makepaths" command). If the waypoint file does not exist, you will need to create it using the directions contained on this page.


Waypoint Console Commands

The following Waypoint commands are available (note these ARE case sensitive):

"waypoint on" - Turns on displaying of waypoints for the player's team.
"waypoint off" - Turns off displaying of all waypoints.

"waypoint 1 on" - Turns on displaying of waypoints for team number 1.
"waypoint 1 off" - Turns off displaying of waypoints for team number 1.

"waypoint 2 on" - Turns on displaying of waypoints for team number 2.
"waypoint 2 off" - Turns off displaying of waypoints for team number 2.

"waypoint add" - Adds a waypoint at the current player location.
"waypoint add path" - See the description at the bottom of this page.
"waypoint add bomb" - See the description at the bottom of this page.
"waypoint add defuse" - See the description at the bottom of this page.
"waypoint add camp" - See the description at the bottom of this page.
"waypoint add hostage" - See the description at the bottom of this page.
"waypoint add return" - See the description at the bottom of this page.

"waypoint delete" - Deletes the waypoint nearest to the player (see below).

"waypoint save" - Saves the current waypoint list to a file (see below).
"waypoint load" - Loads the waypoint list from a waypoint file (see below).

"waypoint stats" - Shows the number of waypoints currently used by each team.

"drawpaths" - Enables the drawing the pathlines (see the makepath-command)..
"dontdrawpaths" - Disables the drawing of pathlines (see the makepath-command)..
"drawuse" - Enables the drawing of the use of the pathlines (see the makepath-command)..
"dontdrawuse" - Disables the drawing of the use of pathlines (see the makepath-command)..
"makepath" - Algoritme calculates the possible paths for the team. These are shown as bright lines between the waypoints. Every path has a different height. This command is run automaticaly when adding or deleting waypoints, and at map start. Paths being used it shown as green line.

To use the waypoint commands, you will have to use the console. You must start the game with the console option enabled (use "hl.exe -console" in the Target: line of a shortcut or use "Half-Life Console" in your SIERRA menu from the Windows Start button). Use the '~' key to bring down the console. Enter the console commands that you wish, then use the '~' key again to return to the game.

You can make things easier by binding console commands to keys on the keyboard. Just type "bind" followed by the key you want to bind to, followed by the console command. You will have to use double quotes on the console command if it's more than one word. Here's an example of console commands that I use when editing waypoints...

bind a "waypoint add"
bind d "waypoint delete"
bind l "waypoint load"
bind w "waypoint save"

The 'a' key will manually add a waypoint. The 'd' key will delete a waypoint. The 'l' key will load the most recently saved waypoint file (useful if you have added some waypoints but don't want to save them and want to go back to the previously save waypoint list, sort of like an "undo"). The 'w' key (for "write waypoints") will save the list of waypoints to the waypoint file. I tried using 's' (for "save waypoints"), but I kept hitting 's' by mistake when I wanted to add or delete a waypoint.

Using "waypoint add" will place a waypoint at the location that the player is currently at in a map. Waypoints can be placed anywhere the player can go. Waypoints can even be placed in mid-air (as long as the player can get to that location). One way to do this is by jumping or running off of a ledge or cliff. If you want bots to jump off of ledges or buildings, you will need to place a waypoint in mid-air to get the bots to run towards it. When placing a waypoint, you will hear a sound to indicate that the waypoint has been dropped (the sound is the same sound the crossbow bolt makes when striking an wall).

Using "waypoint delete" will remove the waypoint closest to the player. The waypoint MUST be within 40 units from the player (about 1/2 the player height) in order to be removed. You will need to stand fairly close to the waypoint to be able to remove it. This prevents you from accidentally removing a waypoint on the other side of the room. When removing a waypoint you will hear a sound indicating that the waypoint was removed (the same sound the tripmine makes when placed on a wall). You can ONLY remove waypoints that correspond to the team that you are currently playing on.

Using "waypoint save" will save the waypoint lists (of all teams) to the waypoint file. The waypoint file will have the same name as the current map with an extension of ".nwp". The file will be in the same directory as the map file (in the maps folder).

Using "waypoint load" will clear out all waypoints in the current map and load them from the waypoint file in the maps folder. This is a good way to "undo" a bunch of waypoints that you have created but do not wish to save. There is no way to "undo" a single waypoint. You will have to use the "waypoint delete" command to remove waypoints one-by-one.

Using "waypoint stats" will tell you how many waypoints currently exist for each team.

When adding waypoints you can use the "drawpaths" command to verify that waypoints are actually reachable. Usually you don't have to be too careful about waypoint placement, but in some situations, you may have to spend more time carefully laying out waypoints to get them to be "reachable".

Try not to place too many waypoints too close together, this just slows the game down and really doesn't serve any purpose. Try placing waypoints at intersections in hallways and try to avoid placing waypoints too close to walls or ledges (the bots have some slop in how close they have to get to a waypoint to be considered "touching" it). Try not to place waypoints in places where the bots would bump into corners of walls or other obstacles when trying to get from one waypoint to the next.


Things You Need To Know!!

When a bot has to got some a special destiantion e.i. "camp","hostage" or "return" it random pick one of the paths having such a waypoint in it. After this the bot calculates which paths is should use to get to that path, based on where it is standing.

The use of a path finding algoritme means that you dont have to think so much in making paths for the bot since it will calculate its own, and you can always tjeck if the waypoint will be use right by looking on the "path-lines" (see the makepath-command). You should focus on placing waypoints in intersections, doorways and such!!

Max number of paths is 30 per. team!! Max number of waypoints is 40 per. path!! This totaly makes 1200 waypoints.. But dont use that many..!!

When a map has waypoints for a map, "autousing ladders" is turned off. So If you want a bot to use a ladder, you must make a waypoint on the bottom of the ladder and one on the top. You should look on how I did this in cs_assault. It is sometimes difficult to make this work, but it can be done! The nnbot will soon get a special ladder waypoint which will make this alot easier..

If you want a bot to use a button you must place a waypoint near it (at least 100 units). It can be difficult to make the bots use the button in a intelligent way, especially when dealing with multible bots.

When a bot has visited a "hostage","bomb" or "defused" waypoint they return to a random "return" waypoint.

When the path finding algoritme tries to find a waypoint path for the bot it starts with the destination, and tries to work it's way back to the bot.

The bots dont know how to shoot breakable object as glass yet, but this problem should be solved soon.

The bots isn't to happy about crunching into a vent, this problem should be solved soon.

If a bot gets stucked because it can't reach a waypoint placed e.i. on a high box, it will try to make a duck-jump to get up there..

You can put the waypoints as far from eachother as you like, as long as notthing blocks the line of view between the waypoints. This is where the NNBot's waypoint system differs from most other waypoint systems. This bot dont need so many waypoints.
If you forget to place the right destinations waypoints in a map e.i. "camp","hostage", and always at least one "return", the bots will wander around like there were no waypoints at all..


The Different Types Of Waypoints

Normal Waypoint
The normal waypoint is used to create a path between the diffent destiantions!! It adds a waypoint at the current player location.

command: waypoint add
Path Waypoint
Algoritme chose a random path between the paths that ends/starts at the point, to get to the wanted destination. This way the bot dont always pick the same route...

command: waypoint add path
Hostage Waypoint
This waypoint tells the bot where to find hostages.

command: waypoint add hostage
Bomb/Defuse Waypoint
The bomb waypoint tells the bot where to plant bombs. The defuse waypoint is a dummy destionation for the bot. The bot would always try to defuse a ticking bomb nomatter where it finds the bomb.

command: waypoint add bomb
command: waypoint add defuse
Return Waypoint
When a bot has visited a "hostage","bomb" or "defused" waypoint they return to a random "return" waypoint.

command: waypoint add return
Camp Waypoint
Right now campers always crunch at a "camp" waypoint this will change!

command: waypoint add camp
Camptarget Waypoint
If a camping bot can see any of this kind of waypoint, it picks one randomly and aims at this for a few sec's before aiming at the next one.

command: waypoint add camptarget
Ignore Waypoint
This waypoint is used with doors and such.. If you want a bot to be able to use a door in both directions you have to place a "ignore" waypoint on both sides of the door. Otherwise the algoritme cant "see" the waypoint on the otherside of the door. "ignore" simply ignores the fact that the waypoint cant be seen from the previus waypoint.. A pair of "ignore" waypoints MUST be closer than 100 units to eachother (a player is 72 units high)!

command: waypoint add ignore

NNBot's Homepage