View Full Version : Tutorial on how to create waypoints for TFC's FoXBots

24th February 2014, 03:44 PM
To make a FoXBot waypoints, I've downloaded the FoXBot v0.77 Linux builds and added this into my [/common/Half-Life/tfc] folder and made sure my [liblist.gam] got the [metamod.so] loaded in [gamedll_linux] line. I then load TFC Linux client on Steam and used [Create Server] to make a listenserver online from my PC.

Now in order to control the bots and menus on making waypoints, I made a empty file as a .cfg file named as fwp.cfg that contain this text:

// Waypoint Key Binder For FoXBot .. -=Last Modified 8-02-2006=-
// These are the keyz that will be bound ..

bind "=" "waypoint on"
bind "-" "waypoint off"
bind "INS" "waypoint add"
bind "DEL" "waypoint delete"
bind "s" "waypoint save"
bind "m" "waypoint menu"
bind "i" "waypoint info"
bind "l" "waypoint load"
bind "[" "autowaypoint on"
bind "]" "autowaypoint off"
bind "PGUP" "pathwaypoint on"
bind "PGDN" "pathwaypoint off"
bind "/" "pathwaypoint create1"
bind "\" "pathwaypoint create2"
bind "HOME" "pathwaypoint remove1"
bind "END" "pathwaypoint remove2"
bind "F11" "bot_debug on"
bind "F12" "bot_debug off"
bind "F3" "pathwaypoint_connect on"
bind "F4" "pathwaypoint_connect off"
bind "F5" "locate_waypoint on"
bind "F6" "locate_waypoint off"
bind "F7" "Pathrun_oneway"
bind "F8" "Pathrun_twoway"
bind "F9" "Waypoint_author YOURNAMEHERE"
bind "F10" "exec config1.cfg"

// This section prints the info out into the console ..
// So that you can PGUP & PGDN to see each keyz function ..

echo "=-....-=Waypoint Keyz Loaded For FoXBot=-....-="
echo ""
echo "= waypoint on --> Turns On Waypoints."
echo "- waypoint off --> Turns Off Waypoints."
echo "INS waypoint add --> Adds a waypoint at the current player location."
echo "DEL waypoint delete --> Deletes the waypoint nearest to the player."
echo "s waypoint save --> Saves the current waypoint list to a file."
echo "m waypoint menu --> Displays a menu for setting tags on a waypoint."
echo "i waypoint info --> Shows information about the current waypoint."
echo "l waypoint load --> Loads the waypoint list from a waypoint file."
echo "[ autowaypoint on --> Turns on autowaypoint setting."
echo "] autowaypoint off --> Turns off autowaypoint setting."
echo "PGUP pathwaypoint on --> Turns on the pathwaypoint setting."
echo "PGDN pathwaypoint off --> Turns off the pathwaypoint setting."
echo "/ pathwaypoint create1 --> Sets the first waypoint in a manual path."
echo "\ pathwaypoint create2 --> Sets the second waypoint in a manual path."
echo "HOME pathwaypoint remove1 --> Sets the first waypoint in removing a path."
echo "END pathwaypoint remove2 --> Sets the second waypoint in removing a path."
echo "F11 bot_debug on --> Bot tells you current location of it's problem."
echo "F12 bot_debug off --> Turns Debug Off."
echo "F3 pathwaypoint_connect on --> Turns on automatic path connection to a waypoint."
echo "F4 pathwaypoint_connect off --> Turns off automatic path connection to a waypoint."
echo "F5 locate_waypoint on --> Turns waypoint location on."
echo "F6 locate_waypoint off --> Turns waypoint location off."
echo "N/A locate_waypoint <number> --> Best use spectator mode for this."
echo "F7 Path run 1 way ==> Connects waypoints in direction you run 1 way"
echo "F8 Path run both ways ==> Connets both ways when running"
echo "F9 Waypoint Author ==> Add's your name to waypoint file"
echo "F10 Restore config ==> Done waypointing, restore original config.cfg"

In order to use this config you need to press [~] key and type "exec fwp.cfg", but be warned as this may erase your binds like for "say_team [%H|%A] Flag Dropped!" After you exec the fwp.cfg, make sure that waypoint is ON!

For rats this map is quite basic and quite easy to make as you don't need to insert flag locations, goals and various tags, but for this map the best thing to insert is the normal waypoints by using [autowaypoint ON] and using waypoint menu to plot the Actions for Sniper vantage points in the shadows and near the dark passageways and behind props, but nowhere near to a place for snipers to be over-exposed. Under this image is the Sniper Action post and where the armour/battery can be traced for bots.


In order to insert the Sniper Action spot, you need to use [waypoint menu], but it has to be where you are on the vertical light located directly, in order for the menu to work.


Once you got the GUI menu loaded up, press [4] then [3] where it says "Sniper" and the crossbow sound will occur - hey presto!



Note: FoXBot 0.77 for TFC SteamPipe won't work unless you rename in /tfc/dlls/ tfc.so as "tfc_i386.so" as the API isn't programmed to locate for the newer tfc.so SteamPipe Engine and don't let TFC Linux Client automatically update TFC.

Basic Waypointing
First, I'm going to assume that you know how to get access to the console in the game itself. If you don't know how to do this then check the help file that came with the bot download.

Step 1: Add the waypoint foundation.
The first thing you need to do as a waypointer is to lay the framework for the waypoints in a level. Do this by starting a multiplayer lan game by yourself. Make sure that you DON'T allow any bots to join the map while you are waypointing. If you do they will be stuck in the respawn areas and the game can possibly crash. Assuming the map is a standard 2 team CTF map, join the game as blue team first and run around the map and add as many waypoints as needed to cover all the areas of the map that the bot will need to navigate through. This is probably the easiest part of the waypointing process. Here are some things to keep in mind or look for.

1. Only place waypoints and paths where needed. It is best to keep the waypoints as clean as possible. This will reduce the calculation times that the bot takes to figure out routes.
2. Check all waypoints for paths you don't want. Especially when using pathwaypoint_connect on.
3. Only place waypoints where a bot might need to change direction. In long straight areas there is no need to place alot of waypoints to form a straight path. Place 1 waypoint at each end of the long path/hallway and manually connect the waypoints with paths.
4. When placing waypoints around corners, make sure that paths do not try to cut the corners too much, especially if the path line itself cuts through the corner. Bots can and most likely will get stuck if your paths cut the corners too much.
5. If the map you are waypointing has a small respawn room with several entrances and you notice the bots getting stuck on each other, try creating 1 way paths in and out of the respawn so that the bots will enter in one door and exit the other to reduce getting stuck on each other.

2fort respawn room

This is a simple setup for the 2fort respawn room. The waypoint with the red circle around it has a blue team specific tag on it, as well as health, armor, & ammo flags. The path coming into the respawn on the upper right is 1 way and the path exiting the respawn room is also 1 way. Notice that the entrance and exit paths are centered and form a kind of loop. Since the respawn room is pretty small and has all you need to resupply, I put all the tags and the team specific tag on the single waypoint. Waypoints are treated as navigation goals only, providing a point that the bot will travel to in search of health ammo and armor. The bots have a search function that is able to locate things around them laying around such as the flag and dropped backpacks. The waypoint setup in the above pic is preferred over placing a ton of additional waypoints on top of each health and armor pack. In reality, even when the waypointer puts a bunch of waypoints on health and armor kits, the feature of the bot that actually picks them up is the search feature. In the pic above, the waypoint tags will bring the bot in the room and since the room is small, the bots search function will be what it uses to pick up the stuff in the room before resuming its navigation. This method also cuts down on the number of waypoints and keeps the layout simple.

Remember, the fewer waypoints there is, the faster the calculations can be made.

Place the waypoint tags.
This step can be done while you are doing step 1 or separate.. it doesn't matter. This just involves going through the map to place all the necessary "tags" on all the waypoints that need them. For those that don't know, tags are various things that can be placed on a waypoint to give it special features that the bot would use to perform certain actions at that waypoint.

One of the most important waypoint tags you will use is the team specific waypoint tags. These tags can be used with any other type of flag to make it so that only a certain team can use the waypoint. Here is a list of the current tags available through the ingame waypoint menu.

Waypoint Tag Whats it do?
Team Specific Only allows bots from specified team to use. Team1=Blue, Team2=Red....
Wait for Lift Used when setting up lift waypoints. more later
Door Used for special type doors. more later
Sniper Spot Used to set a waypoint as a place to snipe from. Mostly used with team flags
Flag Location Used on waypoints that are on the flags.
Flag Goal Location Used on waypoints that are on goal locations
Health,Armor,Ammo Used on waypoints near health, ammo, armor. All 3 can be used on 1 waypoint
Jump Bots will jump when approaching this waypoint.
>Defend(sg) Bots will build sentries or defend at this location. more later
point1, point2, .... Used in capture and hold style maps. Scripts are required to utilize these tags.

Personally, I find it easiest to add the waypoint tags as you make the waypoints. If you place the waypoints and then try to come back later to add the tags, it is very easy to miss some.

Here is a list of things you should be aware of and keep in mind when you are putting tags on waypoints.

Make sure that all health, armor, and ammo packs have team specific waypoint tags on them if they are located in a respawn room or another place that would be inaccessible to the other team.. or if they are unable to be picked up by one of the teams.
Make sure that Defend(sg) tagged waypoints also have team specific flags on them so engineers from each team will only use certain ones.
Make sure sniper points have team specific tags on them if you only want them to be used by a certain team.
Door waypoint tags will rarely be used. If you are waypointing in a map where there is a door that opens very slowly and find the bots are having trouble try door tag on the waypoints on each side of the door. This will cause the bot to slow down to give the door time to open. This tag doesn't get used much but it is there if needed.
When you place a sniper tag on a waypoint make sure YOU are facing in the direction you want the bot sniper to face when using it. You will see a small line next to and near the top of the waypoint. This small line represents the direction the bot will face when standing on the waypoint when sniping. See pic below.
When placing lift waypoints, you must place the wait for lift tag at both the bottom and the top waypoint on the lift. More on this later.
Sniper point.

Optimize your waypoints

An important part of your waypointing is optimizing your waypoints. This is basically running through your level and deleting unneeded waypoints and fixing paths that aren't quite right. Heres some things to look for when optimizing.

Make sure paths don't cut through corners or try toconnect to higher unreachable places.
Make sure there are paths to and from the flags and flag goal locations that travel both ways.
Make sure your sniper waypoints face the right direction.
Make sure you have health, ammo, and armor waypoints set where needed. Also check their team specific tags if needed.

Testing your waypoints

The most important part of waypointing is by far the testing. It is best to test certain aspects of the map separately from others. The main areas that need to be tested are the paths to and from the flag and goal locations, sentry points, and sniper points.

First, test the flag and flag goal location paths. Do this by adding a couple scouts to blue team by typing "addbot 1 1" in the console. Go into spectator mode and watch the bots as they run through the level. They should fairly quickly get to the enemy flag when there is no opposition. Keep spectating them after they get the flag until they get back to the capture point. Be on the lookout for areas that the bot gets stuck briefly so that you can fix them later. If you notice the scouts wandering around their base and never going for the enemy flag, the problem is that there is a broken path somewhere so they cant get to the enemy flag. The same goes for the paths back to the flag goal location. If you notice the scout grab the enemy flag and immediately start acting wierd or wandering around then chances are there is a broken path somewhere along the way back to the flag location.

Remember that not all paths are bi-directional, and that it may look like a path is connected when you check from one waypoint but if you check from the other there might not be a path. Sometimes these problems can be difficult to find. In the future the waypoints and waypoint paths will be color coded so you can better spot one-way paths and other special waypoint types.

Ok, once you have tested the blue scouts ability to grab and capture the flag on their own, execute a kickall in the console and add a couple scouts on the red team. Once again watch them for problem areas and to make sure they can get to the flag and then back to the goal again. Once you have verified the paths for both teams like that, kick all the bots again. This time add about 3 or 4 snipers on each team. Cycle through the snipers for a bit to watch them go to their sniper points. They should go to their sniper points and point in the direction the waypoint is set to and stand with a charged rifle. Sometimes they don't stand too long before moving.

