PathForge Pro — Shared-Field Pathfinding for Crowds


Then 128 units head for the same base, and your pathfinding runs 128 searches to ... PathForge handles the shared route. ... After that, "what is my next step?" is a lookup, not a search.


by Birdblu


Price History +

Build once. Move many. Shared-field routing for Unity crowds: one field for common goals, nearest-of-N destinations, weighted targets and batched next steps. Requires PathForge (separate purchase).

Technical details

PathForge Pro adds shared-field routing to PathForge Base. Compute routing toward a destination or target set once, then let many agents read their next steps without repeating a graph search for each agent.

Required dependency: PathForge Base must be purchased separately and installed. Pro declares Base as a package dependency.

  • Everything in Base remains available: shortest-path queries; six adapters (Grid, Weighted Tilemap, Hex, Waypoint, Triangle Mesh, Baked NavMesh); custom graphs via IGraphSource and AddEdges; per-query counters and DnskNative.Diagnose().
  • Shared routing fields: ComputeField builds a field for one destination. NextStep retrieves a direction without launching another graph search. When relevant graph or destination data changes, recompute the field; incremental updates are not claimed.
  • Nearest of N and weighted targets: ComputeWeightedField builds one field for multiple destinations. Root identifies the selected target for resolved nodes. Target costs influence selection by routing cost; this is not automatic load balancing or capacity management.
  • Field API (PathForge.Pro): CreateField(), ComputeField, ComputeWeightedField, NextStep, BatchNextStep, ExtractPath, Root, BatchQuery, ComputeFieldWatched, GetMetrics.
  • Batch operations: BatchNextStep reads next steps for an array of agents in one native call. BatchQuery processes (source, target) pairs; groups of 3+ pairs sharing a target use one field, while smaller groups use individual queries. Supports batches of up to 1,000,000 pairs. This is an input limit, not a speed guarantee.
  • Watched fields and metrics: ComputeFieldWatched stops expansion once the specified origins are resolved under its stopping rules. GetMetrics provides field statistics, including roots used and maximum agents per root. The sample scenes use full fields.
  • Determinism: identical graphs, target sets, costs and relevant configuration produce reproducible fields and next steps across runs and supported platforms. Full-game replay or multiplayer synchronization remains your responsibility.
  • Managed allocations: Base's documented reusable-buffer QueryPath workflow reports 0 B managed GC allocation per path query. This claim does not apply to field construction, native allocations or the rest of the Unity frame.
  • Native core: Rust-based field engine in the dnsk_ffi_pro module, alongside Base; Mono and IL2CPP support; no third-party runtime dependencies.
  • Six field demos: Colony Sim, Tower Defense, Swarm Chase, Nearest Exit, Supply Run, Many Agents. Scene assets ship with Base; their Pro field functionality runs once Pro is installed. Base examples remain unchanged.
  • Results you can inspect: the recorded Nearest Exit scene (60 people, four exits) shows 504 search steps for one weighted field pass versus 2,016 for four separate passes — approximately 4× fewer search steps in that scenario, not 4× faster execution. The Base reference benchmark records 79.9 µs versus 158.8 µs (approximately 2.0× in that run). Neither test compares against a competing Asset Store product.
  • Documentation and support: the Base Documentation~/ folder covers both tiers, marks Pro-only APIs and explains when to choose a query or a field. Public issue tracker for support.
  • Native binaries: Windows x86_64; macOS x86_64 and arm64; Linux x86_64 and ARM64; Android ARM64. No iOS or WebGL binaries.
  • Not included: movement controllers, steering, local avoidance or animation. Pro calculates routing data; your movement system remains in control.

Build once. Move many.


Your wave is already built. Your exits are already placed. Your loading dock is already where it is.


Then 128 units head for the same base, and your pathfinding runs 128 searches to answer a question it already knows: everyone here is going to the same place.


They do not need 128 routes. They need one route, read 128 times.


Your graph stays yours. Your movement stays yours. PathForge handles the shared route.



One field instead of one search per agent


A field is the complete answer to one question: from anywhere on this map, which way leads to the destination? PathForge Pro computes it once, over the whole graph. After that, "what is my next step?" is a lookup, not a search.


With any A* you can write, 128 agents heading for one place cost 128 searches. A field costs one. That is not a faster search, and it does not need more cores - it is a different number of searches, computed on the thread you call it from.


And it stays one. 128 agents, 10,000 or 100,000 - the field is built once for your map, and every extra agent simply reads its next step from it.


When the destination or the map changes, you recompute one field - not one query per agent. The map itself needs no rebuild: block a cell, open a door or raise a cost at runtime, and a field computed before the change says so instead of answering wrongly.


Proof you can run: six scenes, numbers on screen


- Tower Defense - 128 units storm one base. 

Recomputing the field for all 128 measured 0.31 ms, against about 11.6 ms for 128 individual searches. A map change reroutes all 128 in the same frame.

- Nearest Exit - 60 people, 4 exits. 

One weighted pass takes 504 search steps, four separate passes take 2,016 - about 4x less work.

- Colony Sim - 80 ants read one shared gradient. Every tick is a lookup, not a search.

- Supply Run - 48 couriers, one terminal, terrain costs, and live replanning when the mudslide hits.

- Swarm Chase - 128 against 128 across 3 targets: one shared field for the green team, one search per agent for the red team.

- Many Agents - 40 agents: one batched BatchNextStep call instead of 40 single calls across the native boundary.


We show 128 agents so you can follow each one. With 100,000, the field would cost the same. Run the scenes on your own machine - those numbers are yours, not ours.


Four ways to point the field


- One destination - ComputeField: a base, a depot, a loading dock.

- Nearest of N - ComputeWeightedField with a set of targets: exits, depots, terminals. Every agent heads for its nearest one, and Root tells you which.

- Weighted targets - give each target a cost to spread a crowd across slots or gates.

- Batch reads - BatchNextStep returns every agent's next step in one call. BatchQuery answers up to a million (source, target) pairs; three or more pairs with the same target share one field.


Watched fields stop solving once every agent you track has a route - an API feature; the scenes run the full field.


Same input. Same field.


The same graph and the same destination produce the same field and the same next step - on every run and on every supported platform. Replays, deterministic simulation and lockstep work on fields just as reliably as on single queries.


Ships where your game ships


- Windows x64

- macOS 11 or later - Intel and Apple Silicon

- Linux - x64 and ARM64

- Android ARM64 - already aligned for Google Play's 16 KB page-size requirement


Mono and IL2CPP. No third-party dependencies. On Android, the field engine works exactly as on desktop: the same native code, no extra threads.


Same core. Nothing to re-integrate.


Pro adds a second native module next to Base. The field API lives in the PathForge.Pro namespace on the same deterministic core; your graph adapters, counters and DnskNative.Diagnose() work as before.


The six field scenes ship with Pro (Package Manager → PathForge Pro → Samples). On a Base-only install, a field call says so in plain text instead of failing with a loader error. Pro computes shared routes - steering, avoidance and animation stay in your code.


Paste one line. Your assistant wires it in.


No afternoon in the docs before your first shared field. Give this line to Claude Code, Codex, Cursor or any coding assistant that can open a link or read your project files:


Read and execute https://birdblu.com/pathforge/pathforge-setup/SKILL.md


It sets up PathForge in your open Unity project and checks one route. Pro adds its own setup file for the field layer: it checks the Pro module, computes a shared field and wires one batched next-step call for your agents. Both setup files ship in the packages - read every step before you run it.


Everything you need to evaluate it


Documentation for both tiers ships in the Base package and is online: the API reference marks every field method as Pro, and Getting Started includes the decision tree for choosing between a query and a field. Support runs through the public issue tracker, and every report is read.


Pro and Base


PathForge Base answers one query at a time and is complete on its own. PathForge Pro answers a different question: what does a whole group heading for the same place do next? Pro includes Base: as a Pro owner you get PathForge Base for free - open its store page and add it to your assets. Already own Base? Upgrade to Pro for the difference.


What's inside


- Shared-field engine on the same deterministic core as Base

- ComputeField, ComputeWeightedField, NextStep, BatchNextStep, ExtractPath, Root, BatchQuery

- Nearest-of-N with target tracking, and weighted targets

- Watched fields and field metrics (API)

- Six field scenes with live numbers on screen, shipped in this package

- Fields that tell you when the map changed - recompute instead of a wrong answer

- One-line setup through your coding assistant

- Runs on the calling thread - no threads of its own

- Windows, macOS, Linux and Android ARM64 - Mono and IL2CPP

- PathForge Base included - free for Pro owners


Documentation: https://birdblu.com/pathforge/docs/

Issue tracker: https://github.com/BirdbluGmbH/pathforge/issues


Scene numbers are recorded results from the included scenes on a desktop machine. The Tower Defense comparison excludes the separate 12.97 ms nav-graph rebuild from the mesh; Many Agents compares native calls, not searches.