Omni-bot WikiMain Page | About | Help | FAQ | Special pages | Log in

Categories: ET | Doom 3 | Quake 4 | RTCW | Waypointing
Printable version | Disclaimers | Privacy policy

Omni-bot Waypointing

From Omni-bot Wiki

Main Page Omni-bot Waypointing

Contents

What are waypoints?

Omni-bot, like every bot needs a data structure that it can use to find its way around the map. Nearly every bot requires waypointing of some sort, whether it be automatically calculated from looking at the map geometry or hand placed like the majority of 3rd party bots.

Waypoints are basically a graph representation of the map geometry. Waypoints are vertices, and paths between them are edges. When a bot wants to get from where he his to a destination, the waypoint graph is used to find the way.

Waypoints are stored in .way files in the nav directory.

Important Waypoint Notes

Enemy Territory uses a unique method of drawing waypoints. At first, lines were drawn similar to g_debugbullets, but this method uses an entity for each line, and is dependent on free entities and scales horribly to large numbers of drawn lines. Unfortunately, the debug drawing functionality present in vanilla Quake3 bot lib seems to have been removed in ET. With the entity based drawing, the client would hitch every 2 seconds while they recieved a new snapshot containing hundreds of lines. My solution to this problem was to set up an interprocess communication channel between the bot dll and the ET client dll(cgame). This means that the bot dll and client DLL communicate with a message queue of draw requests. The resulting system is much more capable of drawing much larger numbers of lines(now limited only by the polygon buffer on the client) without being constrained by free entities, and without hitching the client or bad flickering of waypoints.

This method is not without its quirks. Due to how the InterProcess Communication works, it requires the use of a temporary file. To make sure it can create this temporary file, make sure you have the following.

Waypointing in ET

Due to the special method of waypointing in ET, waypointing is only available in the omnibot mod, which is a modification of etmain. This means you cannot waypoint in etpub, jaymod, or NQ. The authors of these mods and I thought it best to not add a needless dependency to their mods client dll. If you need to waypoint in ET, run the omnibot mod as a listen server, and run cg_omnibotdrawing 1 in the client console. Waypointing is not supported on dedicated servers, you must run a listen server.

A recap.

Backwards Compatibility

Occasionally the waypoint file format needs to be updated in order to support a new feature. Whenever this happens, Omni-bot is still capable of loading old version waypoints, and will save them as the new format if you waypoint_save them. Omni-bot isn't however, forward compatible. That means old versions of Omni-bot cannot load a waypoint version file that was added in a newer version.

How do bots use waypoints?

A basic understanding of how the bots use the waypoint graph can help you make good decisions on how to place waypoints, how to set radius, and how to understand when things might not be behaving as expected.

When a bot spawns into the map and decides where to goal, he performs a path search to determine how to get there. The overview of how the path search works is:

Getting Stuck

Bots can't move perfectly, and sometimes they can fall off edges or otherwise get pushed or dislodged from their intended path, usually due to weapon push or game physics. When this happens, they can sometimes get stuck. When the bot is unable to make meaningful progress in his path for a small amount of time, it assumes it has become stuck, and the current path attempt will fail. The important part of this process is that there is suitable waypoint placement to recover from getting stuck. Here's an example.


Adding Extra Waypoints To Avoid Stuckage Example


In this screenshot, we see a path that goes across the top of the thin wall. Occasionally the bot may fall off the wall and end up in the small square enclosure below it. You may not think it necessary to place waypoints on that square area below the edge, because the bot should never need to go there, but without the 3 waypoints, when the bot falls down and fails his goal and goes to re-plan a new path, we need to make sure he finds a starting waypoint in a reachable location. If we didn't have the waypoints in the square area below the wall chances are he would pick the waypoints on top of the wall as the nearest points to start from, and result in a stuck loop since he can't get to the waypoints on top.

Here's another example that illustrates this kind of problem. In the following screenshot, the bot is obviously trying to reach the waypoint marked 1, because this is the closest waypoint to the bot's current position. An obvious solution would be to add another waypoint, close to the spot marked 2 in the image, and (bi)connect it to some other waypoint on the right.


Adding Extra Waypoints To Avoid Stuckage Example II


This is a common problem with stuckage in maps. By understanding this you should be able to pick out areas of a map that could have this problem. Simply place a waypoint in the corner where they tend to get stuck and link it back to make them backtrack a bit and try again. Also see the section about blockable paths below. Failure to mark paths as blockable is another very common cause of stuckage problems.

How to waypoint

See the Enemy Territory Waypointing Tutorial.

