Unreal Tournament bots use a system of waypoints to navigate the level.
Using waypoints allows UT to minimize the CPU cycles used by the AI, and gives level designers maximum
control over how the AI navigates their levels.
These waypoints are defined by placing actors which are subclassed from NavigationPoint in the level.
This includes actors such as PlayerStarts and Teleporters which designers will place to make their
level playable.
Certain NavigationPoints, such as InventorySpots and WarpZoneMarkers are automatically placed when
the designer "defines" the paths (described below).
Other NavigationPoints are intended for Unreal I style single player situations and are not used at all in UT.
These include AlarmPoints, ButtonMarkers, PatrolPoints, QueenDests, SpawnPoints, Transporters, and
TriggerMarkers.
Once the level geometry is complete, the level designer should fully map the level into the navigation
network using PathNodes. Place PathNodes at intersections and turns so that there is as much
clearance as possible from corners (at least 50 world units if possible).
Paths need a line of sight to each other, clear to the width of the
maximum width (2 * collisionradius) of creatures which will use this path.
PathNodes should not be placed more than 700 units apart. Since PlayerStarts and Inventory will be
placed on the navigation network, the designer can (and should) not place PathNodes where
these other NavigationPoints can substitute. On stairs and ramps, the PathNodes should only be 350 units apart.
The objective should be to use a minimum number of PathNodes to completely cover a level.
Version 402 of Unreal Tournament has an automatic PathNode generator which will do part of the work
of placing paths automatically. It will attempt to cover the level with paths, but will not place special
NavigationPoints such as playerstarts, liftcenters, etc..
To use the automatic PathNode generator, open your level in UnrealEd.
Select the Window menu, and from it the log. At the prompt type 'Paths Build' (no quotes).
This will take 5 to 10 minutes for a typical level.
To navigate around the level, bots will first find the nearest reachable
NavigationPoint, and move to it. They will then move toward their destination, going from NavigationPoint
to NavigationPoint. It is important that some NavigationPoint is reachable (there are no obstructions in
the way) from any location a bot may reasonably get to in the level. If a bot can't find a valid path,
either because it can't find a way to get on the network, or there is no valid way to get from the
network to its destination, or the path on the network is broken, then the bot will wander (walking) around
its current area.
The final step in setting up the navigation network is performing a PATHS DEFINE.
This can be done by typing PATHS DEFINE into the UnrealEd console, or pressing the "Paths Define"
button in the lighting section of the rebuild window.
The designer can examine the network generated in any of the UnrealEd world view windows by selecting
"Show Paths" from that window's "View" menu.
NavigationPoints which are successfully connected will have either blue or red lines between them.
Bots will use either blue or red paths, but blue paths are preferable - they indicate a cleaner,
more obstruction free path. Each time geometry is changed or NavigationPoints are added or moved
(including inventory, since paths are generated from inventory items), a PATHS DEFINE should be performed.
There are several common problems that result from assumptions and approximations made by the AI to
minimize CPU overhead. Make sure that all NavigationPoints are separated by at least 50 world units.
If two pathnodes are too close together, a bot may get stuck on them.
The editor log window will display warnings during a PATHS DEFINE if paths are too close together.
This problem commonly occurs with InventorySpots, which are automatically placed near all inventory items.
Don't place PathNodes too near to inventory.
In some situations, bots may get stuck on the edge of a ledge where it runs into a wall.
This occurs because of a threshold problem.
Bots won't jump off ledges until the angle of their destination is greater than 45 degrees from the
ledge direction. If they run into a wall right around this threshold, they may get confused.
The solution is to adjust the NavigationPoint they were trying to reach, or add an intermediate PathNode.
Bots will have problems if the NavigationPoints are too high off the ground.
Make sure that the NavigationPoint is no more than 1.5x the bot's collisionheight off the ground.
This will normally be the case automatically, but in a few situations (such as very steep ramps),
the level designer may need to manually adjust the Z position of the NavigationPoint.
PathNodes for the bots to use while swimming must be in the water.
Placing paths above the water's surface will result in bots bobbing
at that spot, attempting unsuccessfully to levitate to the PathNode's location.
WarpZones should be at least 70 units deep to allow the AI to handle them properly.
There are two special NavigationPoint classes used to help bots understand how to use lifts,
LiftCenters and LiftExits. Give the lift a unique tag. Place a LiftCenter on the lift, and set its LiftTag
attribute to be the tag of the lift.
At each exit from the lift, far enough away so that bots standing at that spot won't interfere with the lift,
add a LiftExit. Each LiftExit should have its LiftTag set to the tag of the lift.
The default state for movers is BumpOpenTimed. Do not use this state for lifts!
Bots misinterpret movers that are BumpOpenTimed as being doors.
Instead, use the StandOpenTimed state for most lifts.
Bots will also understand triggered lifts (TriggerOpenTimed, TriggerToggle, etc.).
In many cases, they will use triggered lifts without any further help.
However, for certain complex situations, such as when a delayed dispatcher is used to control the lift,
bots may need a hint. In these cases, set the LiftCenter's LiftTrigger attribute to the tag of the
trigger the bot should use to control this lift.
There are two other configurable LiftCenter attributes of interest.
These should be modified only if absolutely necessary. MaxZDiffAdd, which defaults to 0,
specifies an additional allowable difference in height between the bot and the LiftCenter for the bot to
consider that LiftCenter reachable. This is useful if the bot must stand below the lift
(down stairs or a ramp) while waiting for it.
MaxDist2D is the maximum distance between the bot and the LiftCenter. It defaults to 400 world units.
The only configurable NavigationPoint attribute that should be modified is bOneWayPath.
bOneWayPath can be set to true so that paths will only be valid in the direction the NavigationPoint is facing.
Turn on the bDirectional attribute of the NavigationPoint to adjust the direction it faces.
|