I love the smell of UnrealEd crashing in the morning. – tarquin

UE3:NavigationHandle (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> NavigationHandle
Package: 
Engine
Within class: 
Actor

NavigationHandle

Component that encapsulates navigation behavior. Attach this to your actor of choice to enable that actor to pathfind

Constants

LINECHECK_GRANULARITY

Value: 768.f


NUM_PATHFINDING_PARAMS

Value: 8

this is a handy way of ensuring everyone is setting the necessary parameters.. this should always reflect the number of

parameters in the NavMeshPathParams struct, and then in SetupPathingParams a check will be inserted with the
number of params in existence at the time of writing the function, so if the number of params changes and the implementations
are not updated an assert will fire

Properties

Property group 'PathDebug'

bDebugConstraintsAndGoalEvals

Type: bool

when this bool is TRUE, statistics about which constraints are doing what will be printed following

path searches

bUltraVerbosePathDebugging

Type: bool

when true TONS of information will be printed to the log, as well as a bunch of stuff drawn to the screen. debug lines will be drawn indicating the progress of the path traversal, and whenever a log message is printed related to an edge on the navmesh a number will be printed to the screen above it indexing into the log messages to tell you what that message is. RED lines indicate expansion was stopped at that step, other colors will change depending on the expansion generation (e.g. all edges traversed in the first step will be of the same color, second step a different color etc..

Internal variables

AnchorPoly

Type: pointer{FNavMeshPolyBase}

Modifiers: native


AnchorPylon

Type: Pylon

Current pylon AI is anchored to

BestUnfinishedPathPoint

Type: pointer{FNavMeshPolyBase}

Modifiers: transient, native

This points to the BestUnfinishedPathPoint. Which will usually be set by some EvaluateGoal or DetermineFinalGoal function/ In some cases it is not possible to get a full path, but having the best unfinished path is good enough (e.g. ai on top of a crevice, or on a navmesh island disconnected from everyone else)

bSkipRouteCacheUpdates

Type: bool

AI should not update route cache - flag to prevent cache from being changed when pathing is used to evaluate squad location

bUseORforEvaluateGoal

Type: bool

when this is TRUE the goal evaluator chain will be treated as an OR chain instead of an AND chain

CachedPathParams

Type: NavMeshPathParams


CurrentEdge

Type: pointer{FNavMeshEdgeBase}

Modifiers: const, native

List of polys to move through

FinalDestination

Type: Actor.BasedPosition

Final destination

PathCache

Type: PathStore


PathConstraintList

Type: NavMeshPathConstraint

List of search constraints for pathing

PathGoalList

Type: NavMeshPathGoalEvaluator


SubGoal_DestPoly

Type: pointer{FNavMeshPolyBase}

Modifiers: const, native

the poly we're currently trying to get inside

Structs

EdgePointer

dummy struct used to match alignment in pathcache array

pointer{FNavMeshEdgeBase} Dummy 

NavMeshPathParams

Modifiers: native

pointer{IInterface_NavigationHandle} Interface 
the navhandle interface for the pathing entity
bool bCanMantle 
can this entity use mantle edges?
bool bNeedsMantleValidityTest 
do we need to perform extra checks when determining if an edge supports the entiy?
bool bAbleToSearch 
is this entity valid to pathfind (does it have a pawn, etc..)
Object.Vector SearchExtent 
the size of the entity looking for a path
Object.Vector SearchStart 
the starting location for the path search
float MaxDropHeight 
the maximum valid height for this entity to 'drop down' (e.g. max height to use on dropdown edges)
float MinWalkableZ 
the minimum value for the Z component of walkable surfaces
float MaxHoverDistance 
max hover distance -- the maximum distance this entity can hover above the surface of a polygon. (-1 means arbitrarily high)

PathStore

Modifiers: native

array<EdgePointer> EdgeList 

PolySegmentSpan

Modifiers: native

pointer{FNavMeshPolyBase} Poly 
Object.Vector P1 
Object.Vector P2 

Functions

Static native functions

GetPylonFromPos

native static function Pylon GetPylonFromPos (Object.Vector Position)


ObstacleLineCheck

static native final function bool ObstacleLineCheck (Object.Vector Start, Object.Vector End, Object.Vector Extent, optional out Object.Vector out_HitLoc, optional out Object.Vector out_HitNorm)

does a line check against the obstacle mesh

Parameters:

  • Start - start of the line segment to check
  • End - end position of the line segment to check
  • Extent - extent of box to be swept along line segment
  • out_HitLoc - hit location of obstacle line check (if any)
  • out_hitNorm - hit normal of surface we hit during obstacle line check (if any)

Returns:

TRUE if nothing was hit (note: only collides against the obstacle mesh, not the normal mesh)

ObstaclePointCheck

static native final function bool ObstaclePointCheck (Object.Vector Pt, Object.Vector Extent)

Does a point check against the obstacle mesh

Parameters:

  • Pt - centroid of box to check aginast obstacle mesh
  • Extent - Extent of box to check against obstacl mesh

Returns:

TRUE if didn't hit anything

Native functions

ActorReachable

native function bool ActorReachable (Actor A)


AddGoalEvaluator

native function AddGoalEvaluator (NavMeshPathGoalEvaluator Evaluator)


AddPathConstraint

native function AddPathConstraint (NavMeshPathConstraint Constraint)


ClearConstraints

native function ClearConstraints ()

Path constraint operations Allows the user to push a list of constraints which affect pathing heuristics, as well as determine when the path traversal is finished

ComputeValidFinalDestination

native function bool ComputeValidFinalDestination (out Object.Vector out_ComputedPosition)

ComputeValidFinalDestination

will find a valid, pathable point near the passed desired destination

DrawPathCache

native function DrawPathCache (optional Object.Vector DrawOffset, optional bool bPersistent, optional Object.Color DrawColor)


FindPath

native function bool FindPath (optional out Actor out_DestActor, optional out int out_DestItem)

this will set up a path search, and ultimately call GeneratePath to do the A* path search Note: it's up to your constraints to determine what it is you're doing.. if you're trying to

     path to a particular point you probably want to add a NavmeshGoal_At goal evaluator
     and supply it with the position you're pathing toward so the goal evaluator can stop the path search
     once the destination is found.  You also need a path constraint to provide a heuristic for the search,
     which typically is going to consist of at least a NavMeshPath_Toward which will weight based on
     euclidian distance to the goal.

Parameters:

  • out_DestActor - output variable which goal evaluators can use to supply the 'found' actor at path finish
  • out_DestItem - output variable which goal evaluators can use to supply extra data to path search clients

Returns:

whether the path search was successful or not

FindPylon

native function bool FindPylon ()


GetAllPolyCentersWithinBounds

native function GetAllPolyCentersWithinBounds (Object.Vector Pos, Object.Vector Extent, out array<Object.Vectorout_PolyCtrs)

returns the center points of all polys within the specefied area

Parameters:

  • Pos - Center of bounds to check for polys
  • Extent - Extent of area to return
  • out_PolyCtrs - out var of poly centers within the specefied area

GetBestUnfinishedPathPoint

native function Object.Vector GetBestUnfinishedPathPoint () const

This will return the best "unfinished path". We need this for things where we are using the navmesh to find locations which are not connected (pathable) to the originating NavHandle but are still valid world positions.

GetFirstMoveLocation

native function Object.Vector GetFirstMoveLocation ()

this will a good point on the first edge in the pathcache (or the finaldest if there is no pathcache)

GetNextMoveLocation

native function bool GetNextMoveLocation (out Object.Vector out_MoveDest, float ArrivalDistance)

will return the actual point that we should move to right now to walk along our path this will usually be a point along our current edge, but sometimes will be something else in special situations (e.g. right on top of the edge)

Parameters:

  • out_MoveDest - output movement destination we have determined
  • ArrivalDistance - this tells getnextmovelocation how close to a point we have to be before MoveTo() returns necessary so we can compesnate for early arrivals in some situations

GetValidPositionsForBox

native function GetValidPositionsForBox (Object.Vector Pos, float Radius, Object.Vector Extent, bool bMustBeReachableFromStartPos, out array<Object.Vectorout_ValidPositions, optional int MaxPositions, optional float MinRadius, optional Object.Vector ValidBoxAroundStartPos)

will return a list of valid spots on the mesh which fit the passed extent and are within radius to Pos

Parameters:

  • Pos - Center of bounds to check for polys
  • Radius - radius from Pos to find valid positions within
  • Extent - Extent of entity we're finding a spot for
  • bMustBeReachableFromStartPos - if TRUE, only positions which are directly reachable from the starting position will be returned
  • ValidPositions - out var of valid positions for the passed entity size
  • MaxPositions - the maximum positions needed (e.g. the search for valid positions will stop after this many have been found)
  • MinRadius - minimum distance from center position to potential spots (default 0)
  • ValidBoxAroundStartPos - when bMustBeReachableFromStartPos is TRUE, all hits that are within this AABB of the start pos will be considered valid

IsAnchorInescapable

native function bool IsAnchorInescapable ()

this function will determine if the poly this entity is currently in is inescapable by that entity

Returns:

TRUE If the poly this handle is in isn't escapable

LimitPathCacheDistance

native function LimitPathCacheDistance (float MaxDist)

will clip off edges from the pathcache which are greater than the specified distance from the start of the path

Parameters:

  • MaxDist - the maximum distance for the path

LineCheck

native function bool LineCheck (Object.Vector Start, Object.Vector End, Object.Vector Extent, optional out Object.Vector out_HitLocation, optional out Object.Vector out_HitNormal)

does a line check against the Walkable mesh

Parameters:

  • Start - start of the line segment to check
  • End - end position of the line segment to check
  • Extent - extent of box to be swept along line segment

Returns:

TRUE if nothing was hit

PathCache_Empty

native function PathCache_Empty ()

Path Cache Operations Allows operations on nodes in the route while modifying route (ie before emptying the cache) Should override in subclasses as needed

PathCache_GetGoalPoint

native function Object.Vector PathCache_GetGoalPoint ()

After FindPath has been called this will return the location in the world that the pathfind found based on the NavMeshGoals

the FindPath used.

PathCache_RemoveIndex

native function PathCache_RemoveIndex (int InIdx, int Count)


PointCheck

native function bool PointCheck (Object.Vector Pt, Object.Vector Extent)

Does a point check against the Walkable mesh

Parameters:

  • Pt - centroid of box to check against obstacle mesh
  • Extent - Extent of box to check against obstacle mesh

Returns:

TRUE if didn't hit anything

PointReachable

native function bool PointReachable (Object.Vector Point)


SetFinalDestination

native function bool SetFinalDestination (Object.Vector FinalDest)

lets the navigation handle know what the ultimate goal of the current move is

Parameters:

  • FinalDest - the destination desired

Returns:

whether or not the final destination is reachable

SuggestMovePreparation

native function bool SuggestMovePreparation (Object.Vector MovePt, Controller C)

this will notify our curretn edge we're about to traverse it, and allow that edge to perform custom actions for traversal

Parameters:

  • MovePt - the point we're about to move to
  • C - controller we're suggesting move prep for

Returns:

TRUE if the edge is handling getting the bot to the proper position for the move, FALSE if calling code is responsible for getting th bot to movept

Other instance functions

CreatePathConstraint

function NavMeshPathConstraint CreatePathConstraint (class<NavMeshPathConstraintConstraintClass)

Path shaping creation functions... these functions by default will just new the class, but this offers a handy interface to override for to do things like pool the constraints

CreatePathGoalEvaluator

function NavMeshPathGoalEvaluator CreatePathGoalEvaluator (class<NavMeshPathGoalEvaluatorGoalEvalClass)


GetPathCacheLength

function int GetPathCacheLength ()