Waypoint Visual Aids

These screenshots show the waypointing aids in their default color configurations.


Single Waypoint With Default Radius


This is what a single waypoint looks like after a waypoint_add command. The vertical line is the visual representation of the waypoint. When aiming at waypoints, you will see a circular configuration representing the waypoints radius. The size will vary according to the radius of the waypoint and is useful to determine just how large the radius actually is. The default radius shown here is 35 game units, which is almost always a good choice to start with.


One Way Connection Between Two Waypoints


When connecting waypoints, it is important to understand how connections are displayed. In this screenshot, it shows 2 waypoints connected by a one way path. We know the connection here is from the left waypoint to the right because of the angle of the link. Link direction is shown with a downward sloping link. The reason for this is because a slope is a better indication of direction and one/two way links than a single line, even if it is colored differently.


Two Way -Double- Connection Between Two Waypoints


Here we see what a two way connection looks like. Since there is a connection going both ways, the resulting link appears as an 'X' between the waypoints.

Special Case Waypointing


Special Case : Triple Connected Waypoints


Although not required, there are some configurations of waypoints that can help streamline bot navigation a bit. T-connections for example can be waypointed with triangular shape of 3 waypoints in order to have a bit more control over the bots corner cutting. This isn't a required configuration for T-connections, and you can get pretty much the same behavior by increasing the radius of the waypoint at the intersection.


Waypointing A Door


Doors are typically waypointed depending on how they operate. In many games, doors are automatic and simply open when the player approaches them. It isn't necessary to do anything special in the case of those doors. In some games, doors have to be 'used', such as in Enemy Territory. In these cases, the "door" waypoint flag is useful. The "door" flag is used by adding the flag to the 2 waypoints on either side of a door. This tells the bot to hit the USE key while moving across the link between the 2 waypoints. In this picture we see both waypoints flagged with door, and in this case they are team specific.

See also: an extra page on adding sniper spots to a map.

Placing Waypoints at MGs


Before placing waypoints at an MG, you should ideally display the MG's bounding box, using the command /bot draw_goals on ".*mg42.*" Then make sure you place the waypoint immediately in front of one of the horizontal edges of the bounding box, not at one of its corners. This will make it much easier for the bots to mount the MG. The following screenshot 1 shows a good position for a waypoint, screenshot 2 a bad one:

How to place waypoints at an MG How not to place waypoints at an MG

Although screenshot 2 shows a position that is a perfectly natural way for a human player to approach the weapon, it is badly suited for the bots' navigation. Frequently this will result in strange bot movements, as shown in screenshot 3:

Image:Mg42_box.jpg

Blockable Waypoints

Blockable waypoints are a special case flag that deserves special mentioning. Similar to doors, the blockable flag needs to be placed on both sides of the object. Additionally, the blockable flag must be used in conjunction with another flag that determines the type of blockable path that is desired. Blockable paths are a feature of Omni-bot that allow paths to update their own blocked status, saving some scripting effort. The type of flag used in addition to the blockable flag determines how they figure out their blocked status.

Blockable Waypoints‎


In the picture above, we see the dynamite wall in the old city in the oasis map. To manage the connection between the waypoints on either side of the wall, it is using the "blockable" and "wall" flag. On the left side, when the wall is present, the path is blocked, which is shown by the red line as the link. On the right, when the wall is destroyed, the line of sight test passes and the path is opened up automatically.


Bridge Blockable Waypoints


This is an example of a use for "blockable" and "bridge". The check for "bridge" is basically a probe to see if there is a surface detected under the link between the waypoints. When there is no bridge built, the probe doesn't detect the surface, and results in a blocked path. When the bridge is built, the surface is detected, and the link is opened.

Due to this method of detecting the blocked status of a path across a bridge, rope bridges and similar constructions with a slightly curved shape may require three or more waypoints, all of which should have blockable and bridge flags. Otherwise, the detection of a surface beneath the path might fail, as can be seen in this example (taken from the Bergen map):


Waypointing Rope bridge -the detection of a surface beneath path might fail


With more than two waypoints, the path is correctly recognized as usable by the bots:


Waypointing Rope bridge -the path is correctly recognized


In a few cases, it makes sense to use both the wall and bridge flag on a single waypoint. The example below shows a bunker entrance with a destructible barrier in front of it (from the JFF Playground map). Waypoint 1 is marked blockable and bridge, waypoint 3 (inside the bunker) has the blockable and wall flag set, while waypoint 2 has all three flags: blockable, wall, and bridge. This is because it is connected to two different blockable waypoints. Depending on the status of the wooden barrier, the paths 2-3 and 2-1 will toggle between blocked and unblocked. (The reason for this complicated construction is that the bots should jump through the small opening marked 0 in the image if the barrier is intact.)


