landmass icon indicating copy to clipboard operation
landmass copied to clipboard

Add support for off-mesh links.

Open andriyDev opened this issue 2 years ago • 2 comments

Currently there's no way to specify additional connections other than through the nav mesh polygons themselves. Some examples of off-mesh links are: doors (which can be opened or closed on the fly), teleporters, jumping down from a cliff.

andriyDev avatar Jun 17 '23 21:06 andriyDev

There should be two kinds of links:

1. Bridges (or polygon links)

Essentially, a polygon that connects two existing nodes.

Agents should treat these as with any polygon - they should be able to walk anywhere in this polygon, to allow cutting diagonally across the polygon to create a simpler path.

Another way we can view this is as a "conditional node".

Examples

  • A door. Agents should be allowed to walk anywhere within the door frame, so wide doors can be taken diagonally across.
  • A drawbridge. Agents can walk anywhere on the bridge (as long as the bridge is down).

2. Animation links

A point connected to another point, or a line connected to another line.

Agents should take these points as if using them plays an animation that they cannot control.

Examples

  • A teleporter. The agent uses the teleporter and is instantly transported to another location. The animation time is 0, but the agent cannot "cancel" it.
  • Jumping down from a cliff. The agent plays an animation to jump down and has no horizontal control while going from one position to the other.
  • Jumping across a gap. The agent plays a jumping animation to go from one side of the gap to the other. The agent cannot jump diagonally across the gap.

While it sounds like limiting animation links to not be diagonal, it also seems reasonable to do so - generally a "jumping across a gap" animation has a fixed length, or an expected distance. With the diagonal part, the animation may not take the right amount of time and look very odd.

andriyDev avatar Jun 17 '23 21:06 andriyDev

I thought of another kind of link

3. Tile links

Edges of nodes that are near the boundaries of their respective Islands should link together automatically. These edges should be treated as if they were normally connected.

andriyDev avatar Jul 01 '23 00:07 andriyDev