dao::world::PathSearch

struct

The result of a path search by Pathfind.

Declared in dao/World.h.

Fields

Field Type  
answers std::vector<std::int32_t> Each slice’s result code, in order, to help tell why a search failed.
blocker ObjectId = kInvalidObject When there is no path, the placeable in the way if one was found, usually a closed door; otherwise kInvalidObject. A placeable that is not active is never named, and a shut door is named before anything else in the same place. If the search gave up part way (result 1), this is whatever lies across the path just ahead, which may not be what stopped it.
goal Vector{} the destination the search used
goalFree bool = false whether the creature fit at the destination
legs std::int32_t = 0 How many searches ran: one, or more when a long walk across open ground gave up part way and the search went on from where it stopped.
partial std::optional<WalkPath> When there is no path, how far the search got: up to the door in the way, or to where it gave up.
path std::optional<WalkPath> the path, if one reaches the destination
result std::int32_t = 0 The pathfinder’s last result code: - 1: found, or gave up part way if path is empty - 5: no path - 6: a door or something like it is in the way, and the walker must act on it to go on (the game ends such a move with COMMAND_FAILED_PATH_ACTION_REQUIRED) - 8: no walkmesh there - 0: never asked (no such creature, or called off the game thread) - any other value: the search ran out of time
slices std::int32_t = 0 How many time slices the search took; 0 for a straight walk. The pathfinder works in short slices of time.
start Vector{} the start the search used
startFree bool = false Whether the creature fit at the start. An end where it did not fit is moved to a free place nearby.
trace std::string a one-line summary for a log
waypoints std::size_t = 0 how many waypoints the game’s path held at the end