read_visleaf_stats
Reads a compiled BSP's visibility leaf data to report leaf and cluster counts, leaf volume distribution, and the share of leaves outside any cluster, so you can check split quality before shipping a map.
Instructions
Quality of a compiled map's visibility split: LEAFS for the bounding volume and cluster of every leaf, VISIBILITY for the map's real cluster count from its own header. Reports leaf and cluster counts, the distribution of leaf volumes (median and mean), and the fraction of leaves outside any cluster (-1) -- usually solid leaves, which own no visible space. Handles both dleaf_t sizes (version 0 and 1); any other LEAFS version is refused rather than guessed at.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "read_visleaf_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the .bsp, absolute or relative to the repo root. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| volume | Yes | ||
| leafBytes | Yes | dleaf_t record size this map uses: 32 or 56 bytes. | |
| leafCount | Yes | ||
| leafVersion | Yes | ||
| clusterCount | Yes | From VISIBILITY's own header. Null when the lump is empty (vis not run). | |
| visibilityBytes | Yes | ||
| noClusterFraction | Yes | ||
| noClusterLeafCount | Yes |