Pathfinding algorithms for games — A*, JPS, Theta*, flow fields, visibility graphs

Game Pathfinding Algorithms, Benchmarked: A*, JPS, Theta*, Flow Fields, Visibility Graphs

Five pathfinders implemented in C++23, each in a single Godbolt-ready file, benchmarked on the same grids. A* is the baseline. JPS expands 22x fewer nodes on open maps yet runs slower than A* in naive form. Theta* produces shorter any-angle paths at 2-8x the cost. Flow fields dominate when many agents share a goal. Visibility graphs — AoE II DE’s approach — need 5 waypoints where A* needs 600. Plus the StarCraft ‘harvesters ignore collisions’ hack and why SC2 switched to navmeshes.

April 18, 2026 · 15 min · Pavel Guzenfeld
Fixing an Infinite Loop in Eigen's 128-bit Division

Fixing an Infinite Loop in Eigen's 128-bit Integer Division

How a missing overflow check in Eigen’s TensorUInt128 division operator caused an infinite loop for any dividend above 2^127 — and the one-line fix that stopped it.

March 20, 2026 · 4 min · Pavel Guzenfeld