Extended Path APIs

Currently, it is difficult for developers to create more complex navigation behaviors with the Path API. While it is easy to make behaviors where AI can “follow” or walk toward target points, there is no way to make AI that can walk “away” from a target point. This makes it impossible to make AI that stay a certain radius away from a target object/point, or an AI that moves as far away as possible from a target object/point.

Ideally, this would be resolvable by introducing APIs to create different types of paths, such as fleeing paths or target radius paths. The only way to implement fleeing behaviors currently are to manually mark points that the AI can walk towards in order to avoid targets; otherwise, they would get stuck walking into walls or off of the map since we cant explore the navmesh ourselves.

Example use cases:

  • Fleeing mechanics, where the enemy needs to flee from combat
  • Ranged enemies, where they need to find a point that is a specific distance away from their target. If cornered, they should pick a point on the opposing side of the target

Potential Solutions:

  • Expose navigation mesh queries and pathfinding utilities for developers to manually explore the navmesh
  • Provide methods to explore points on the NavMesh that are a certain radius away from the target point (returning the closest available point to the radius, with the shortest path being preferred)
11 Likes