UDN
Search public documentation:
WaypointsTechnicalGuide
日本語訳
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
UE3 Home > AI & Navigation > Waypoints Technical Guide
Waypoints Technical Guide
Overview
Navigation is based on a pre-generated path network. As this path network doesn't cover 100% of the areas a bot may traverse, they also have to be able to perform localized assessment and navigation of the environment, which they sample for these purposes using collision traces, as well as inspection of nearby objects in the collision data structure. Level designers should place down NavigationPoints within a map. When the level is built, the NavigationPoints will generate ReachSpecs between then which has data used by path finding which allows AI to path find from A to B.
What are anchors?
An anchor is a navigation point that the AI can directly reach, without having to perform path finding, and thus is where path searches are started from. The first step of path finding, on any sort of path graph, is to find the most appropriate start and end points on the graph in order to generate a path between them. The anchor represents the start point for the bot's path searches, such that after calling FindPathToward() you will have a route from anchor to goal.
Controllers
ReachedDestination()
This function is queried by an AI during a move in order to ascertain whether or not it should consider the object it is currently moving toward as 'reached'. In other words, the AI calls this to decide whether it should stop moving to the current destination, and either move on to the next object in its route or stop moving altogether because it has arrived at its overall goal. Note that this function calls ReachedBy() on the Actor the AI is trying to move to which gives custom objects a chance to have a say in when an AI should stop trying to move to it. A good example of how this is useful is on very large objects. Normally an AI would try and run to the location of the object until it is inside some radius of said object, but if it has collision which is larger than the radius its checking against obviously this would cause problems. For objects such as this you could just override ReachedBy() to take into account its custom dimensions.ActorReachable()
The AI can call this function to decide if an object is directly reachable or not. This means that the AI can run in a straight line to the object without running into something (that it can't jump over). This is used during moves to decide a few things, but a good example is when it uses this function to decide if it should run straight to its destination, or try to path there via the path network. It's best to view the source code for examples. That said, at a high level what this function does is as follows:- Try and early-out by determining if the actor we're checking against is on a ReachSpec we are standing on, or if the destination actor is within the radius of a navigation point we are also within. (Assumes reachspecs / navigation points are always valid to walk along, as they are verified off-line).
- Does a quick ray cast to see if the destination is visible at all and early outs if it's not.
- Check to see if the destination actor is above solid ground.