---
title: "onepath"
url: https://recursiveai.org/onepath/
description: "Pathfinding and navigation for .NET in C#. Grids with A*, JPS and Theta*, graphs, navigation meshes built from tile maps or level geometry, and crowds with ORCA, with results that are bit-identical on every platform. MIT or Apache-2.0."
---

# onepath

Pathfinding and navigation for .NET: grids, graphs, navigation meshes and crowds in one package, with results that are the same bits on every platform.

```sh
dotnet add package RecursiveAI.OnePath
```

- [Getting started](https://recursiveai.org/onepath/docs/getting-started/)
- [Docs](https://recursiveai.org/onepath/docs/)
- [Cookbook](https://recursiveai.org/onepath/cookbook/)
- [GitHub](https://github.com/recursive-ai-oss/onepath-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OnePath)

## A quick look

A path on a tile map in two lines, and a navigation mesh from level geometry in two more. Options are plain objects with presets; you never write a struct.

[Getting started](https://recursiveai.org/onepath/docs/getting-started/)

*Program.cs · C#*

```
using RecursiveAI.OneMath;
using RecursiveAI.OnePath;
var grid = Grid.FromText(map);
GridPath path = grid.FindPath(new Cell(0, 0), new Cell(4, 3));
NavMesh level = NavMesh.Build(triangles, NavSettings.Humanoid);
PathResult route = level.FindPath(start, goal);
```

### Grids

Square, hex and 3D voxel grids with A*, JPS, JPS+, Theta*, Lazy Theta* and HPA*, area costs, agent sizes, incremental replanning and flow fields.

### Graphs

Weighted graphs and point graphs that link nearby points, with bidirectional search and landmarks for fast repeated queries.

### Navigation meshes

An exact 2D builder for tile maps and outlines, and a Recast-class 3D builder for triangles or glTF, into one tiled format with tile caching and obstacles.

### Queries

Paths, raycasts, nearest points, random points and distance to walls, with filters and area costs, whole or sliced over frames.

### Crowds

Agents follow their corridors and avoid each other with navmesh-aware ORCA, stepped with a fixed time step from your game loop.

### Built for lockstep

Grids, searches, meshes and crowds save to bytes and restore exactly. No 1.x release changes an existing result or stops reading an earlier 1.x save.

## Timed against the native references

Every part is timed against Recast and Detour, DetourCrowd, DetourTileCache, RVO2 and Warthog, on the same inputs and settings, on x64 and arm64. Grid searches meet a bar of 1.00 and navmesh parts 1.15, with grid costs checked against the optimal costs. A hash matrix checks that results are the same bits on JIT, scalar, NativeAOT, WebAssembly and any thread count.

- [The speed table](https://recursiveai.org/onepath/docs/overview/#speed-against-the-references)
- [Hash matrix](https://recursiveai.org/onepath/docs/hash-matrix/)

## The package

- **RecursiveAI.OnePath**: Grids, graphs, both navmesh builders, the query layer, the tile cache and crowds. Trimming drops the parts an app doesn’t use. 1.1.0.
- **Dependency**: [onemath](https://recursiveai.org/onemath/) 1.0 or later, for vectors and deterministic math. Nothing else.
- **Migration**: Type, setting and unit tables for moving from Recast, Detour, DotRecast and Unity’s navigation.
- **Memory**: Higher than the native references’: it trades memory for speed and safety.
- **.NET**: .NET 10 on Windows, Linux and macOS, x64 and arm64, and browser WebAssembly. NativeAOT and trimming are supported. MIT or Apache-2.0.

## Go further

- [GitHub](https://github.com/recursive-ai-oss/onepath-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OnePath)
- [Getting started](https://recursiveai.org/onepath/docs/getting-started/)
- [All docs](https://recursiveai.org/onepath/docs/)
- [Cookbook](https://recursiveai.org/onepath/cookbook/)
- [Grid pathfinding](https://recursiveai.org/onepath/cookbook/grid-pathfinding/)
- [Navmesh queries](https://recursiveai.org/onepath/cookbook/navmesh-queries/)
- [From Recast or Unity](https://recursiveai.org/onepath/docs/migrating/)
- [Changelog](https://github.com/recursive-ai-oss/onepath-csharp/blob/v1.1.0/CHANGELOG.md)
