TimedSearch

Group
scene
Methods
14
Fields
None

Getting one

scene:timedSearch(…)

Methods

MethodReturnsDescription
source()WorldPoint?The tile this flood was run from.
reachable(WorldPoint)booleanWhether the tile was reached.
pathLength(WorldPoint)number?Ground steps to a tile: the walking distance travelled, which a shortcut does not add to.
cost(WorldPoint)number?Weighted cost to a tile.
arrivalTicks(WorldPoint)number?How many ticks from the source you arrive at a tile. Add field:now() to ask the field about that tick: `field:blocked(tile, field:now() +…
viaShortcut(WorldPoint)booleanWhether the tile is reached by traversing a shortcut as its final move.
pathTo(WorldPoint){ WorldPoint }Landed tiles from the source to a tile, source excluded.
pathToFull(WorldPoint){ WorldPoint }Every tile of the route, landed and passed over. Hazard checks want this one; a two-tile move is lethal if either of its tiles is.
pathToward(WorldPoint){ WorldPoint }The walk toward a tile: the route to it, or when it cannot be reached the route to the closest tile the flood did reach. pathTo is the on…
cameFrom(WorldPoint)WorldPoint?The tile stepped from to reach one tile.
schedule(WorldPoint){ TimedStep }The route as an execution schedule: every tile with the tick of the move that covers it, its click-hop, and whether you stand on it.
clickTile(WorldPoint)WorldPoint?The farthest tile on the route whose NATURAL walk still matches the plan: click it and the engine's own pathing follows the route you chose…
bestOf({ WorldPoint })WorldPoint?The cheapest reachable tile among several. A longer, safer way round can win, which is the point of asking rather than measuring distance.
naturalPathLength(WorldPoint)number?The hazard-blind walking distance from the source: what the game would do if you clicked the tile yourself. For measuring how much a safer…

Returned by

MethodReturnsDescription
SceneDomain.timedSearchTimedSearch?Flood against a hazard field, asking it about the tick you ARRIVE at each tile rather than the tick the flood was built.

Method details

pathLength

pathLength: (TimedSearch, WorldPoint) -> number?

Ground steps to a tile: the walking distance travelled, which a shortcut does not add to.

tile
The tile.
Returns
nil when unreachable.

arrivalTicks

arrivalTicks: (TimedSearch, WorldPoint) -> number?

How many ticks from the source you arrive at a tile. Add field:now() to ask the field about that tick: field:blocked(tile, field:now() + ticks).

tile
The tile.
Returns
nil when unreachable.

pathToFull

pathToFull: (TimedSearch, WorldPoint) -> { WorldPoint }

Every tile of the route, landed and passed over. Hazard checks want this one; a two-tile move is lethal if either of its tiles is.

tile
The tile.

pathToward

pathToward: (TimedSearch, WorldPoint) -> { WorldPoint }

The walk toward a tile: the route to it, or when it cannot be reached the route to the closest tile the flood did reach. pathTo is the one that answers empty instead.

tile
The tile.

schedule

schedule: (TimedSearch, WorldPoint) -> { TimedStep }

The route as an execution schedule: every tile with the tick of the move that covers it, its click-hop, and whether you stand on it.

tile
The destination.

clickTile

clickTile: (TimedSearch, WorldPoint) -> WorldPoint?

The farthest tile on the route whose NATURAL walk still matches the plan: click it and the engine's own pathing follows the route you chose, instead of its own.

tile
The destination.
Returns
nil when unreachable.

bestOf

bestOf: (TimedSearch, { WorldPoint }) -> WorldPoint?

The cheapest reachable tile among several. A longer, safer way round can win, which is the point of asking rather than measuring distance.

goals
The candidates.
Returns
nil when none is reachable.

naturalPathLength

naturalPathLength: (TimedSearch, WorldPoint) -> number?

The hazard-blind walking distance from the source: what the game would do if you clicked the tile yourself. For measuring how much a safer way round costs.

tile
The tile.
Returns
nil when unreachable.