# 03 Network Info

Topology and statistics queries.

| Node                            | Returns       | What it does                                               |
| ------------------------------- | ------------- | ---------------------------------------------------------- |
| **Get Network Stats**           | struct        | Aggregate metrics for the whole world.                     |
| **Get Network ID**              | int           | The connected component this node belongs to.              |
| **Are On Same Network**         | bool          | Are these two nodes connected?                             |
| **Get Network Count**           | int           | How many separate islands.                                 |
| **Get Network Info**            | struct        | Full info about one island.                                |
| **Get Connected Component**     | array of Node | All nodes on the same island as the input.                 |
| **Get All Networks**            | array of Info | One entry per island.                                      |
| **Get Bridge Candidates**       | array         | Pairs of nodes from different islands within max distance. |
| **Get Network Distance**        | float         | Travel distance via the network between two nodes.         |
| **Get Distance Ratio**          | float         | Network distance ÷ direct distance.                        |
| **Get Distance To Nearest OWP** | float         | Distance from a point to the closest network feature.      |

## Network Stats fields

| Field                 | What it is                           |
| --------------------- | ------------------------------------ |
| Total Nodes           | Count of all registered nodes.       |
| Total Paths           | Same for paths.                      |
| Enabled Nodes / Paths | Only those with `bIsEnabled = true`. |
| Connected Components  | Number of separate islands.          |
| Dead End Count        | Nodes with exactly 1 connection.     |
| Intersection Count    | Nodes with 3+ connections.           |
| Total Path Length     | Sum of all path lengths.             |

## Examples

| Want                                   | Setup                                                     |
| -------------------------------------- | --------------------------------------------------------- |
| Show "X nodes / Y paths" debug HUD     | **Get Network Stats** + format text.                      |
| Pick the largest island for AI spawn   | **Get All Networks**, sort by NodeCount, take first.      |
| Check if AI's destination is reachable | **Are On Same Network** before triggering Move To.        |
| Suggest where to build bridges         | **Get Bridge Candidates** with a distance threshold.      |
| AI rejects "too indirect" routes       | Compare **Get Distance Ratio** to a threshold (e.g. 2.0). |

## Tips

* Network stats are cached — calling them is cheap unless you've recently mutated the network.
* **Network IDs are not stable across save/load**. Don't persist them; derive a stable identifier from a node's name if you need to reference an island.


---

# 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/06-blueprint-functions/03-network-info.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.