Special Case : Blockable, Wall, and Bridge Flag Waypointing


A similar example: The following screenshot shows a destructible assault ramp, again taken from JFF Playground. All the waypoints shown here, except 4, have the blockable and bridge flags set, waypoints 1 and 4 blockable and wall. When the ramp has been built, the path 1-4 is blocked, while 1-2-3 is free:


Special Case : Blockable and Bridge Flag


When the barrier is destroyed, the status of both paths is toggled:


Toggle Status of Both Paths When Barrier Is Destroyed


Additionally, a new waypoint 5 (partly hidden by the crates) was added between the shots. The monodirectional connections 2-5 and 3-5 tell the bots that they can move from 2 or 3 to 5, but not vice versa.

You may wonder what waypoint 4 in the above example is good for. While it is not strictly necessary, it is not a bad idea to have it, mainly for two reasons: Without waypoint 4, a bot that got pushed under the barrier due to some circumstances would try to move towards waypoint 2 (because it's the closest one) and get stuck there. The connection between 4 and 5 enables the bot to find a working path back. Furthermore, waypoint 4 is probably a good place for engineer bots to plant dynamite, slightly better than 2, because it it is less exposed.

Keep in mind that paths can be blocked by vehicles too. All the waypoints along the path of a vehicle should have the blockable and wall flag set. There is a page dedicated to vehicle pathing.

Waypointing Tips

Waypoint Commands

Waypoint commands are accepted through the games console, and can commonly be assigned to key bindings in the supported games.

Executing a command

NOTE: ALL of these commands, except waypoint_view can only be executed when waypoint_view is enabled.

waypoint_add

Usage: waypoint_add

Example: waypoint_add

waypoint_addflag

Usage: waypoint_addflag flags[string] ...

Example: waypoint_addflag crouch

waypoint_addflagx

Usage: waypoint_addflagx flags[string] ...

Example: waypoint_addflagx crouch

waypoint_autobuild

Usage: waypoint_autobuild dc[1/0] bbox[1/0] limitheight[#] limitdist[#] maxconnections[#]

Example: waypoint_autobuild 1 0 32 1024 4

waypoint_autoradius

Usage: waypoint_autoradius all/cur[string] height[#] minradius[#] maxradius[#]

Example: waypoint_autoradius all 32 20 200

waypoint_benchmark

Usage: waypoint_benchmark

Example: waypoint_benchmark

waypoint_benchmarkgc

Usage: waypoint_benchmarkgc iterations[#]

Example: waypoint_benchmarkgc 1

waypoint_benchtrace

Usage: waypoint_benchtrace iterations[#]

Example: waypoint_benchtrace 1

waypoint_biconnect

Usage: waypoint_biconnect

Example: waypoint_biconnect

waypoint_biconnectx

Usage: waypoint_biconnectx

Example: waypoint_biconnectx

waypoint_changeradius

Usage: waypoint_changeradius change[#]

Example: waypoint_changeradius -10

waypoint_clearallflags

Usage: waypoint_clearallflags flags[string] ...

Example: waypoint_clearallflags crouch

waypoint_clearcon

Usage: waypoint_clearcon

Example: waypoint_clearcon

waypoint_clearproperty

Usage: waypoint_clearproperty name[string]

Example: waypoint_clearproperty bias

waypoint_color

Usage: waypoint_color

Example: waypoint_color type[string] red[#] green[#] blue[#]

waypoint_connect

Usage: waypoint_connect

Example: waypoint_connect

waypoint_connectx

Usage: waypoint_connectx

Example: waypoint_connectx

waypoint_dcall

Usage: waypoint_dcall

Example: waypoint_dcall

waypoint_del

Usage: waypoint_del

Example: waypoint_del

waypoint_deleteaxis

Usage: waypoint_deleteaxis axis[string]

Example: waypoint_deleteaxis

waypoint_info

Usage: waypoint_info

Example: waypoint_info

waypoint_load

Usage: waypoint_load name[string, optional]

Example: waypoint_load

waypoint_lockselected

Usage: waypoint_lockselected

Example: waypoint_lockselected

waypoint_mirror

Usage: waypoint_mirror axis[string] p[optional]

Example: waypoint_mirror x

waypoint_move

Usage: waypoint_move

Example: waypoint_move

waypoint_save

Usage: waypoint_save

Example: waypoint_save

waypoint_select

Usage: waypoint_select radius[#]

Example: waypoint_select 500

waypoint_setdefaultradius

Usage: waypoint_setdefaultradius radius[#]

Example: waypoint_setdefaultradius 100

waypoint_setfacing

Usage: waypoint_setfacing

Example: waypoint_setfacing

waypoint_setname

Usage: waypoint_setname name[string]

Example: waypoint_setname spawnarea

waypoint_setproperty

Usage: waypoint_setproperty name[string] value[string]

Example: waypoint_setproperty bias 0.6

waypoint_setradius

Usage: waypoint_setradius radius[#]

Example: waypoint_setradius 100

waypoint_shownames

Usage: waypoint_shownames expression[string, optional]

Example: waypoint_shownames ATTACK.*

waypoint_stats

Usage: waypoint_stats

Example: waypoint_stats

waypoint_translate

Usage: waypoint_translate x[#] y[#] z[#]

Example: waypoint_translate 10 0 0

waypoint_unlockall

Usage: waypoint_unlockall

Example: waypoint_unlockall

waypoint_view

Usage: waypoint_view enable[1,0,true,false,on,off]

Example: waypoint_view 1

waypoint_viewfacing

Usage: waypoint_viewfacing enable[1,0,true,false,on,off]

Example: waypoint_viewfacing 1

Waypoint Flag List

allies (ET specific)

ammo

armor

arty_spot (ET specific)

arty_target_d (ET specific)

arty_target_s (ET specific)

attack

axis (ET specific)

blockable

Note: This flag has to be used in conjunction with additional flags to determine the type of checking that will be done for the blockable path! See above.

bridge (ET specific)

cappoint

climb

closed

This flag is best added and removed from a script. Syntax example:

Wp.SetWaypointFlag("waypoint_name1","closed",false);
Wp.SetWaypointFlag("waypoint_name2","closed",true);

note: It is recommended that when using this function that you set the "default" flag in OnMapLoad. Meaning that you will want to set it to whatever it should be at map start:

 global Map =
 {
     sometrigger = function( trigger )
     {
         // open up the node now that this event has triggered
         Wp.SetWaypointFlag("waypoint_name1","closed",false);
     }
 };

 global OnMapLoad = function()
 {
     // at the beginning of the round, make sure this waypoint is closed
     Wp.SetWaypointFlag("waypoint_name1","closed",true);
 };


crouch

defend

detpack (ETF specific)

door

elevator

goto

health

inwater

jump

jumpgap

jumplow

mg42 (ET specific)

mine

mortar

mortar_target_d

mortar_target_s

movable

pipetrap (ETF specific)

pipetrap2 (ETF specific)

prone

script

sentry (ETF secific)

sneak

snipe

sprint

supplystation (ETF specific)

team1

team2

team3 (Not ET related)

team4 (Not ET related)

teamonly

teleport

underwater

wall (ET specific)

waterblockable

Community Waypoint Guidelines

Note that this information may be partially outdated by the new waypoint database!

Until there is the waypoint database running it would be nice if waypoint file / map script contributions could follow a few guidelines to make it easier for everybody to find the appropiate waypoint version.

1.) When submitting waypoint files please put them in a zip together with any additional information you want to include, e.g. readme.txt or whatever.

2.) While waypoint packs may have their uses I think it is generally better to submit single waypoints, cause in this way users will more easily find them without having to look at all the details of the package to find out if the needed waypoint file is in there. If you want to submit a package, please at least include the map list in the download description.

3.) When uploading please name the download following this pattern: MAPNAME-BOTVERSION-WAYPOINTREVISION Example: oasis-0.51-1.0

4.) Please try to limit the number of contained subfolders.

5.) When contributing map scripts it is important that the waypoint file matches the map script or they may not work as intended. Therefore please either include them directly in the zip together with the matching waypoint file or if you want to submit them independently please reference the waypoint file needed in the download description.

6.) Don't upload vis files. They will be automatically generated on map start and should not be submitted together with the waypoint files.

A couple of concluding notes: We hope to get a real waypoint database going in the future that will ease up things a lot but I can give no date to when that'll be the case. If someone is interested we could use an "Official Waypoint Tester".

Hope those notes don't sound offensive. We're very thankful for all the user contributions we get and without you this whole project certainly wouldn't be as successful as it is.

Retrieved from "http://www.omni-bot.com/wiki/index.php?title=Omni-bot_Waypointing"

This page has been accessed 8,955 times. This page was last modified 08:30, 25 May 2009.


Find

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Donations
Most Recent Blogs
Edit
View source
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
Bug reports
More...