Skip to content

five-on-it / packages/world/src/road-route

packages/world/src/road-route ​

A route over the road graph, the way a car's navigator draws one (GAME_DESIGN §9.3, §16: the minimap's route line to the mission's target): from a point onto the nearest road, along the lanes in their direction of travel (a one-way street one way only), off the road at the point nearest the goal, and on to the goal. An A* search over the graph's nodes, the straight distance its heuristic, ties broken by node id. Pure and deterministic, apart from the AI's own planning (packages/ai, the server's), so the client can draw it.

Functions ​