Grid flow field for many units with terrain costs
In your harnessGodot componentMIT
Build a Dijkstra flow field from one or more goal cells over a grid with terrain costs and walls, then read a direction per cell so any number of units can share one search.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsonflow_field_grid.gdinspect_gdscript.pyrun_tests.gdtest_package.pytests/test_flow_field_grid.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorFlowField, extends RefCounted
- Methods
- has_cell(cell: Vector2i) -> bool; set_cost(cell: Vector2i, cost: float) -> bool; get_cost(cell: Vector2i) -> float; build(goals: Array[Vector2i]) -> int; get_distance(cell: Vector2i) -> float; direction_at(cell: Vector2i) -> Vector2; sample(point: Vector2) -> Vector2; world_to_cell(point: Vector2) -> Vector2i; and 1 more
- Placement
- res://baltor/godot_components/flow_field_grid/
Limits. Grid-based with 8 neighbors and no corner cutting; directions point to the next cell center, so units should blend them for smooth motion. Rebuilding costs O(cells log cells) in GDScript. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.
Details
- Kind
- Godot component
- Engine
- Godot 4.3 or later
- Files
- 11 files, 77.0 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, headless
- Checks
- godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
- Techniques
- multi-source Dijkstra integration field, binary heap priority queue, flow field direction from cheapest neighbor
- Tags
- flow field, pathfinding, dijkstra, rts, crowd, grid, tower defense
- Identity
library.supply.creative_originals.67147815f92135a10dffacd0.86a06f54c9d43c43- Version
86a06f54c9d43c434b6df3a906602044a215bc6133576d3e0c6122bdb35c59f1
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.