TheGrimsey / oxidized_navigation

A runtime Nav-Mesh generation plugin for Bevy Engine in Rust.
Apache License 2.0
170 stars 12 forks source link

Support for Navigation Links #26

Open 0xh007 opened 3 months ago

0xh007 commented 3 months ago

I'm curious if Oxidized Navigation supports the concept of navigation links. In my project, I have scenarios where agents need to traverse between disconnected navigation meshes. For example:

These scenarios require navigation links to enable agents to move between different areas. I know that both Godot and Unreal, which implement Recast, support this feature. However, I haven't seen anything in the Oxidized Navigation code or documentation that suggests how to achieve this.

Here is a reference to Godot's implementation of navigation links: Godot Navigation Links Documentation.

If this functionality is not currently implemented in Oxidized Navigation, what would a potential solution look like?

TheGrimsey commented 3 months ago

They are not currently supported.

Navigation Links aren't a feature of Recast but something Unreal & Godot have appended to the nav-mesh data.

It makes sense for Oxidized Navigation to support them but I don't have an immediate solution for implementing them.

The following is me spitballing an implementation, it's not a guaranteed one.

It would be possible to add links as EdgeConnections with a u8 of 'metadata' to tell if the connection is a Link (1 bit) + a link type (the 7 remaining bits). You'd get 128 "link types" that you could handle as you see fit.

Or a separate EdgeConnection variant for links and then store the links separately in NavMeshTile. Then you could fit much more metadata and save the link entities for when you are moving.

Limiting factors: