WolfBot Waypointing

Created : 24.8.2003 16:32
Author : Torben "kaji" Könke
Email : kaji@planetquake.com

http://www.planetwolfenstein/wolfbot/

Overview

1. Getting started

  • 1.1 What are Waypoints
  • 1.2 Waypoints in WolfBot
2. Waypoints
  • 2.1 Placing a simple Waypoint
  • 2.2 Deleting a Waypoint
3. Objective Waypoints
  • 3.1 Bomb Objectives
  • 3.2 Steal Objectives
  • 3.3 Capture Objectives
4. Paths
  • 4.1 Creating a Path between two Waypoints
  • 4.2 Deleting a Path between two Waypoints
5. Waypoint Flags
  • 5.1 MG42 Flag
  • 5.2 Door Flag
  • 5.4 Camp Flag
  • 5.4 Axis Unreachable Flag
  • 5.5 Allies Unreachable Flag
  • 5.6 Deliver Flag
6. Path Flags
  • 6.1 Jump Flag
  • 6.2 Crouch Flag
  • 6.3 Walk Flag
  • 6.4 Blocked Flag
  • 6.5 Ladder Flag
7. Reachability
  • 7.1 Reachability Flags
  • 7.2 An Example
8. WPS Files
  • 8.1 Loading a WPS File for Editing
  • 8.2 Saving Waypoints to a WPS File
9. Console Commands
  • 9.1 wp_load
  • 9.2 wp_save
  • 9.3 wp_place
  • 9.4 wp_delete
  • 9.5 wp_connect
  • 9.6 wp_disconnect
  • 9.7 wp_objective
  • 9.8 wp_setflags
  • 9.9 wp_setpathflags
  • 9.10 wp_dumpflags
  • 9.11 wp_cleanup
  • 9.12 wp_rendermode
  • 9.13 wp_menu

 

1. Getting started

1.1 What are Waypoints

Waypoints are spots the bot uses to navigate through the map. They help the bot to avoid obstacles such as crates or barriers and travel through areas of the map without running into walls.
Bots with sufficiently advanced waypoint information and algorithms would be able to find the shortest distance between points in the map and navigate from their current position to some Waypoint on the other side of the map.

1.2 Waypoints in WolfBot

WolfBot Waypoints are rendered in game as floating numbers. Every Waypoint is portrayed as a unique number ranging from 0 to 1023 (allowing up to 1024 waypoints in total). Paths between Waypoints are rendered as thin lines.

Waypoints and Paths can have several attributes set that tell the bot how to behave in certain situations. A Camp Waypoint for instance would be used by the bot if it had the desire to camp or hide.

Have a look at these screenshots :

Waypoints in WolfBot  

 

2. Waypoints

2.1 Placing a simple Waypoint

Generally when creating waypoints for a map it's a good idea to just start a LAN game in devmap mode. This way you can fly through the map in noclip while placing and connecting waypoints.

Now bring down the console by hitting the ~ key and type "/wp_menu" without the quotes. A Menu will appear on the left of the screen looking like this :

For now we're only interested in the first option "1. Place Waypoint". To place a Wolfbot Waypoint hit the '1' Key on your Keyboard. The Waypoint will be created at your players current position in the map.
Each Waypoint is assigned an index number counting from 0 up until it encounters an empty slot.

Alternatively you can also use the console command "wp_place" to place a waypoint.

A second Menu will pop up on the right displaying information about the waypoint you just created. The Menu always displays information about the waypoint closest from your current position.

A few things you should keep in mind when "waypointing" your map :

  • don't place waypoints to close to each other *
  • 1024 is the upper limit of Waypoints for a map
  • don't place waypoints too far away from each other
* it just unnecessarily slows down the bots navigation algorithm

2.2 Deleting a Waypoint

Walk up to the Waypoint you wish to delete until it becomes highlighted. Now bring up the Waypoint Menu (if not already) and hit '7' on your Keyboard.
This will delete the currently highlighted waypoint as well as all paths to and from this waypoint.

Notice all subsequent Waypoints will be moved down one slot.
Say you have 10 Waypoints (ranging from 0-9) and you delete Waypoint 7 , Waypoint 8 becomes 7 and Waypoint 9 becomes 8, making 9 the next free slot.

Alternatively you can also use the console command "wp_delete" to delete a waypoint.

 

3. Objective Waypoints

Objective Waypoints are special waypoints that help the bot dealing with map objectives such as blowing up map goals or stealing enemy documents.

3.1 Creating a Bomb Objective Waypoint

Bots will consider this Waypoint as an Objective Goal. Engineer bots will attempt to arm dynamite when reaching this Waypoint.

