MCPcopy Index your code
hub / github.com/Seldom-SE/seldom_map_nav

github.com/Seldom-SE/seldom_map_nav @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
71 symbols 101 edges 11 files 11 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

seldom_map_nav

Crates.io MIT/Apache 2.0 Crates.io

seldom_map_nav is a Bevy plugin that does navmesh generation, pathfinding, and navigation for tilemaps. Navmesh generation is available without Bevy dependency. It is agnostic to the solution you use for your tilemaps, but doesn't require much glue. It is also agnostic to your position type, as long as it implements Position2 (ex. Transform). It's compatible with seldom_state with the state feature.

Features

  • Navmesh generation for finite, square tilemaps
  • Awareness of navigator physical size
  • Bevy plugin for pathfinding and navigation
  • Integration with seldom_state

Future Work

This crate is currently in maintenance mode, so I'm not currently adding new features.

  • [ ] Tiles that can be pathed over in certain situations, such as doors
  • [ ] Tiles that cannot be pathed over, but do not need clearance generated, such as holes

The generated paths are not always optimal, even with the greatest quality settings, but I do not plan to fix this myself. If possible, I may switch dependencies to improve this, though.

seldom_state Compatibility

If the state feature is enabled, it will trigger the DoneTrigger when it is done navigating (if it reaches the destination or cannot find a path). Also, see related example: cargo run --example state --features="state"

Usage

Add to your Cargo.toml

# Replace * with your desired version
[dependencies]
seldom_map_nav = "*"

To generate navmeshes without Bevy integration, disable the bevy feature and use Navmeshes::generate or seldom_map_nav::mesh::generate_navmesh. See the no_bevy.rs example.

To generate paths without using the built-in navigation, add the MapNavPlugin to your app, add the Navmeshes component to your tilemap (or some other entity), and add the Pathfind component to your navigating entity. To use the built-in navigation, also add the Nav component to your navigating entity. See the nav.rs example. If you are having trouble getting it to generate a path, enable the log feature, and it might tell you what's wrong.

If you need help, feel free to ping me on the Bevy Discord server (@Seldom)! If any of the docs need improvement, feel free to submit an issue or pr!

Compatibility

Bevy seldom_state seldom_map_nav
0.17 0.15 0.10
0.16 0.14 0.9
0.15 0.12 0.8
0.14 0.11 0.7
0.13 0.10 0.6
0.11 0.7 0.5
0.10 0.6 0.4
0.10 0.5 0.3
0.9 0.3 0.2
0.8 0.2 0.1

License

seldom_map_nav is dual-licensed under MIT and Apache 2.0 at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

Position2 (Interface)
Component that represents a 2D position [2 implementers]
src/pos.rs

Core symbols most depended-on inside this repo

add_assn
called by 12
src/vertex.rs
get
called by 7
src/pos.rs
as_vec2
called by 7
src/vertex.rs
neg
called by 3
src/vertex.rs
axis
called by 3
src/vertex.rs
add
called by 3
src/vertex.rs
to_iso
called by 2
examples/isometric.rs
set
called by 1
src/pos.rs

Shape

Method 26
Function 20
Class 16
Enum 8
Interface 1

Languages

Rust100%

Modules by API surface

src/vertex.rs16 symbols
examples/isometric.rs12 symbols
src/mesh.rs11 symbols
examples/state.rs10 symbols
src/nav.rs8 symbols
examples/nav.rs6 symbols
src/pos.rs3 symbols
src/plugin.rs3 symbols
src/set.rs1 symbols
examples/no_bevy.rs1 symbols

For agents

$ claude mcp add seldom_map_nav \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact