To Create a Waypoint File
Contents
Part 1 - Path Creation
Introduction
Starting with Paths
Special Waypoints
Console Commands
Part 2 - How The Bots Should Play
Map Bot Specification Files
Map.bot Commands
Part 3 - Completing the Map
Testing your Map
Making the Map More Playable
Adding a Signature
Part 1 - Path Creation
Introduction
First of all,
you will need to start tfc with console enabled (which is done by
adding the parameter '-console' to the TFC startup command line).
It is also HIGHLY recommended that you bind keys to the
commands:-
waypoint add
waypoint delete
waypoint menu
for example like this:-
bind j "waypoint add"
bind k "waypoint delete"
bind l "waypoint menu"
It's also useful to bind keys to 'waypoint stat', 'autowaypoint on' and
'autowaypoint off'.
Starting with paths
To start off, make sure
waypoints can be seen by typing 'waypoint on' in the
console. If you are using a map which already has a
waypoint file ready for it (such as 2fort) you will
suddenly see 'sticks' planted on the floor all over the
map. These are the waypoints. Assuming that we are dealing with a two-team based map, the waypoints will be white, red, blue or half-red-half-blue. White sticks are ordinary waypoints, which the bots use to navigate from place to place in the map by walking from stick to stick. Red and blue waypoints are specific to each team, and will be used in a certain way by that team, such as a point to snipe from or build a sentry. The mixed color will cause ALL bots, no matter what their color, to perform a certain action upon reaching it, such as walk slowly or press a button. So to start creating waypoints, either turn on autowaypoint to automatically add waypoints every few meters of walking, or walk around while pressing your 'waypoint add' key to manually add waypoints every so often. Try to walk through every possible route that a player can make in the map. Don't press buttons or use lifts, or stand at sniper/sentry points, we'll deal with those later. |
|
It's important to
be economical with waypoints: the more waypoints you have in a
level the more time it will take to load and the harder it will
be for you computer to run.
There is a maximum of 1024 waypoints in one level.
Having laid waypoints all over the map, use the command
'pathwaypoint on' you can see the possible routes that a bot can
take from one stick to others nearby. If a path from one stick to
another exists that you don't want to be there. You can remove it
by standing near the first waypoint, use the command
'pathwaypoint remove1' then walking to the second waypoint and
using 'pathwaypoint remove2'. You could bind these keys to
commands if you use them a lot. Likewise you can add 'missing'
paths if there are any, with the commands 'pathwaypoint create1'
and 'pathwaypoint create2'. You will find this necessary when the
bots should climb a ladder or drop off a ledge - such as 2fort
lift shaft.
Special waypoints
Next we add special
points. On each map, you will know of common positions
that real opponents snipe from or place their sentries.
Other waypoints should be placed on lifts, or near
buttons. Manually add a waypoint at these positions, then
use the key bound to wptmenu. This will present a menu on
screen which you can use to amend the waypoint. The menu
is as follows:- 1) Sniper - where a sniper may stop and take aim at the enemy team 2) Refresh - where a team should stand in order to collect armor/health/ammo 3) Defend - where a bot will defend. 4) Sentry - where an engineer would place a sentry gun. 5) Specials - we'll get back to this... 6) Visit - bots will go to this waypoint if specified to do so in the map's bot specification. They will choose one visit waypoint with that number at random to reach. This can be used to ensure that bots take alternative routes out of their base or to the flag. 7) Objective - bots will go to a particular objective if specified to do so in a map's bot specification. You can place up to nine objectives in a map. They are used at capture points, so the bot with the flag will head for the capture point once he has the flag. 8) None - remove any existing characteristics from a waypoint. It will turn white. 9) Cancel - leave waypoint unchanged. |
|
Notes
- Menus 1, 3 and 4 will present a submenu where you specify
which color team should use this point. The waypoint will change
to the team color.
- The remaining menus will turn the color of the waypoint to
'mixed'
- The specials (menu 5) are as follows:-
1) Careful, where bots will slow to a walk. Useful at the
entrance to catwalks where bots may drop off if they try to step
onto the catwalk at a run.
2) Press button, does not differentiate between teams, both will
try to press the button.
3) Get close to, bots usually follow waypoints 'loosely'. At
these waypoints they make a point of walking directly over it.
Good for buttons that players run into instead of press.
4) Jump point, Here the bots will jump.
5) Wait point, a bot of either team will stand here for a
number of seconds. A secondary menu will appear where you
can specify the wait period. Useful for lifts - after the
wait period the bot should be at the other end of the
lift, and can walk off it safely.
If you want to show a message at the beginning of the game you
can use the command:'waypoint msg message' in stead of 'message'
you can type your message. The message can be up to 62 characters
long.
The message can't contain any spaces.
'waypoint msg this is wrong' will only show "this" at
the beginning of the map.
'waypoint msg this_is_right' will show "this_is_right"
at the beginning of the map.
When all the waypoints are in place, use 'waypoint save' to
record the waypoints into a file. You may wish to do this every
so often if you can't complete the waypoints in one sitting. Then
use 'waypoint calculate' to compile this waypoint file (for immediate use
by bots - if you restart the map the compile will take place
anyway).
Console commands
Here's a
summary of all the console commands used in game to make waypoint
files.
The following Waypoint commands are available (note these ARE
case sensitive):
"waypoint on" - Turns on displaying of waypoints.
"waypoint off" - Turns off displaying of all waypoints.
"waypoint add" - Adds a waypoint at the current player
location.
"waypoint delete" - Deletes the waypoint nearest to the
player.
"waypoint save" - Saves the current waypoint list to a
file.
"waypoint load" - Loads the waypoint list from a
waypoint file.
"waypoint msg text" - Will set the text that is shown
at the start of a level.
Replace "text" with the text you want to display.
Don't use the spacebar in the text, because than it will only
show the text before the first space.
The text can be up to 62 characters long.
"waypoint init" - Removes all the waypoints from the
level.
"waypoint menu" - Displays a menu for setting tags on a
waypoint.
"waypoint stat" - Shows information about the current waypoint.
"waypoint removeflags" - This will remove the flags from all the
waypoints in the level. All waypoints turn white.
"waypoint calculate" - This will calculate the waypoint matrix
that the bots use to find
the way in the level. This is automatically done at the start of the level.
"waypoint botdebug on" - Turn on botdebug.
"waypoint botdebug off" - Turn off botdebug.
"autowaypoint" - Displays the status of the
autowaypoint setting.
"autowaypoint on" - Turns on autowaypoint setting.
"autowaypoint off" - Turns off autowaypoint setting.
"pathwaypoint" - Displays the status of the
pathwaypoint setting.
"pathwaypoint on" - Turns on the pathwaypoint setting.
"pathwaypoint off" - Turns off the pathwaypoint
setting.
"pathwaypoint create1" - Sets the first waypoint in a
manual path.
"pathwaypoint create2" - Sets the second waypoint in a
manual path
"pathwaypoint remove1" - Sets the first waypoint in
removing a path.
"pathwaypoint remove2" - Sets the second waypoint in
removing a path.
Part 2 - How the
Bots Should Play
Map Bot
Specification Files
Along with the
waypoint file itself each map has a file which dictates how the
bots will behave on that map, and perhaps which bots should be
automatically added to the game when the map is loaded. It's
called a .bot file, such as 2fort.bot
Let's look at a sample file:-
blue:
team /visit1/flag/1/
sniper /snipe/
soldier /red/
engineer /sentry/
red:
team /visit1/flag/2/
sniper /snipe/
soldier /blue/
engineer /sentry/
addbot 1-2
addbot 2-2
addbot 1-9
addbot 2-9
addbot 1-1
addbot 2-1
Now line by line:-
blue:
means 'the following commands should be carried out by the blue
team'
team /visit1/flag/1/
means 'ALL bots should randomly go to a waypoint marked as
'visit1', then grab the flag, then go to the waypoint marked to
be objective 1'. That might be confusing, until I point out that
visit1 points are AT THE BASE EXITS and objective 1 is AT THE
CAPTURE POINT.
sniper /snipe/
means 'snipers should go straight to a sniper point and take
aim'. This countermands the order that was given in the previous
line.
soldier /red/
means 'soldiers should seek out and kill members of the red
team'.
engineer /sentry/
means 'engineers will build a sentry at one of the sentry
waypoints. It will than go to the nearest refresh waypoint to get
ammo. Than it will go and upgrade the sentry. It will do this up
to 3 times. When it is done with that it will carry out the
commands with team in front of them'.
As you can see, red team has similar objectives.
Note that these commands only specify the general behavior of a
bot. They will all kill nearby enemies as a top priority, grab a
nearby flag as a second priority, etc.
You can also use 'addbot' commands in the .bot file so each map
can be tailored to include the appropriate classes for that map.
I recommend that you do this AFTER you've tested your map.
If you do this you will have to change the 'bots addfrom' setting
to "mapname".
map.bot commands
Any line
beginning with '#' in the first column is a comment line
The following commands are supported in the "map".bot
files:
1 through to 9 - the bots will visit the objective waypoint with
that number
flag - the bots will search for the enemy flag
ownflag - the bots will search for their own flag
refresh - the bot will go to a refresh waypoint
sentry - the bots will build a sentry at a sentry waypoint
snipe - the bot will go to a sniper waypoint
defend - the bot will go to a defend waypoint
red, blue, yellow, green - the bot will hunt a red, blue, yellow
or green player
visit1 trough to 9 - the bot will randomly visit one visit waypoint with that number
blue:, red:, yellow:, green: - the commands beneath this will be
for the blue, red, yellow
or green team
team - this line of command will be for the whole team
scout, sniper, soldier, demo, medic, hwguy, pyro, spy, engineer -
this line of commands will be for the specific class
--IMPORTANT-- all the commands in the commandline must be between
/ /
such as:
sniper /snipe/
Part 3 -
Completing the Map
Testing your map
When you think that
your map is ready for testing, start up the map and go
into spectator mode. Make sure that waypoints AND
pathwaypoints are on ( you can also set waypoint botdebug on )
Use the console to add a single bot
- a scout - to the game. Then follow him and see if he
manages to pick up ammo upon respawn, travel to the enemy
flag, grab it and cap it (assuming this is a straight CTF
map). You may find that the bot:- -misses out certain waypoints altogether in a linear route (i.e. a route without branches). That's just because bots try to use the shortest path to the flag as possible. These can be safely deleted. -doesn't quite get through a gap, getting stuck on the edge of it. The bot usually heads back to the last waypoint and tries again. You should adjust the positions of the waypoints by deleting them and replacing them in a slightly different place. -gets to a point where it zigzags back and forth, not knowing where to go next. In this case it cannot find an appropriate path to continue. Try manually adding a path or adding another waypoint to guide it. Once you've adjusted waypoints, save them and recalculate, and the bot will immediately adjust to the new waypoint setup, so you can see if your adjustments have worked. |
|
||
When you're happy with the flag run, manually add a sniper. Join his team and spawn as a scout. Follow him and make sure that he successfully reaches a sniper waypoint. If there are several and you want to check that he can get to all of them, turn on friendly fire (type mp_teamplay 1 in the console) and kill him. Then find him again and follow him. Do this until you are sure he can reach all the sniper waypoints. Again, adjust waypoints and recalculate if the sniper gets stuck. Sniper bots decide which sniper waypoint to use when they respawn. If it can't reach the waypoint it decided to use, it will zigzag back and forth in respawn. To force it to use a certain waypoint, turn all other sniper waypoints to neutral waypoints, save and recalculate. You can test each sniper waypoint in turn this way, then when you know they all work switch all of them on. |
|
||
Next you can manually
add an engineer. The process is much the same as a sniper
- follow him until he builds a sentry gun, then kill the
sentry gun and him using friendly fire. Check that he can
build in different positions in the map, and that he can
reach nearby refresh points to get more ammo to upgrade
and fill the sentry. Use the same method as detailed
above for sniper waypoints. |
|
||
Finally, add bots whose
purpose is to hunt out and kill the opposition, such as
soldiers, hwguys, and demos. Then level up the sides by
adding bots to the opposing team to get a good botmatch
going. When you are happy with the number and classes of
the bots you have playing, put them to the mapname.bot
file with addbot commands. |
|
Making the map
more playable
The single
biggest problem with botmatch will be that bots may use a single
route to get to and from the flag. This can lead to a stalemate
where bots meet up in no man's land, deathmatch, and get no
further. It's important to encourage bots to take alternative
routes by placing 'visit' points in the alternative routes and
use the visit command in the bot specification. On some maps you
haven't got a choice, since at the time of writing bots don't
jump onto small boxes or ledges to reach a waypoint slightly
elevated. For example on casbah the alternative routes through
no-man's land require the bot to jump onto a box or over a small
ledge.
Adding a signature
When you
consider the map to be ready for release, add your signature
message to it.
This will be shown to anyone using your waypoint file when the
map starts. Use the command:'waypoint msg message' but instead of
'message' type text of your choice. The message can be up to 62
characters long, but can't contain any spaces. Use underscore
(SHIFT-minus) in place of space.
'waypoint msg this is wrong' will only show "this" at
the beginning of the map.
'waypoint msg this_is_right' will show "this_is_right"
at the beginning of the map.
I look forward to seeing your message in a waypoint file :)