Bring up the Waypoint Menu and hit '2' (Place Objective). In the next menu select Bomb (1) as Objective Type.
Now the Waypoint needs to be linked to the func_explosive brush that is linked with the Wolfenstein Map Objective (i.e. the func_explosive that is supposed to be blown up).
This is done by facing the func_explosive brush , it should then be outlined as shown in the picture below :

Press OK and select the Team this objective is for. In the next menu you can specify the priority of the Objective; Generally you should give it a high priority if it's a primary map objective and a low priority if it's a secondary map objective.

Finally you have to link the Objective Waypoint to the corresponding Wolfenstein Map objective Number. If you are unsure about the number, bring up the RTCW Limbo Menu and hit the objectives Tab to get an overview of all map objectives as well as the objective numbers.

3.2 Creating a Steal Objective Waypoint

Bots will consider this Waypoint as an Objective Goal. A Bot will attempt to pickup enemy object when reaching this waypoint.

Bring up the Waypoint Menu and hit '2' (Place Objective). In the next menu select Steal (2) as Objectve Type. Now in the following menu select the Team that is supposed to steal the object.

Finally, again, you have to link the Objective Waypoint to the corresponding Wolfenstein Map Objective Number.
If a bot is carrying the enemy documents it will try to reach a Deliver Waypoint. Go here to read how to create a deliver Waypoint. There has to be atleast one deliver Waypoint for a Steal Objective Waypoint.

3.3 Creating a Capture Objective Waypoint

Bots will consider this Waypoint as an Objective Goal. A Bot will attempt to capture a near checkpoint if reaching this waypoint.

Bring up the Waypoint menu and hit '2' (Place Objective). In the next menu select Capture (3) as Objective Type. Now in the following menu select the Team that is supposed to capture the checkpoint in its initial state.

Link the Objective Waypoint to the corresponding Wolfenstein Map Objective (see above).

 

4. Paths

A Path is a connection between 2 Waypoints indicating the second Waypoint can be reached from the first Waypoint. The Bot uses these paths to travel between Waypoints.

4.1 Creating a Path

Walk up to the Waypoint you wish to create a path for and select the "Connect" Option from the Waypoint menu (3). The menu should now look like this :

Now walk to the second Waypoint , press OK, and select the type of path you want to create.
'Single Way type' will create a Path from the first waypoint to the second while 'Both Way type' will also create a path from the second waypoint to the first waypoint. Usually you will want to create Both Way Paths (2).

If everything worked out you should see a message saying "Path created" and a white line between the 2 Waypoints indicating the path between them.

4.2 Disconnecting a Path

Walk up to the Waypoint you wish to delete a path from and select the "Disconnect" Option from the Waypoint menu (4).
Now walk to the the second waypoint , press OK, and select if you want to delete the paths in BOTH direction or only in a single direction.

 

5. Waypoint Flags

Waypoints can have so called flags assigned to them, these flags provide the bot with information about the waypoint and its environment.

If you turn on a flag in the waypoint menu , it stays active, meaning every waypoint you create will have this flag assigned, until you turn it off again.
To set Waypoint flags bring up the waypoint menu and select "Set Flags" (5). In the next menu just select the flag you want to flip. Flags that are currently turned on are highlighted in green.

5.1 The MG42 Flag

A Waypoint should have this flag if it's near a MG42 entity and you want the bot to use the Mg42.

5.2 The Door Flag

a Waypoint should have this flag set if it has a path that is going through a door entity ( func_door, func_door_rotating or script_mover ).

If you turn on the door flag in the menu it will ask you for a Waypoint index. If the door opens on touch or activate just press OK, if the door on the other hand can only be opened through a button or some sort of lever, you have to let the bot know where this button is so it can open the door :

With the menu still active walk to the waypoint closest to the button that opens the door and hit OK. Make sure the button is VISIBLE from this waypoint and is not TOO far away.

5.2 The Camp Flag

Bots will consider this waypoint as a good spot to camp or hide.

5.3 The Axis Unreachable Flag

Refer to 7.Reachability.

5.4 The Allies Unreachable Flag

Refer to 7.Reachability.

5.5 The Deliver Flag

If a bot is carrying the enemy documents it will try to find and reach a DELIVER Waypoint, i.e. the spot where the stolen object needs to be taken in order to complete the objective.

To Place a Deliver Waypoint , bring up the "Set Flag" Menu, select "Deliver Flag" and specify the Team the delivery waypoint is for.

 

6. Path Flags

Just like Waypoints, Paths can also have certain flags set.
To set Path flag, bring up Waypoint menu select "Set Flags" (5) and select "Set Path Flags" in the next menu.

6.1 The Jump Flag

