Polarith AI
1.8
Planar Seek and Flee Bounds
Seek

front-end / back-end: AIMPlanarSeekBounds | PlanarSeekBounds
inherits from: AIMRadiusSteeringBehaviour | RadiusSteeringBehaviour

Flee

front-end / back-end: AIMPlanarFleeBounds | PlanarFleeBounds
inherits from: AIMRadiusSteeringBehaviour | PlanarSeekBounds

Note that the inspector of Planar Flee Bounds is equivalent to the inspector of Planar Seek Bounds.

For many cases, the simple Seek behaviour might be sufficient, but for many other cases, the collider information of an object needs to be considered, too. Therefore, Planar Seek Bounds was made. Figure 1 illustrates the functionality of this behaviour. All receptors which face directly the percept's bounds receive a magnitude of 1, which may be interpreted as maximum danger. Every other receptor gets a magnitude of 0. Anyway, it is also possible to affect the adjacent receptors using Spread, as shown in Figure 2. Planar Flee Bounds works exactly like Planar Seek Bounds except that it inverts the response direction. The general functionality of Planar Seek Bounds and Planar Flee Bounds is illustrated in Figure 1.

Figure 1: Shows the results of Planar Seek Bounds applied to four different agents. The dotted lines are examples to show how corners of the bounds are perceived.

Properties

This component has got the following specific properties.

Property Description
Spread The area which faces directly towards the percept's bounds always has a magnitude of 1. This parameter determines what happens to receptors which are near to this area. A value of 0 causes every other receptor to get a magnitude of 0, as against a value of 1 enables sensitivity mapping completely.
BoundsTypeThe applied bounding box model: either axis-aligned bounding box (AABB) by collider, oriented bounding box (OBB) by collider or OBB by visual bounds (sprite/mesh). In order for this to work with meshes, a received object must not be static, or otherwise, no visual bounds can be received. For more details, have a look at the bounding box remarks in Planar Avoid Bounds.

Preview

Remarks

For a better control on how an agent avoids an obstacle, you can try to play around with the SensitivityOffset in combination with the Spread parameter, its effect can bee seen in Figure 2 below.

Figure 2: The effect of the Spread parameter.

The Difference between Seek Bounds and Flee Bounds

In contrast to Planar Seek Bounds, Planar Flee Bounds writes high magnitude values in the opposite direction facing away from a percept's boundary, but the result of the Spread parameter is different than for Planar Seek Bounds. So, every receptor facing away from the percept's bounds gets a magnitude of 1. Then, these values are decreased by the given Spread value which can be seen in Figure 3. Hence, it is possible to prioritize the opposite direction pointing away from bounds instead of just having a significant value for each direction which is not facing any bounds.

Figure 3: The difference between Planar Seek Bounds (green) and Planar Flee Bounds (red).

Imprint