Guarantee a minimum reachable share of land per preset #162
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Milestone 2, item 4 ("ensure that terrains are navigable - different thresholds per terrain resource shape").
Problem
Pawns spawn in and are confined to
_main_region, the largest group of tiles connected by A* edges. Everything else is walkable-looking ground that nothing can ever reach. Measured over 10 seeds (share of the whole map):The canyon is the clear case. Its walls are cliffs end to end, so the map is reliably cut in two and half of it is scenery. That is not a canyon a colony lives in; it is a wall down the middle. The crater does the same at small sizes, with the rim walling off the outside.
Proposal
@export_range(0.0, 1.0) var min_reachable_share: floatonTerrainPreset: the share of land tiles the main region must cover. Land rather than the whole map, so the island is not penalised for its sea. Suggested starting values: plains 0.95, crater 0.85, canyon 0.85, island 0.80._sample_levels(), if the main region falls short, carve ramps. Join the largest unreached region to the main one by the cheapest route, regrading the tiles along it so each step is at mostmax_step_levels. Repeat until the threshold is met or an iteration cap is hit. The cap stops a pathological seed from spinning._levels, so it must run before_paint_cells()and_build_navigation(). It must be deterministic: norandi(), only values derived frommap_seed.Decision needed in the implementation
Regrading up (fill) versus down (cut). Cutting into a cliff keeps the high ground intact; filling makes a causeway. Either is defensible; pick one, or decide per shape.
Acceptance criteria
min_reachable_shareis on the preset, with a value set in each.tres._levelsgrid with a cliff splitting it is joined by the ramp pass, and every step along the carved route is at mostmax_step_levels.test_terrain_seed.gd).Out of scope
Player terrain manipulation (bridging, joining islands). The milestone puts that out of scope; this is the generator alone.
Depends on
#159 and #160. Terracing changes where the cliffs are, so this should be tuned after it.