Skip to content

sdk.path

A* on Data.map.walkable / game.map.find_path. Cross-floor uses stairs and teleports from world.bin. Does not walk or attack. 8-way; diagonal is illegal if either adjacent cardinal is blocked. Live creatures do not block. Default Chebyshev cap is 128. Spec: docs/superpowers/specs/2026-08-21-sdk-path-design.md

lua
local M = require("sdk.path")

Constants

Lua 5.4 has no enums — these are integer (or string) fields on the module.

NameValueSummary
range128

to

function · to(from, dest, opts)

Returns table|nil: hit { target, goal, path, steps, partial }

Parameters

NameTypeSummary
fromPos
destPos
optstable|nilrange, partial, blocked/occupied, walkable, prefer_dir, turn_penalty, clearance, avoid_unpass, opened

Returns

TypeSummary
table|nilhit { target, goal, path, steps, partial }
string|nilerr one of: unknown, too far, no path, map miss

find

function · find(q, opts)

Live creature with that name wins over Data.npc / town / waypoint.

Parameters

NameTypeSummary
qstring|Posname or tile
optstable|nilfrom, range, ...Path.to opts

Returns

TypeSummary
table|nilhit Path.to row plus kind/target
string|nilerr one of: unknown, no session, too far, no path, map miss

near

function · near(here, kind, opts)

Live only: kind is "npc" | "monster" | "creature".

Parameters

NameTypeSummary
herePos
kindstring
optstable|nil

Returns

TypeSummary
table|nilhit
string|nilerr

recorded

function · recorded(from, route, opts)

Replay a recorded route as authoritative movement rather than feeding a future waypoint back into A*. A recorded tile was physically reached by the player, so it is better evidence than the static walk map (especially around roofs and doors). This function never skips corners or advances progress before the caller observes the new position.

follow

function · follow(from, route, opts)

Follow a recorded route without re-anchoring backwards on every tick. Returns a normal Path.to hit decorated with route_index/goal_index/direction.

Arcane SDK catalog generated from scripts/sdk