fa icon indicating copy to clipboard operation
fa copied to clipboard

NavRequest - Pathing direction bias option

Open relent0r opened this issue 3 years ago • 0 comments

The ability to have the path returns be biased towards a direction of the map.

When requesting a path to a position, the ability to either specify an angle that provides a bias direction or a mid point. The path returns will gravitate towards that direction.

I've previously tried to imitate this by forcing the AI to select mass points that are close to the map edge. The issue is that the path will take the center of the map until such time that the pathing logic deems it ok. This means that raiding units will easily be intercepted at the mid point.

---@param layer String
---@param origin Vector
---@param destination Vector
---@param angle Integer
---@return boolean
function PathTo(layer, origin, destination, angle)

end

Attached screenshot shows what a pathing direction may look like in this situation.

Using an angle rather than a mid point position would let the pathing logic follow along the angle route until it gets to the end of the layer or towards the edge of the map if it allows. But a mid point(or table of points) could also be valid, it would just require the AI developer to be more careful about point selection. Use case, when the AI logic wants to approach a position from a side angle or route via a side lane that is not the closest route but is tactically preferred. This could also be used for transports to they can naturally avoid areas of conflict without having to know threat is present.

This may not even be the best approach, but the desire is for the AI to be able to be able to route platoons across maps to attack from different angles without having to rely on threat being present for the pathing logic to do it.

True / false positives

If no path is available on the angle requested the query can return false with a short string explanation so that the platoon logic can interpret and decide on another avenue. If I was designing logic for the AI I would have a table that records success of platoons taking angle ranges so that it could make decisions to attack weak angles more and failing angles less. Capture

relent0r avatar Oct 18 '22 19:10 relent0r