TLDR Dev · ARTICLES & TUTORIALS

HEXAGONAL GRIDS

redblobgames.com45 min read

Summary from the TLDR Dev newsletter

This article goes over the geometry of hexagonal grids, including "pointy" and "flat" orientations, and various coordinate systems used in online maps and games. It highlights offset, cube, axial, and doubled systems, recommending axial/cube for their algorithmic elegance and simplicity. The article provides formulas and algorithms for common operations such as finding neighbors, calculating distances, drawing lines, determining movement ranges, rotation, reflection, and generating rings or spirals.