Add distance-to-water query to TerrainGrid #30
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#30
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?
Clay's placement rule from #26 is "low-lying tiles within N tiles of water." "Low" is already answerable from existing
level_at()/datum comparisons, but there is currently no way to ask how far a tile is from water.The gap
TerrainGrid(scripts/terrain_grid.gd) classifies a tile'sKind(includingKind.WATER) via_kind_for(level_at(cell)), but nothing aggregates that into a distance query.Scope
distance_to_water(cell: Vector2i) -> int, returning the Chebyshev or Manhattan distance (whichever is cheaper to compute correctly) to the nearestKind.WATERtile. Grid sizes are modest (default 64x64), so a straightforward flood-fill from all water tiles, or a bounded-radius scan per query, is fine - no need for anything cleverer.preset.has_water == false, orhas_watertrue but none generated) - e.g. a large sentinel or-1- so the clay generation issue can treat "no water on this map" as "no clay," consistent withresource-prospecting.md's "not all maps will have clay."Consumer
#31 (clay deposit generation) is the first and only planned consumer of this query, the same relationship #27's slope query had to the (still unbuilt) Quarry placement rule.