Waypointing for CS:S Bots/Hostages

- By aleksandr
This tutorial was last updated on Jul 1, 2006.

This tutorial is intended to teach you waypointing skills for Counter-Strike:Source mapping

I am going to start by destroying the popular myth that wypointing is not needed in Source. This is not true. Although Source automatically generates the nav. file and technically you could play with bots, you will not get much fun out of it. For example: make or download a custom map (not iceworld - even bots understand how to play that, something more complicated) and play it with bots. Unless a mapper spent time on the tuning the nav. file the bots won't use ladders, will get stuck everywhere, fall off from the second floor, and won't use some of the routes around the map. Now go and play de_dust2 with bots on Hard mode and you will get owned. You see why u need nav. tuning now?

Preparation for Nav. Editing

Nav. tuning is done completely in game. Meaning you create a server and type commands in the console. To facilitate this I recommend making your own config.cfg (a file tha contains your keyboard configuration). It is located in C:\Games\Steam\SteamApps\***\counter-strike source\cstrike\cfg folder. Just copy the old one and past it in some temporary folder. Now start Counter-Strike:Source. Open console, and start typing:

bind "1" nav_mark
bind "2" nav_connect
bind "j" nav_jump
bind "p" nav_precise
bind "Mouse1" nav_begin_area
bind "Mouse2" nav_end_area
bind "\" nav_split
bind "del" nav_delete
bind "c" nav_crouch
bind "n" nav_no_jump
bind "=" nav_disconnect
bind "0" nav_make_sniping_spot
bind "m" nav_merge

Well that should be enough for a good session of nav. editing.
Now load the map that you want to nav. edit. Set sv_cheats 1 (nav. tuning is considered cheating). Type nav_quicksave 1 in the console once the map is loaded. Then type nav_generate and wait while its processing yuor map. If you are familiar with this process you will notice a difference. With nav_quicksave set to 1 the engine will skip all the analyzation processes (finding sniper spots, finding approach areas, finding encounted times, finding hiding spots, etc.) Instead it will simply scan the walkable area. This will save you a lot of time because you will have to analyze the map after you are done tuning the nav. anyway so you dont need to do it twice. ;)

Basics of Nav. Editing (Creating Areas)

Type nav_edit 1 in the console. If you did everything right so far you will see a second (white) crosshair following the standart one and some colorful squares on the ground.

The areas selected by a crosshair will become yellow. And the adjacent areas will be red.



If you did the key binding explained in the preparation section then everything else would be easy. If you didn't you will have to do it now or type the code in console for each step.
Walk around the map and look for areas that have not been created - if there are no squares on a certain walkable area. Sometimes the squares on the ground would not be created because the engine wouldn't think that they are "walkable", then you will have to make them manually.

Point the crosshair to where you want to begin drawing the square and press left mouse button (if you are not using keybinding then type nav_begin_area in the console). And start moving the crosshair to the opposite corner of the planned square.



Press the right mouse button or type nav_end_area in the console to finish the square.



Connecting Areas

For bots to go properly from one area to another, there needs to be a connection between the areas. There are 2 types of connections that you can make: one-way and two-way. With one-way connection bots will only be able to travel from one area to another but NOT back. With two way connection bots will be free to pass in both ways between the squares. Let's make 2 areas and connect them with a two way connection.

After you made two areas which are close to each other you need to "mark" one of them. To do that select it with your crosshair and press 1 or type nav_mark in the console. The area will turn light blue. And it will remain selected even if you move the crosshair to a different square.



Now move the crosshair to the area that you want to connect to the "marked" area. Like in the image above. And press 2 or type nav_connect in the console. Now do the same thing the other way around - mark the second area and connect it to the first one. You should have something like this as a result:




Now your areas are successfully connected.

*Note:
One way connection is indicated by a dark blue line between the areas. Two way connection is indicated by a light blue line between the areas.

Tips on Good area connections

There are a few things that you should know about bot behaviour.

First of all every time the bots see the enemy they tend to ignore the navigational mesh completely. This will often lead to their suicide if your map has trenches and holes where bots might fall, or doors that may crush them. There is no way to fix this behaviour because it is scripted into their coding.

Another thing is that bots tend to use shortcuts. Here is an example:



In this case the bots would be more likely to follow the red arrow than the green arrow. But the problem is that when they follow the red arrow they fall down, whereas the green arrow is safe.
To solve this you will have to split the destination area. To do this move the crosshair to where you want to split the area until you see a white line going through the area like in the screenshot below:



