The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
Difference between revisions of "Legacy:Basic Bot Pathing"
m (Fixed broken link. Original site no longer has the page, using a cached copy from archive.org) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | This is an introductory tutorial on Basic Bot Pathing, aka Pathing | + | This is an introductory tutorial on Basic Bot Pathing, aka Pathing. |
==Prerequisites== | ==Prerequisites== | ||
− | This tutorial assumes you know many of the [[:Category:Legacy Basic Procedure]]s: [[Legacy:Create A Room|Create a Room]], [[Legacy:Add An Actor|Add an Actor]], [[Legacy:Set The Following Properties|Set the following Properties]] and [[Legacy:Match These Tags|Match these Tags]]. It assumes you have already been through many of the [[Legacy:Mapping Lessons|Mapping Lessons]] and have a custom map of your own, ready to implement [[Legacy:Bot | + | This tutorial assumes you know many of the [[:Category:Legacy Basic Procedure]]s: [[Legacy:Create A Room|Create a Room]], [[Legacy:Add An Actor|Add an Actor]], [[Legacy:Set The Following Properties|Set the following Properties]] and [[Legacy:Match These Tags|Match these Tags]]. It assumes you have already been through many of the [[Legacy:Mapping Lessons|Mapping Lessons]] and have a custom map of your own, ready to implement [[Legacy:Bot Support|Bot Support]]. |
==Overview== | ==Overview== | ||
Line 13: | Line 13: | ||
==Placing Basic PathNodes== | ==Placing Basic PathNodes== | ||
− | Simply right-click on the location where you want to place a pathnode, and then select "Place PathNode Here." | + | Simply right-click on the location where you want to place a pathnode, and then select "Place PathNode Here." Build up the botpath network by placing more PathNodes at junctions and intersections where you want your bots to be able to go. You'll need to [[Legacy:Rebuild|Rebuild]] your paths (use the Build Paths button on the [[Legacy:Toolbar|Toolbar]]) for any changes you make to take effect. While you don't need to litter the map with PathNodes, it's important to make sure of a few things: |
* Each intersection or junction has a PathNode. | * Each intersection or junction has a PathNode. | ||
Line 23: | Line 23: | ||
See the tips section below for more info. | See the tips section below for more info. | ||
+ | |||
+ | ==Placing [[Legacy:Bot Pathing|Advanced PathNodes]]== | ||
+ | |||
+ | Bring up the [[Legacy:Actor Browser|Actor Browser]], and under NavigationPoint, select the type of PathNode you wish to create to make it your current actor. In the 3D view, place a node by right-clicking on the floor and clicking the option with the name of the PathNode actor you just selected. | ||
==Viewing The Path Network== | ==Viewing The Path Network== | ||
Line 33: | Line 37: | ||
===Tips=== | ===Tips=== | ||
− | * '''Line of Sight''' For a bot to be able to move from node to | + | * '''Line of Sight''' For a bot to be able to move from one node to another, the two nodes must be within a line-of-sight of one another, and not too far apart. See "Viewing the Path Network" Above, and then see how far two nodes can be moved apart before the connection dissapears to get a good esitmation of the max. distance. |
− | + | * '''Distances''' A distance of 300 to 700 [[Legacy:UU|UU]]s seems to work well. Place them closer together on uneven or broken ground and farther apart on open floors. No farther then 300 to 350 on steps and ramps. The absolute minimum distance should be 50[[Legacy:UU|UU]]. [[Legacy:UnrealEd|UnrealEd]] will notify you if your paths are too close together. | |
− | * '''No space to add nodes''' If you ever select Add PathNode and nothing appears, it means that there wasn't room to add it. Keep trying in different spots nearby | + | * '''No space to add nodes''' If you ever select Add PathNode and nothing appears, it means that there wasn't room to add it. Keep trying in different spots nearby until it works. You can check the ScriptEditor for error messages that indicate why the PathNode wasn't placed. |
− | * '''Minimize the number of nodes''' Don't forget that too many NavigationPoints can slow the map down; the more nodes in the network, the more time it takes to calculate a path through it. So don't go overboard. Try to economize as much as possible. | + | * '''Minimize the number of nodes''' Don't forget that too many NavigationPoints can slow the map down; the more nodes in the network, the more time it takes to calculate a path through it. So don't go overboard. Try to economize as much as possible. Too many nodes can also cause bots to start running in circles or other erratic behavior. |
− | * '''Bots like inventory items'''. MiniHealth pickups, for example, ''can'' be used as incentive to follow a route. Remember that inventory items also act as pathnodes, whether they are spawned or not, so there's no need to put a pathnode at the item. Keep in mind that bots | + | * '''Bots like inventory items'''. MiniHealth pickups, for example, ''can'' be used as incentive to follow a route. Remember that inventory items also act as pathnodes, whether they are spawned or not, so there's no need to put a pathnode at the item. Keep in mind that bots will go out of there way to collect them. '''See [[Legacy:Inventory Item Placement|Inventory Item Placement]] for how these items should best be added. |
− | + | ||
− | See | + | |
==Other NavigationPoints== | ==Other NavigationPoints== | ||
Line 46: | Line 48: | ||
Other types of NavigationPoints such as [[Legacy:PlayerStart|PlayerStart]]s, [[Legacy:FlagBase|FlagBase]]s in CTF maps, [[Legacy:ControlPoint|ControlPoint]]s in Domination maps, [[Legacy:Pickup|Pickup]]s and [[Legacy:InventorySpot|InventorySpot]]s also act as nodes in the botpath network, so you don't need to add PathNodes near those items. | Other types of NavigationPoints such as [[Legacy:PlayerStart|PlayerStart]]s, [[Legacy:FlagBase|FlagBase]]s in CTF maps, [[Legacy:ControlPoint|ControlPoint]]s in Domination maps, [[Legacy:Pickup|Pickup]]s and [[Legacy:InventorySpot|InventorySpot]]s also act as nodes in the botpath network, so you don't need to add PathNodes near those items. | ||
− | |||
− | |||
− | |||
− | |||
When it's time to handle the more advanced bot behaviors such as riding lifts, using jump pads, ImpactJumping, Translocator use, etc., here are some specific pages to look over: | When it's time to handle the more advanced bot behaviors such as riding lifts, using jump pads, ImpactJumping, Translocator use, etc., here are some specific pages to look over: | ||
Line 56: | Line 54: | ||
** [[Legacy:Pathing Kickers|Pathing Kickers]] | ** [[Legacy:Pathing Kickers|Pathing Kickers]] | ||
** [[Legacy:Pathing Translocators|Pathing Translocators]] | ** [[Legacy:Pathing Translocators|Pathing Translocators]] | ||
− | |||
− | |||
* The full list of available [[Legacy:NavigationPoint|NavigationPoint]]s | * The full list of available [[Legacy:NavigationPoint|NavigationPoint]]s | ||
* [[Legacy:Strategic Bots|Strategic Bots]] – Advanced bot support. | * [[Legacy:Strategic Bots|Strategic Bots]] – Advanced bot support. | ||
Line 72: | Line 68: | ||
==External Links == | ==External Links == | ||
− | * [ | + | * [http://www.planetunreal.com/nucleus/UED2_pathing.html The Nucleus - Basic Bot Pathing] |
* [http://blitz.unrealplayground.com/tutorials/bots.html Advanced Bot Pathing Tutorial] by Blitz | * [http://blitz.unrealplayground.com/tutorials/bots.html Advanced Bot Pathing Tutorial] by Blitz | ||
Line 79: | Line 75: | ||
** [[Legacy:Bot Pathing|Bot Pathing]] – Concepts and elements of a bot path network | ** [[Legacy:Bot Pathing|Bot Pathing]] – Concepts and elements of a bot path network | ||
** [[Legacy:Strategic Bots|Strategic Bots]] – Advanced bot support | ** [[Legacy:Strategic Bots|Strategic Bots]] – Advanced bot support | ||
+ | ** [[Legacy:Inventory Item Placement|Inventory Item Placement]] – How to place inventory items, from a gameplay standpoint. | ||
** [[Legacy:Bot Mind|Bot Mind]] – Understanding the bots | ** [[Legacy:Bot Mind|Bot Mind]] – Understanding the bots | ||
** [[Legacy:Testing Botplay|Testing Botplay]] – Ensuring reliable bot support | ** [[Legacy:Testing Botplay|Testing Botplay]] – Ensuring reliable bot support | ||
* [[Legacy:Topics On Mapping|Topics On Mapping]] | * [[Legacy:Topics On Mapping|Topics On Mapping]] | ||
− | + | * [[Legacy:Map Design|Map Design]] | |
− | + | ||
==Discussion== | ==Discussion== | ||
'''SuperApe:''' Revised to look more like a tutorial. Comments welcome. | '''SuperApe:''' Revised to look more like a tutorial. Comments welcome. | ||
+ | |||
+ | '''Bob_The_Beheader:''' Pathnodes can be created without having to bring up the [[Legacy:Actor Browser|Actor Browser]]. On the right-click menu there is a command "Add Path Node Here." Path node does not need to be selected in the actor browser for this to appear. It works with PlayerStarts and Lights as well. | ||
+ | |||
+ | '''SuperApe:''' Very true. Thanks for the revision. | ||
[[Category:Legacy Basic Procedure|{{PAGENAME}}]] | [[Category:Legacy Basic Procedure|{{PAGENAME}}]] | ||
[[Category:Legacy Mapping|{{PAGENAME}}]] | [[Category:Legacy Mapping|{{PAGENAME}}]] | ||
[[Category:Legacy Tutorial|{{PAGENAME}}]] | [[Category:Legacy Tutorial|{{PAGENAME}}]] |
Revision as of 20:07, 23 September 2006
This is an introductory tutorial on Basic Bot Pathing, aka Pathing.
Contents
Prerequisites
This tutorial assumes you know many of the Category:Legacy Basic Procedures: Create a Room, Add an Actor, Set the following Properties and Match these Tags. It assumes you have already been through many of the Mapping Lessons and have a custom map of your own, ready to implement Bot Support.
Overview
Pathing is a necessary step before release of any custom map, and the better the pathing is, the better the reviews your map will receive.
Bots navigate a map by moving through a network of NavigationPoints, the simplest of which is called a PathNode. When a bot wants to get somewhere, the game finds the node nearest his current position and the node nearest his objective, calculates the shortest path through the network from one to the other, and tells the bot to follow that path. Thus, in order to get bots to play your map, you need to place enough PathNodes for bots to be able to use them to get to anywhere they might need to go.
Placing Basic PathNodes
Simply right-click on the location where you want to place a pathnode, and then select "Place PathNode Here." Build up the botpath network by placing more PathNodes at junctions and intersections where you want your bots to be able to go. You'll need to Rebuild your paths (use the Build Paths button on the Toolbar) for any changes you make to take effect. While you don't need to litter the map with PathNodes, it's important to make sure of a few things:
- Each intersection or junction has a PathNode.
- Changes in elevation or line-of-sight are marked with a PathNode. (such as the top and bottom of a staircase)
- Long stretches between PathNodes are filled in with enough nodes to link them together.
- Any tight hallway has a PathNode set at either end, in the center of the entrance and exit.
- Lines-of-sight between PathNodes are clear. (Imagine bots may travel in straight lines between connected PathNodes)
- Various actors such as inventory items act as pathnodes themselves, so there is no need to place a node right on top of them.
See the tips section below for more info.
Placing Advanced PathNodes
Bring up the Actor Browser, and under NavigationPoint, select the type of PathNode you wish to create to make it your current actor. In the 3D view, place a node by right-clicking on the floor and clicking the option with the name of the PathNode actor you just selected.
Viewing The Path Network
To see the path network you're building, right-click on the grey bar at the top of the 3D viewport to bring up the Viewport Context Menu and select "Show Paths" under the view submenu.
Buidling The Path Network
Be careful not to place too many; an excessive number of nodes may slow your map down, and is likely to confuse bots. A good strategy is to start with only the PathNodes you know you'll need. Then try to Build Paths. If you get errors regarding "orphaned" or "stranded" nodes, you can adjust them or add more to link them together. Add a few more and try to Build Paths again. Little by little, you'll be adding only the PathNodes necessary and limiting overkill. Too many pathnodes can slow the map down and make the network overly complicated – your goal should be to cover all of the map with the minimum of nodes.
Tips
- Line of Sight For a bot to be able to move from one node to another, the two nodes must be within a line-of-sight of one another, and not too far apart. See "Viewing the Path Network" Above, and then see how far two nodes can be moved apart before the connection dissapears to get a good esitmation of the max. distance.
- Distances A distance of 300 to 700 UUs seems to work well. Place them closer together on uneven or broken ground and farther apart on open floors. No farther then 300 to 350 on steps and ramps. The absolute minimum distance should be 50UU. UnrealEd will notify you if your paths are too close together.
- No space to add nodes If you ever select Add PathNode and nothing appears, it means that there wasn't room to add it. Keep trying in different spots nearby until it works. You can check the ScriptEditor for error messages that indicate why the PathNode wasn't placed.
- Minimize the number of nodes Don't forget that too many NavigationPoints can slow the map down; the more nodes in the network, the more time it takes to calculate a path through it. So don't go overboard. Try to economize as much as possible. Too many nodes can also cause bots to start running in circles or other erratic behavior.
- Bots like inventory items. MiniHealth pickups, for example, can be used as incentive to follow a route. Remember that inventory items also act as pathnodes, whether they are spawned or not, so there's no need to put a pathnode at the item. Keep in mind that bots will go out of there way to collect them. See Inventory Item Placement for how these items should best be added.
Once you've got the whole level covered with PathNodes, you can begin to look for special points that need more than a basic PathNode NavigationPoint. JumpSpots, for example, are points that are good destinations from a jump. You would want to identify any PathNode near the edge of or at the bottom of a ledge and replace it with a JumpSpot.
Other types of NavigationPoints such as PlayerStarts, FlagBases in CTF maps, ControlPoints in Domination maps, Pickups and InventorySpots also act as nodes in the botpath network, so you don't need to add PathNodes near those items.
When it's time to handle the more advanced bot behaviors such as riding lifts, using jump pads, ImpactJumping, Translocator use, etc., here are some specific pages to look over:
- Bot Pathing – Concepts and elements of a bot path network.
- The full list of available NavigationPoints
- Strategic Bots – Advanced bot support.
Testing & Troubleshooting
While working on the bot support, you will need to make sure the botplay is working. You will have to focus on the bots as they try to play in the map. By spectating a bots-only game, you can identify trouble spots or behaviors that you'd like to change.
Occasionally a bot can get "stuck" and moves from one node to another, back and forth. The cause is related to the bot's current goal; a pickup, a LiftExit, etc. For one reason or another, the bot believes the goal is reachable, but it cannot reach it, so it turns back only to decide it should try and reach it again. That behavior can continue on indefinately in some cases. The are two possible solutions for this:
- Place another node to allow the bot to reach their goal.
- Move things around a bit; either the PathNodes or the bot's goal item.
See also Bot Mind and Testing Botplay for more on troubleshooting and how to determine what the bot's goals are.
External Links
Related Topics
- Bot Support – Main topic
- Bot Pathing – Concepts and elements of a bot path network
- Strategic Bots – Advanced bot support
- Inventory Item Placement – How to place inventory items, from a gameplay standpoint.
- Bot Mind – Understanding the bots
- Testing Botplay – Ensuring reliable bot support
- Topics On Mapping
- Map Design
Discussion
SuperApe: Revised to look more like a tutorial. Comments welcome.
Bob_The_Beheader: Pathnodes can be created without having to bring up the Actor Browser. On the right-click menu there is a command "Add Path Node Here." Path node does not need to be selected in the actor browser for this to appear. It works with PlayerStarts and Lights as well.
SuperApe: Very true. Thanks for the revision.