Terrain statistics probe for milestone 2 tuning (#159) #168

Merged
liamjd merged 1 commit from 159-terrain-stats-probe into main 2026-10-11 20:30:22 +01:00
Owner

Adds tools/probe_terrain_stats.gd, the measurement tool #159 asks for, ahead of that ticket so it is available while testing. Part of #159, not a fix for it: the generator is unchanged.

Godot_v4.7.2-stable_win64_console.exe --path . --headless -s tools/probe_terrain_stats.gd
Godot_v4.7.2-stable_win64_console.exe --path . --headless -s tools/probe_terrain_stats.gd -- presets=island,canyon sizes=32,64 seeds=20

For each preset × size it prints, over a fixed range of seeds (1000 onwards, so runs are comparable): walkable share, main-region share, flat 3×3 rocket sites on the main region (fewest / average), seeds with no site, level range, and flat-tile share. A "site" uses a level spread of 0, matching placement_controller.max_level_spread.

Headless and statically typed. TerrainGrid reaches no autoload, so the -s compile-order problem in CLAUDE.md does not apply. The header says so.

Verification

  • A full run reproduces the numbers quoted in #159, #161, #162 and #163 exactly.
  • The argument form was tested with presets=island sizes=32,48 seeds=5.

Baseline on main as of this PR (10 seeds):

preset   size  walk%  main%  sites(min / avg)  none     levels      flat%
plains     16  100.0   99.8       0 /     3.0   1/10     -7 .. 7       2.6
plains     32  100.0  100.0      30 /    62.4   0/10     -7 .. 7       8.2
plains     64  100.0  100.0     364 /   541.8   0/10     -7 .. 7      14.9
plains    128  100.0  100.0    2038 /  2820.8   0/10     -7 .. 7      18.2
island     16   23.2   11.7       0 /     0.0  10/10    -15 .. 15      0.0
island     32   22.5   18.6       0 /     0.1   9/10    -15 .. 15      0.0
island     64   23.7   18.7       1 /    14.1   0/10    -15 .. 15      0.4
island    128   23.0   19.2      25 /    82.5   0/10    -15 .. 15      0.6
crater     16  100.0   49.5       0 /     1.6   3/10    -15 .. 11      3.6
crater     32  100.0   69.8      13 /    34.7   0/10    -15 .. 12      7.9
crater     64  100.0   98.9     266 /   391.0   0/10    -15 .. 12     12.8
crater    128  100.0  100.0    2574 /  3020.7   0/10    -15 .. 12     20.2
canyon     16  100.0   43.8       0 /     9.7   1/10    -15 .. 3      10.5
canyon     32  100.0   44.9      49 /    91.3   0/10    -15 .. 3      21.3
canyon     64  100.0   47.2     462 /   647.7   0/10    -15 .. 3      35.8
canyon    128  100.0   80.5    2954 /  5517.7   0/10    -15 .. 3      42.7

The default size list is 16/32/64/128 rather than #158's proposed presets, since those don't exist yet. Use sizes= for others.

🤖 Generated with Claude Code

Adds `tools/probe_terrain_stats.gd`, the measurement tool #159 asks for, ahead of that ticket so it is available while testing. Part of #159, not a fix for it: the generator is unchanged. ```sh Godot_v4.7.2-stable_win64_console.exe --path . --headless -s tools/probe_terrain_stats.gd Godot_v4.7.2-stable_win64_console.exe --path . --headless -s tools/probe_terrain_stats.gd -- presets=island,canyon sizes=32,64 seeds=20 ``` For each preset × size it prints, over a fixed range of seeds (1000 onwards, so runs are comparable): walkable share, main-region share, flat 3×3 rocket sites on the main region (fewest / average), seeds with no site, level range, and flat-tile share. A "site" uses a level spread of 0, matching `placement_controller.max_level_spread`. Headless and statically typed. `TerrainGrid` reaches no autoload, so the `-s` compile-order problem in CLAUDE.md does not apply. The header says so. ## Verification - A full run reproduces the numbers quoted in #159, #161, #162 and #163 exactly. - The argument form was tested with `presets=island sizes=32,48 seeds=5`. Baseline on `main` as of this PR (10 seeds): ``` preset size walk% main% sites(min / avg) none levels flat% plains 16 100.0 99.8 0 / 3.0 1/10 -7 .. 7 2.6 plains 32 100.0 100.0 30 / 62.4 0/10 -7 .. 7 8.2 plains 64 100.0 100.0 364 / 541.8 0/10 -7 .. 7 14.9 plains 128 100.0 100.0 2038 / 2820.8 0/10 -7 .. 7 18.2 island 16 23.2 11.7 0 / 0.0 10/10 -15 .. 15 0.0 island 32 22.5 18.6 0 / 0.1 9/10 -15 .. 15 0.0 island 64 23.7 18.7 1 / 14.1 0/10 -15 .. 15 0.4 island 128 23.0 19.2 25 / 82.5 0/10 -15 .. 15 0.6 crater 16 100.0 49.5 0 / 1.6 3/10 -15 .. 11 3.6 crater 32 100.0 69.8 13 / 34.7 0/10 -15 .. 12 7.9 crater 64 100.0 98.9 266 / 391.0 0/10 -15 .. 12 12.8 crater 128 100.0 100.0 2574 / 3020.7 0/10 -15 .. 12 20.2 canyon 16 100.0 43.8 0 / 9.7 1/10 -15 .. 3 10.5 canyon 32 100.0 44.9 49 / 91.3 0/10 -15 .. 3 21.3 canyon 64 100.0 47.2 462 / 647.7 0/10 -15 .. 3 35.8 canyon 128 100.0 80.5 2954 / 5517.7 0/10 -15 .. 3 42.7 ``` The default size list is 16/32/64/128 rather than #158's proposed presets, since those don't exist yet. Use `sizes=` for others. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Prints, per preset x size over a range of seeds: walkable share, main
region share, flat 3x3 rocket sites on the main region, level range and
flat-tile share. Milestone 2's tickets quote it for before/after numbers.

Presets, sizes and seed count can be narrowed after `--`. Headless and
statically typed: TerrainGrid reaches no autoload, so the -s compile-order
problem does not apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
liamjd merged commit 971fb11e65 into main 2026-10-11 20:30:22 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder!168
No description provided.