Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
Overview

For game developers

Games need paths for characters on a grid, groups of units in tight corridors, opponents that look ahead, and puzzles with one solution. They must stay inside a frame budget. These crates give each search an explicit budget and allocation-free variants where it matters.

Start here: Characters that move

heuristic-search

Finds paths for a character on a grid or any graph you describe with one small trait.

First step. Start with A* and a Manhattan or octile heuristic; on open 8-connected grids, try Jump Point Search.

Start here: An opponent that looks ahead

game-tree-search

Gives a computer opponent for board, card and turn-based games, within a node or time budget.

First step. Describe positions, moves and an evaluation, then deepen alpha-beta until the budget runs out.

Start here: Puzzles with one solution

constraint-search

Generates and checks logic puzzles, gives human-style hints, and grades a puzzle by the techniques it needs.

First step. Model the grid as variables with all-different groups, then count solutions with a limit of 2.

Then look at

  • mapf-search

    Moves groups of units through tight corridors, where independent A* per unit deadlocks or collides.

  • task-allocation

    Assigns workers, units or squads to jobs whose value depends on what each already holds, deterministically for lockstep and replays.

  • evolutionary-planning

    Plans with rolling-horizon evolution over your own forward model.

  • stochastic-search

    Lets an agent act on noisy observations with POMCP or DESPOT, and reuses the search tree between decisions.

  • resource-timeline

    Tracks stamina, ammunition, storage or build capacity over game ticks, as in colony and strategy games.

  • width-search

    Searches without a heuristic, from state features alone, as in planning and game benchmarks.

Algorithms to read first