Function dijkstraDistanceMap

  • Generate a distance map for a set of positions using Dijkstra's algorithm.

    Dijkstra's algorithm includes variable costs to account for terrain or other cost functions.

    Note that values of 0 in the cost matrix may have unexpected behavior. You probably want a cost matrix with a default value of at least 1.

    Note that the roomName on start positions is ignored - all positions are assumed to be in the same room as the cost matrix.

    Parameters

    • start: RoomPosition[]

      The starting positions.

    • costMatrix: ClockworkCostMatrix

      The cost matrix to use for the flow field.

    Returns ClockworkDistanceMap

    The flow field.