Press \ or type nav_split in the console. The area will split where the white line was. A two way connection between the newly formed areas will be automatically created.
As a result you will get something like this and the bots traveling by the red arrow won't fall anymore. ;D



Use the same method to prevent bots from getting stuck around the columns, corners, etc.

Making ladders

Ladders aren't always recognized properly by bots. That's why it is a good idea to make them manually. You do this the same way as you would make any other area except in this case it would be vertical instead of horizontal. Just left click your mouse where you want to begin making ladder and stretch the box until you reach the opposite corner. You would get something like this:



The connections between the ladder and adjaisoned areas are usually made automatically. But if they dont you can make them just like you would with any other area.

Using Other Nav. Commands

nav_jump
Mark and area and type nav_jump in the console or press j. This command does NOT make the bots jump. It only suggest that bots pass from this are to the next one by jumping. Areas marked by nav_jump will have two diagonal lines going across them.

nav_crouch
Unlike nav_jump this command FORCES bots to crouch. Mark an area and type nav_crouch in the console or press c. Use it everywhere you want the bots to crouch. Areas marked with nav_crouch will have a blue diagonal line going across them.

nav_precise
This makes the bots stick to the area more precisely. Doesn't have a 100% effect because bots still ignore everything when they switch to combat mode, but it certainly does make the bots walk more careful. Mark an area and press p or type nav_precise in the console.

nav_no_jump
This forces bots to stop jumping. When in the area marked with nav_no_jump bots will not jump. This is very useful when making stairs. If you dont use it then bots will keep on jumping up and down the stairs and look stupid and unreal. So mark each step with nav_no_jump by mariking it and pressing n. (This will also help when used together with nav_precise as it helps bots move carefully as well.)

nav_delete
Used to delete nav. areas. Mark and area and press "delete" to delete the area. Or you could just type "nav_delete" in the console!

nav_disconnect
Used to disconnect 2 areas. Mark the first are thne select the second and press = or type nav_disconnect in the console. Remember that if you have a 2 way connection you will need to do the same thing the other way around.

nav_merge
Used to merge 2 areas. Mark the first area nad select the second. Press m or type nav_merge in the console.

nav_make_sniping_spot
Used to make sniping spots. This command will subdivide the marked area into many smaller ones. This does not make the bots snipe there, but rather suggest the posibility that someone could be sniping there.

Testing Your Work

Before saving and reanalyzing the map I recommend first testing it with one bots. Type bot_add_ct to add bot to ct and bot_add_t to add bot to the t team. I suggest adding the bot to whatever team you are on so that the level does not finish with the level time limit. Then type bot_zombie 1. This will make the bot passive when in game. Mark the area and type bot_goto_mark in the console. The bot will go to the marked area using the shortest way possible. This a very useful way of testing your nav. work.



Saving your work

As any other work, you need to save you nav. editing efforts regularly. To do that type nav_save into console. After you are satisfied with your work type nav_quicksave 0 into console and then type nav_analyze. Your map will now be analyzed using your nav. tuning. When its done the map should be reloaded automatically. If it doesn't then do it manually. The map MUST be reloaded to prevent errors.

Congratulations!
You have successfully finished your first nav. tuning project.

The maps used in this tutorial as examples are: fy_artic_war by Windows98 and aleksandr, de_basement by aleksandr, and cs_junkyad by aleksandr.
You can download my maps from csm2.net.



Still need help? Ask your questions in one of our HELP FORUMS
Post A Comment
Name:
Email: Links Not Allowed In Comments
Comment:
What is the capital of France? Need Help?
Comments
perli55 - Dec 29, 2009
Great tut
i got realy happy after learning this
met - Sep 15, 2009
gw. but bot's not climbing ladder . what c i do??
boxmaker - Jun 3, 2008
how do you load a .nav file once itr has been saved?
Eavind - Nov 6, 2007
very good tutorial! good work!
but I can't get it to work:/
my bots just camp at spawn, and when i am on the other side of a wall they shoot me, throgh the wall!
any chance you would make the nav. mesh if i send you my map?
Fletch - Aug 9, 2007
Great tut! Very well done, thanks alot.
All original content ©2006 EditLife.net. All Rights reserved. All files property of their rightful owners.
Get Firefox! Get Thunderbird! Get Notepad++!