Bot will jump when traveling on this path. Jump paths are rendered as a thin RED lines.

6.2 The Crouch Flag

Bot will crouch when traveling on this path. Duck paths are rendered as a thin BLUE lines.

6.3 The Walk Flag

Bot will walk when traveling on this path. Walk paths are rendered as thin YELLOW lines.

6.4 The Blocked Flag

A Path should be marked as Blocked if it's blocked by an obstacle that can be DESTROYED by the Bot. Most of the time this would be a func_explosive as for instance the beach barriers in mp_beach. If the bot comes along a blocked path it will attempt to destroy the blocking entity.

6.5 The Ladder Flag

Bots will consider this path as a ladder and try to climb up/down.
Be sure the path is not perpendicular to the ground plane but a bit sloped :

how it should NOT be done   how it should be done

 

7. Reachability

Reachability flags come into play if certain parts of your map are unaccessible for a team. The bots need to know they can't head for waypoints in this location until the area becomes accesible for them.

7.1 Reachability Flags

There are two reachability flags , one for each Team. Have a look at the example to understand how to use them.

7.2 An Example

We'll be looking at mp_beach here :

It's impossible for the Allies to get into the axis' bunkers until they have breached the sea wall. The Axis on the other side can't get down to the beach. We need to let the bot know which places can be reached from the beginning and which places can first be reached if certain events have taken place.

The waypoint system allows you to link up to 4 func_explosive entities to a waypoint and have the bot first go for it if one of the linked func_explosives was blown up.
So, in mp_beach you would mark all Waypoints on the beach as unreachable for the axis team and link these waypoints to the sea wall and the sea door func_explosives whereas the waypoints in the axis bunker system would be marked as unreachable for the allies.

To do this bring up the "Set flags" menu (5) and select "Unreachable" (6). In the following menu select the appropriate team. Now the menu should look like this :

Next we have to link the two func_explosives;
Just as you would do when placing a bomb objective waypoint, walk up to a blocking func_explosive and face it. Once it becomes outlined hit "Set" (1). This way you can link up to 4 func_explosives.
If you don't need all 4 slots , just hit 2 when you're done.

Sea Wall   Sea Wall Door
Done!

 

8. WPS Files

WPS is the file format used to save the waypoint data. The current File Version is 1.0.

8.1 Loading a WPS File

To open an existing WPS file for editing bring down the console and type "/wp_load filename" whereas filename is the name of the file with the .wps extension (for example : wp_load mp_beach.wps)

8.2 Saving a WPS File

To save your waypoints to a WPS File you can either use the waypoint menu or the console command directly. In the menu hit 8 ("Save"), the game will then attempt to save the data to a file with the same name as the BSP filename, i.e. if the map name was mp_assault.bps the WPS file would be named mp_assault.wps.
If the file exists already the menu will ask if the existing file should be overwritten.

The console command syntax is as follows "/wp_save filename" whereas filename is the name of the output file.

Notice the game expects the WPS file to have the same name as the BSP file.

 

9. Console Commands

If you prefer to use console commands instead of the ingame menu , here is is a short description of every waypoint console command :

9.1 wp_load

Parameters : Filename
Description : Loads in a WPS file for editing.

9.2 wp_save

Parameters : Filename
Description : Saves Waypoints to a WPS file.

9.3 wp_place

Parameters : NONE
Description : Creates a waypoint at the players current position.

9.4 wp_delete

Parameters : NONE
Description : Deletes a Waypoint and all paths from and to it.

9.5 wp_connect

Parameters : From, To, Type
Description : Creates a path between two waypoints. Pass 1 for type for a single way path , 2 for both way path.

9.6 wp_disconnect

Parameters : From, To
Description : Disconnectes two waypoints.

9.7 wp_objective

Parameters : Team, Type, Priority, Number, Target
Description : Creates an objective waypoint at the players current position. See ingame description.

9.8 wp_setflags

Parameters : Index, Flags, Cond1, Cond2, Cond3, Cond4, Cond5
Description : Sets flags for a waypoint. See ingame description.

9.9 wp_setpathflags

Parameters : From, To, Flags
Description : Sets flags for path from [from] Waypoint to [to] Waypoint.

9.10 wp_dumpflags

Parameters : NONE
Description : Dumps a list of all waypoint and path flags with a short description.

9.11 wp_cleanup

Parameters : NONE
Description : Deletes all waypoints and paths.

9.12 wp_rendermode

Parameters : Mode
Description : Sets the render mode for waypoint editing.

pass 1 for mode to display waypoints but no paths.
pass 2 for mode to display waypoints and paths (DEFAULT).

9.13 wp_menu

Parameters : None
Description : brings up the ingame waypoint editing menu.