QtCraft API C++ classes QML types Handbook

QcPathFinder Class

A* over the cells a creature can stand in (QcPathTerrain), bounded by a node budget and by the window around the start (QcPathWindow). More...

Header: #include <server/pathing/QcPathFinder.h>

Public Functions

QcPathResult find(const QcBlockAccess &world, const QcPathCellTable &table, QcPathRules rules, const QcPathRequest &request)

Static Public Members

const float heuristicWeight

Detailed Description

Moves: the four sides (a step up of at most QcPathRules::climbHeight with room to jump, level, or a drop of at most QcPathRules::maxDrop, deeper only into deep water), up and down along a ladder (a creature that climbs), and the diagonals between two free sides on the same level. Costs: distance, a little for climbing and dropping, much for water (a walker), magma floors and cobwebs, a little beside walls, so paths keep to open cells, and more beside fire and lava. The heuristic is weighted (1.25): paths are at most a quarter longer than the shortest, for far fewer nodes. The body's width counts (decision E-909): no step through the side of a cell a panel covers, no diagonal beside a panel, and a body wider than a block moves its four columns.

Member Function Documentation

QcPathResult QcPathFinder::find(const QcBlockAccess &world, const QcPathCellTable &table, QcPathRules rules, const QcPathRequest &request)

Returns the path in world (path cells from table) for a creature under rules that request asks for.

Member Variable Documentation

const float QcPathFinder::heuristicWeight

The weight of the heuristic.