PathForge — Troubleshooting

Symptom → fix. Start with the first check; it names the cause in most cases.

First check

if (!DnskNative.Available)
    Debug.LogError(DnskNative.Diagnose());   // where PathForge looked, what it found, the system error

The plugin won’t load (DllNotFoundException)

  1. Your build target isn’t included. PathForge ships for Windows x64, macOS 11 or later (Intel and Apple Silicon), Linux x64 and ARM64, and Android ARM64. WebGL, iOS, Windows 32-bit and Windows ARM64 are not in this release.
  2. The plugin is switched off for your platform. Select the file in the package’s Runtime/Plugins/ folder → Inspector → Platforms: the row for your platform and Editor must be checked, Any Platform unchecked. If you changed these settings, reimport the package. Don’t rename or move the plugin files.
  3. Windows error code in the report: 126 — the file isn’t where Unity looks (see 2); 193 — a 32-bit build; build for 64-bit (x86_64). Any other code: please report it.

The error mentions “ABI mismatch”, or EntryPointNotFoundException

The C# package and the native plugin are different versions. Reinstall the package (Package Manager → PathForge → Remove, then install again) and restart the editor.

“bad CPU type” on macOS, or a crash when the plugin loads

Both CPU variants ship and Unity picks the right one. If the project moved between an Intel Mac and Apple Silicon, reimport the package and check that the matching plugin file’s platform row is enabled.

The editor keeps using an old plugin

Unity doesn’t reload native plugins while it runs. Close Unity, delete the project’s Library/ folder (Unity rebuilds it), and reopen the project.

Android

The ARM64 plugin loads by itself. Its platform row must be checked for Android / ARM64.


The route is empty

  • result.Reachable is false: the target is walled off.
  • The route stops early: the buffer is too small — make it cols * rows (or NumVertices).

NextStep throws every frame (Pro)

The agent stands on a blocked or unreachable cell. Check before you ask:

if (distances[vertex] != uint.MaxValue)
    MoveAgent(field.NextStep(vertex).NextVertex);

BatchNextStep skips such agents for you.

Agents ignore a map change

  • Use BlockVertex, UnblockVertex, SetEdgeWeight, CloseEdge or a builder’s RefreshCell — changing the Tilemap alone does not change the built map.
  • The cell must be a dynamic cell (or rebuild the solver).
  • (Pro) Compute the field again; an old field throws “field is stale”.

See Getting Started → Dynamic maps.

GC spikes

A buffer is being created per call. Create it once as a field and reuse it:

uint[] buffer = new uint[512];                       // once
void Update() { solver.QueryPath(a, b, buffer); }    // reused

ArgumentException from AddEdges / BuildFrom

The message names the rule: every edge cost must be 1 .. 536 870 912 and every vertex ID below the vertex count. Make the cheapest move cost 1; with TilemapGraphBuilder and diagonals the largest tile weight is 38 347 922. No edge of that call was added.

DnskProRequiredException

Fields need PathForge Pro. Install PathForge Pro next to PathForge.


Good to know

  • Threads: call PathForge from Unity’s main thread. A solver is not shared between threads — use one solver per thread if you need parallel work. PathForge starts no threads and runs no callbacks.
  • Mono and IL2CPP: both work; nothing to configure.
  • Dependencies: only built-in Unity modules (Tilemap, AI, IMGUI for the sample panels) — no third-party packages.
  • Not included: local avoidance — units still need your collision handling.