Logo FSBarV1_Archived

Chokepoints Module

Distance-transform-based chokepoint detection. Returns stable-ID, width-annotated descriptors for corridors that approach a specified base centre.

Functions and values

Function or value Description

chokepointIdOf grid ridgeCellX ridgeCellZ

Full Usage: chokepointIdOf grid ridgeCellX ridgeCellZ

Parameters:
    grid : MapGrid
    ridgeCellX : int
    ridgeCellZ : int

Returns: ChokepointId

Deterministically compute the stable ID for a ridge cell. Exposed so callers can reference a chokepoint by its Id across successive queries without re-running the full detection.

grid : MapGrid
ridgeCellX : int
ridgeCellZ : int
Returns: ChokepointId

computeDistanceTransform grid moveType ownStructures

Full Usage: computeDistanceTransform grid moveType ownStructures

Parameters:
Returns: float32[,]

Return the distance-transform raw values for diagnostic or visualisation use. Dimensions match MapGrid.passability for the given move type. Pure.

grid : MapGrid
moveType : MoveType
ownStructures : OwnStructureFootprint seq
Returns: float32[,]

defaultChokepointQuery arg1

Full Usage: defaultChokepointQuery arg1

Parameters:
Returns: ChokepointQuery

Default query for a given move type: MaxWidthElmos = 40.0, SearchRadiusElmos = 2500.0.

arg0 : MoveType
Returns: ChokepointQuery

findChokepoints grid baseCentre query

Full Usage: findChokepoints grid baseCentre query

Parameters:
Returns: Chokepoint list

Find all chokepoints within the query's search radius around baseCentre, sorted by distance from base (closest first). Returns an empty list when no passage satisfies the width threshold and primary-route predicate.

grid : MapGrid
baseCentre : float32 * float32 * float32
query : ChokepointQuery
Returns: Chokepoint list

Type something to start searching.