Search public documentation:
This document describes how to set up navigation networks in a level so that NPCs can efficiently navigate to any point in the level. The intended audience is level designers. For a more technical discussion, refer to WaypointsTechnicalGuide.
Level designers place
PathNodes(a subclass of
NavigationPoint) in their levels on surfaces which NPCs can walk on, or in volumes which NPCs can swim in.
NavigationPoints, and they perform the same navigation function. In addition,
InventorySpotsare automatically placed at the location of every pickup in the level when building paths (they are invisible, but you will be able to see path connections to them). For
PathNodesto connect, they should be less than 1200 Unreal units apart (programmers can modify MAXPATHDIST in
nPath.hto change this value). Having two
NavigationPointstoo close together (overlapping) can cause AI navigation problems and should be avoided. When placing
PathNodes, the goal is to make sure that every area of the level is covered by a
PathNodeor some other
NavigationPoint. An area is covered if an NPC could walk to some
PathNodeless than 1200 units away completely unobstructed (i.e. without having to step around anything).
PathNodes, the level designer can build the connections between
NavigationPointsby selecting AI Paths from the Build menu (or by doing a full rebuild by selecting Rebuild All from the Build menu). The range of character sizes for which paths are built are determined by the PathSizes array of the Scout class being used to build paths (defined by the ScoutClassName ini entry in the [Engine.Engine] section of your Engine.ini file). Once a level has a large number of paths, it can take a while to rebuild all the paths. To tweak path placement, use the Build Changed Paths button in the Build Options menu. This will only rebuild paths between
NavigationPointswhich have been added, removed, or moved. Before saving and playing the level, however, a full path rebuild is required.
NavigationPointto another. If NPCs can traverse the path in either direction, there will be two lines, with an arrowhead pointing in each direction. Otherwise, the line will show with an arrowhead in which direction the path can be traversed. Even if the NPCs using the paths are small, it is always better to tweak the
PathNodepositions to make the connecting paths as wide as possible. NPCs will smoothly round corners, or strafe back and forth within a path, so larger paths will result in more natural looking movement.
- Orange - Flying path, narrow
- Light Orange - Flying path, wide
- Light Purple - requires high jump (higher than normal jump capability)
- Blue - narrow path
- Green - normal width
- White - wide path
- Pink - very wide path
- Yellow - forced path
- Purple - "advanced" path (requires "intelligence" to be used)
- Red - "one-way" path (i.e. there is a reachspec going from node A->B but not B->A) (NOTE: in recent builds it was changed to red-dashed to make one way situations easier to spot.)
After building paths, a window may pop up in the editor with a list of pathing errors and warnings. Click on an error to take you to the offending NavigationPoint. The window can also be accessed by selecting Check map for errors... on the Tools menu. If an AI NPC seems confused or is doing something funky, the following console commands are available:
Viewclass Pawn- to view the AI NPC in question.
ShowDebug- to see what the AI NPC is thinking and the path it is following.
RememberSpot- to mark a location when check navigation paths while in the level. Then, using
ShowDebug(without viewing something else) will show you a continually updated path to the marked location.
NavigationPointsshould be placed in conjunction with any
Moverthat acts as a door (based on its position, it allows or blocks movement between two areas). The
Doorshould be placed in the center of the affected area (typically, in the middle of the actual static mesh used for the door - but low enough to touch the ground). There are also several important properties of a
NavigationPointthat should be updated as needed:
- DoorTag - the tag of the
Moverwith which this
- DoorTrigger - if the
Dooris triggered, this is the tag of the trigger actor which will open the
- bInitiallyClosed - whether the default state of the
Moverallows movement (if false), or prevents it (if true, the default value).
- bBlockedWhenClosed - if the
Moveris closed, there is no way for the NPC to open it (false by default).
Moversnow have the bAutoDoor property. If set to true, a
PathNodeis automatically generated for that
Mover. This should work for most
JumpPadswill throw any
Pawntouching them in a specified direction.
JumpPadsare set up by specifying a destination
PathNodein the first entry of the ForcedPaths array property of the
JumpPad. The appropriate jump velocity is automatically calculated when paths are rebuilt. The JumpModifier vector property of the
JumpPadcan be set if for any reason the automatically generated velocity is problematic.
JumpDestsshould be used instead of
PathNodesat any spot that is too high to jump up to, but is linked to paths below it.
JumpSpotswill be used by NPCs in low gravity, or if they have some kind of jump boost. The path from which the bot should jump to the
JumpSpotshould have the
JumpSpotin one of its ForcedPath array property entries.
Moverused as a lift should never use the BumpOpenTimed state (use StandOpenTimed instead).
Liftshave two types of
NavigationPointsassociated with them. A
LiftCentershould be placed on the lift at its center. A
LiftExitshould be placed at each exit from the
Lift(but far enough away so that an NPC standing there will not interfere with the
Lift). Both the
LiftExitshave a LiftTag property which must be set to the tag of the
Mover. In addition, if the lift is triggered, put the tag of the triggering actor in the LiftTrigger property of the
LiftExitsalso have an optional property, SuggestedKeyFrame, which can be set to the keyframe number of the mover when the
LiftExitcan be used. This may improve navigation by NPCs in some situations.
LadderVolumesmust be oriented to face the wall being climbed (by adjusting their WallDir property, which is displayed as a directional arrow when the
LadderVolumeis selected). In most cases, level designers can allow Ladder
NavigationPointsto be automatically added when paths are built, at the top and bottom of the
LadderVolume. However, if there are any problems with the automatically placed Ladders, level designers can manually place the Ladders after setting the
LadderVolumebAutoPath property to false. The Ladder centers must be within the
LadderVolumeshould touch the floor at its bottom, and poke over the edge at the top by at least the height of the largest NPC using the Ladder.
CoverLinkswere developed for Gears of War. The following settings are used:
- bCircular = check this to make circular cover, ie cover around a cylinder. Usually done with two cover nodes located on either side of the cylinder, turned to point at each other.
- bClaimAllSlots = if an AI gets in cover here, no other AI will attempt to take cover at this spot.
- MaxFireLinkDist = the max distance at which the cover slots will query other cover slots in order to create AI fire links between them (tells the Gears AI where they can shoot while in cover there).
- bCanPopUp = shows the designer if the slot thinks an actor should be able to stand up and shoot from here.
- bAllowPopUp = set this flag if you want actors to be able to stand up and shoot from here.
- bAllowMantle = set this flag if you want actors to be able to climb over this cover.
- bAllowCoverslip = set this flag if you want actors to be able to slip around this cover (only works on edges).
- bAllowSwatTurn = set this flag if you want actors to be able to perform a swat turn to or from this piece of cover (again only works on edges).
Path types are defined both via code (for the case of jumps and flying nodes, etc) and in the default properties of the Scout (for different sizes of entities). To define different sizes modify the
PathSizesarray in your Scout class. Here is the default value:
PathSizes(0)=(Desc=Human,Radius=48,Height=80) PathSizes(1)=(Desc=Common,Radius=72,Height=100) PathSizes(2)=(Desc=Max,Radius=120,Height=120) PathSizes(3)=(Desc=Vehicle,Radius=260,Height=120)