Path following is used to have an object fly along a path defined by waypoints. The algorithms are designed to be robust and have great flexibility to on the properties of how the path is followed, see below.
Path following is selected by setting “Target Type” to PATH. The waypoints are either coordinates or game objects.
The main settings are are Balanced Turn and Time To Path. Theses decide how the object flies past a waypoint. See explanations below.
Note that the algorithms are not intended to be have an object perfectly follow a trajectory. On the contrary, they intend to provide a functionality for more realistic movement for following a set of waypoints. The result is close to how a real flying object would realistically fly through a number of waypoints. For instance, a cruise missile flying along a preplanned trajectory.
There also exist an experimental feature providing terrain following.
Basic usage is simple. Either input waypoint coordinates or provide waypoints as game objects. The object will then fly to the waypoints in order. The waypoints can be flown through in a number of ways, see below. The last waypoint can be handled in a number of specific ways, for examples as a target that should be hit. The path can also be a loop, after the last waypoint the first waypoint is used again.
The specific parameters for path following are shown below. Many other general parameters are also used, see other sections for those.
|Navigation Constant||The algorithm is in the background using a variant of Proportional Navigation, and therefore uses a Navigation constant.||Typically this isn’t changed, kept at 4.|
|Time To Path||This is the main parameter to change to affect the “agressiveness” in the path following. Simplified, this represent an approximation of time it takes for the object to converge on the path.|
A lower value makes the missile coverage faster, a high value slower.
|Must be a positive value..|
A very low value may create instability.
|Balanced Turn||If checked the object will try to prepare for the turn ahead of time without taking a shortcut. See below for explanation.|
|Turn distance Factor||This is a normalized value to decide how early the time is to be done ahead of the the waypoint. This applies with and without balanced turn chosen.||A value in the nominal range -1 to 1. |
-1: late turn
1: early turn
Can be set outside the nominal range in scripts.
|Terrain Follow||Experimental feature.|
|Hit last waypoint||If true, the last waypoint is considered a target and will, if possible, be intercepted and the path to the last waypoint is not prioritized.||Intercept properties are considered as described in Target Guidance.|
|Loop path||If true the path is a loop, i.e. the last waypoint is followed by the first waypoint.|
The algorithm is in the background using a variant of Proportional Navigation, and therefore has a Navigation constant setting. It seldom needs to be changed.Iit is available in the GuidanceSettings class as m_pathN (found in MissileSupervisor.m_guidance.m_pathN).
Time To Path
When the object is offset from the path this parameter decides how fast the object should navigate towards the path.
See the image below for the effect of time to path parameter when the object starts offset from the path.
A low value (green, 0.2 s) makes the object converge towards the path (red straight line) faster. A larger value (red, 1.0 s), slower.
A balanced turn prepares the turn early to both turn towards the next waypoint as well as passing through the waypoint.
The use of balanced turn opposed to not, depends on the situation: what is the intended use, how is the properties of the path (tight turns might favor balanced turn), or what real-life example is emulated? The balanced turn option flies closer to the waypoints but might deviate from the straight line path between waypoints.
The balanced turn (blue) is seen to to first go to the left but then later, at the waypoint, perform the right turn while passing through the waypoint. At the waypoint half the direction change has been done.
Below is another example.
Start of turn ahead of waypoint is decided with the Turn Distance Factor parameter.
Turn Distance Factor
Turn distance factor is a normalized factor that determines when to start the turn. It typically is in the range [-1,1]. Nominal value is 0, and lower value means the turn begins later and larger value earlier.
The normalization of the value takes into account Navigation constant, Time to path parameter and limitations of the maneuver to give a robust behavior.
For a normal turn, i.e. not a balanced turn, see the image below.
Zero (blue) gives a smooth turn with a minor overshoot. Setting the factor to -1 means that the turn starts at the waypoint, the object fly to the waypoint and then starts the turn.
The factor decides when the preparation of the turn begins for a balanced turn .
Nominal value, 0, starts the turn so that the turn is smooth, with a reasonable maneuver but still not taking too much time. A smaller value (-1, red in image) means that the object might not manage to fly close to the waypoint and requires sharper maneuvers. A larger value (1:; green in image) leads to smaller maneuvers and slower and longer turns.
Hit last waypoint
Intercepting and hitting the last waypoint is prioritized if Hit Last Waypoint is activated. This is opposed to following the path.
In the image below the red line is when activated, the blue is not activated. The green dot is the last waypoint. The difference is obvious where the red goes straight for the waypoint instead of following the path.