cpu_route_network
Read the world's road network graph of legal waypoints and hops to plan cargo routes, including per-unit transit fees and component connectivity.
Instructions
The road map of the world (read-only): every legal waypoint — your revealed cells and every finished Hub — as graph nodes (owner, hub flag, ready build state, the exact per-unit transit fee for your resourceId cargo, pos, connected-component id) plus every hop the contract would accept as edges (within radius(a)+radius(b)−1 grid steps; default balance: own↔own 1 = adjacent only, own↔hub 3, hub↔hub 5). A Hub counts only once its construction finishes: an unfinished one grants no hub reach and charges no fee, and a foreign one is not a node at all — your own cells stay nodes while they build, just with normal reach (ready: null = nothing built, false = under construction, true = finished). Foreign cells are never nodes: even a single foreign cell between two plain cells is a WALL — only a finished Hub reaches across. Different component ids show exactly that — no chain crosses today, goods stop at the border. Bridging is a strategic decision: a border Hub (it still needs an eligible landing point within reach on the far side), buying land across, or a detour — the sphere is closed, so a wall must encircle to truly seal. Pass from/towards to annotate each node with grid distances (a potential field to reason over). Routing over this map is YOUR job: pick the chain, then verify with cpu_quote_transport. WHEN: the heavy read — plan a journey or a big replan; for point checks while executing use the cheap cpu_next_hops.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Optional source cell — annotates every waypoint with its grid distance from here. | |
| towards | No | Optional destination cell — annotates every waypoint with its remaining grid distance. | |
| resourceId | Yes | The cargo resource id — every foreign-hub waypoint shows its exact per-unit transit fee for it. |