# 08 Tips

Short practical advice. Quick wins and common pitfalls.

## Network design

* **Place nodes only at meaningful spots** — intersections, decision points, endpoints. Don't add nodes along straight roads.
* **Default radius (150) is fine for pedestrians.** Vehicles want 300–500.
* **Bidirectional paths by default.** Use unidirectional only when direction matters (one-way streets, slides).
* **One main connected network.** Smaller islands are fine for sub-areas, but make sure you bridge where AI needs to cross.
* **Use Path Width to make AI feel natural.** 200 for sidewalks, 400–600 for roads.

## Performance

* **Don't call Find Path every frame.** Once when the goal changes, then reuse.
* **Step Distance:** lower = smoother but more frequent calls. 200 is good for pedestrians, 400–800 for vehicles.
* **Conditions are evaluated per A\* edge.** Keep them cheap — read tags or simple state, no level scans.
* **For large networks, use Debug Vis to drop debug-draw distance** while authoring (e.g. 3000 instead of 15000).

## Editor workflow

* **Spawn Classes are your friend.** Set them to your Blueprint subclasses before drawing — saves manual conversion later.
* **Validator before shipping.** Always run it. Auto-fix orphans if appropriate.
* **Heatmap to audit coverage.** Bright red = AI can't reach that area easily.
* **Color By Network if your level has multiple islands.** Reveals split topology at a glance.
* **Batch Rename gives you stable IDs.** Important for save/load reliability.

## AI movement

* **Always have a NavMesh.** OWP uses it between waypoints.
* **Lock AI Logic = false** if you want the behavior tree to keep running during the move.
* **Cancel the async action** when the goal is destroyed; otherwise the AI keeps moving toward a stale target.
* **Allow Partial Path = true** is usually right — better to get close than fail entirely.

## Save / Load

* **Set explicit names** when spawning at runtime. Auto-generated names like `OWPNode_42` aren't stable across sessions.
* **Don't save every frame.** Once per level transition, checkpoint, or player demand.
* **Network IDs aren't stable** across sessions — don't persist them.

## Common mistakes

* **Calling Find Path from Tick.** Cache the result and reuse.
* **Forgetting to register travelers** for traffic — `Current Occupancy` stays at 0 and congestion never kicks in.
* **Modifying the network from inside an event's Execute.** Defer with a timer.
* **Two nodes too close to each other.** Use Merge to consolidate.
* **Drawing a network without snapping to the ground.** Use the Snap tool after to clean up Z positions.

## Debugging

* **AI not moving?** Check the Path Result's `Query Result` enum — it tells you exactly why pathfinding failed.
* **AI takes weird route?** Look at conditions, zones, and cost multipliers. Use Inspect to read settings on each path.
* **AI jitters?** Step Distance too small, or Path Width and Step Distance disagree. Try `Step Distance ≥ Path Width × 1.5`.
* **Validator finds orphans you didn't expect?** A node was deleted while paths still pointed at it. Auto-fix or rebuild.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onesteppack.gitbook.io/openworldnavigation-doc/08-tips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