After you have seen the snipers in action, kick all the bots, and then add 2 or 3 engineers per team. Cycle through them and make sure that the engineers are able to build their sentry at the designated spots, resupply and go back to upgrade them.

After testing this way, make any changes you need to waypoints or paths to fix any errors you noticed during testing. Once you make your changes, save your waypoints, and restart the level.

Things to look for when waypointing.
1) Bots getting hung on walls - Make sure that the waypoints don’t cut a corner too much so that the path hits the wall, this can cause bots to get stuck.
2) Bots spinning around on a waypoint - turn bot_debug on Look to see where the blue (i think they blue?) lines are going. that represents where the bot is trying to get to. If the lines go to a waypoint that is unreachable such as one above the bot, the bot will spin. If the lines are being projected way off through the level, the likely cause is that the bot cannot reach his goal (flag) or if the bot goes and grabs the flag and then spins around the waypoint there, he is unable to find a path back to the cap point. Check ALL your waypoints throughout the level or the path to the goals to make sure there are valid 2 way paths in between them. Remember! Just because the bot can get to the flag doesn’t mean he can always get back to the cap point. With the ability to have 1 way paths, it is possible for there to be breaks at some point along the paths that effect 1 or both ways. The other thing to look for is paths that are too long. If a path is too long it is thrown out as if the path wasn’t there. When standing on a waypoint, if the waypoint the path is connected to is barely in visual range or out of visual range, then the path is likely too long. Add a waypoint in between them to create a couple shorter paths. If you are positive that all the waypoints are connected with valid paths, it is likely that you have a path that is too long. This issue should be addressed soon.
3) Bots spinning around a waypoint when I add them after I create waypoints - waypoints aren’t used until they are loaded during a map start. If you are editing or creating waypoints, when you are ready to test them, save them using the "waypoint save" command and then restart the map. The restart will then load the waypoints so that the bots can use them. DO NOT EDIT OR CREATE WAYPOINTS WITH BOTS IN THE GAME, BECAUSE IT CAN CRASH HALFLIFE.

Tweaking waypoints
1) Try to reduce the amount of paths and waypoints throughout the level. By this I mean try not to have redundant paths. Example waypoint x, y, z are all on the same path in that order. X should be connected to y and y should be connected to z to form the path. Try to eliminate duplicate paths such as x also connected to z. The fewer the paths the quicker the bots can perform path calculations and the better future versions of foxbot will work with your waypoints.
2) Set up your waypoints so that bots run into ladders head on, meaning make the path swing wide a little so they come at the ladder from the front as much as possible. Bots can get stuck if they come at the side of a ladder sometimes.
3) Make sure you add sniper points correctly. The direction of a sniper point is the direction you are facing when you put the sniper tag on the waypoint. It is often easiest when placing sniper points to place the waypoint, then face toward the middle of the area you want the bot to be watching, then place the sniper tag on the waypoint.
4) Make sure sniper, sentry, ammo, health, and armor waypoints have team specific tags on them if only 1 team is able to use them. This is very important especially with sentry and sniper tags. You wont want a bot randomly choosing a sniper point on the other teams battlements, so make them team specific.
5) If there are messages broadcasted to players in the map, consider how they could be useful to the bots and think about possibly creating a script for the map. Scripts allow a lot more flexibility to the bots by allowing you to alter their goals throughout the game by using common cues that are presented to real players, such as sounds that are played for certain events, or broadcasted messages. Scripts are what give the bots the ability to play maps such as warpath and cz2. More script functions will be added throughout development.

REMEMBER: Waypoint data is loaded at the start of a level. This is why you MUST save your waypoints and RESTART the level before you will see the results of any changes you make to the paths or waypoints.

If you don't see console messages ingame (Upper Left).. Type in console developer 1
OR right click in Steam Games Menu "Team Fortress Classic / Properties / Set Launch Options.. And add -dev ...........
Then you should see messages in upper left being displayed.

7th July 2016, 02:11 PM
Tracked down the config and found some more info about creating waypoints here: