---
title: "onepath cookbook"
url: https://recursiveai.org/onepath/cookbook/
description: "Short recipes for common OnePath tasks, each with complete code you can copy."
version: "1.1.0"
---

# onepath cookbook

Short recipes for common OnePath tasks, each with complete code you can copy.

## Recipes

- [Grid pathfinding: A*, JPS, Theta* and HPA*](https://recursiveai.org/onepath/cookbook/grid-pathfinding/index.md): Find paths on a square grid with OnePath, compare the search algorithms on one map, size the path for a larger agent, and add area costs.
- [Replanning and flow fields](https://recursiveai.org/onepath/cookbook/replanning-and-flow-fields/index.md): Keep a path up to date as the map changes with OnePath’s incremental replanner, and route many units to one goal with a single flow field.
- [Navigation mesh queries](https://recursiveai.org/onepath/cookbook/navmesh-queries/index.md): Build a navigation mesh from a tile map with OnePath, then find a path around an obstacle, cast a ray along the mesh, snap a point to the nearest walkable…
- [Crowds in a rollback game](https://recursiveai.org/onepath/cookbook/crowd-rollback/index.md): Run a OnePath crowd with a fixed time step, save its state, roll back and resimulate, and check with a state hash that the second run reaches the same bits.
- [Routes on graphs](https://recursiveai.org/onepath/cookbook/graph-routes/index.md): Find routes on a weighted graph with OnePath, speed up repeated queries with landmarks, and link nearby points into a point graph.
