We have redirected you to our new domain: store.godotengine.org. Please update your bookmarks!

Description
Changelog
Reviews

Hexagonal grid toolkit for Godot 4.6+

Coordinates · Pathfinding · Fog of War · Rendering · Camera

The foundation for any hex-based game. MIT, no dependencies, drop-in.

You want to build a turn-based strategy game in Godot. You sit down expecting to start on the fun part — units, factions, economy — and three weeks later you're still arguing with offset coordinates, A* tie-breakers, and why fog of war flickers when units move.

Look, math is FUN…damental in this kind of work. It's also kind of a black hole for your project timeline if you're starting from zero every time. You didn't open Godot to become a part-time tessellation researcher — you opened it to make a game. If the words "axial coordinates" already make you want to close the tab, you're in the right place.

Hex Strategy Map ships the building blocks of the map — hex math, pathfinding, fog of war, rendering, camera — and gets out of your way. Every game-specific rule (terrain cost, visibility formula, tile visual) is an injectable Callable. No hardcoded assumptions. No magic strings.

Built from a real project

I'm developing a game with a strategic exploration phase inspired by Heroes of Might and Magic. After three iterations of that phase, I noticed something: most of what I'd written wasn't actually specific to my game. The terrain costs were constants, but they didn't have to be. The visibility formula was hardcoded, but if I passed it in through the constructor the same code could power very different games. The combat rules, the fog behavior, the path filters — same story. Piece by piece, the exploration phase stopped looking like "my game's map system" and started looking like a generic toolkit for hex-based strategy games. That realization became this addon.

I keep updating it as I develop. When I hit friction, need a function that doesn't exist yet, or find a better approach — it goes in here. If you're building something with hexes, I hope this saves you some time. Questions, ideas, or something missing? I'm always happy to chat.

7 modules included

ModuleWhat it does
HexGrid Offset/cube coordinates, neighbors, distances, terrain & edge costs, LOS (elevation-aware via callable)
HexCell Cell model: terrain, tag, metadata, per-player fog state, elevation
PathFinder Dijkstra and A*, reachable hex calculation, injectable neighbor filters
HexRenderer Polygon2D / Sprite2D / AnimatedSprite2D rendering with textures, atlases, overlays, icons, edges
BatchHexLayer 200×200+ maps via _draw() with viewport AABB culling and dirty tracking
FogOfWar 3-state fog (Hidden / Explored / Visible) per player, LOS-based reveal, configurable visibility
MapCamera Follow target, drag, zoom, edge-scroll

Quick start

# Create and populate a grid
var grid := HexGrid.new(12, 12)
grid.generate_cells()

# Render hexes
var renderer := HexRenderer.new()
for coord in grid.cells:
    renderer.create_hex_visual(container, coord, HexGrid.offset_to_pixel(coord), grid.cells[coord])

# Pathfinding
var reachable := PathFinder.find_reachable(Vector2i(2, 2), 5.0, grid)
var path      := PathFinder.find_path_astar(Vector2i(2, 2), Vector2i(8, 8), grid)

# Fog of war per player
var fog := FogOfWar.new(grid)
fog.reveal_around(0, Vector2i(2, 2), 3)
renderer.update_fog(container, grid, 0)

# Camera
var cam := MapCamera.new(camera_node, get_viewport())
cam.follow(target_node)

A working map with fog of war and pathfinding fits in under 20 lines.

Everything is injectable

All behavior is exposed via Callables and constructor parameters:

  • Custom terrain types & costs
  • Custom edge types (rivers, walls, roads)
  • Custom terrain colors
  • Textures & animated sprites
  • Elevation-aware LOS via elevation_fn
  • Custom visibility formula for fog
  • Custom tile visuals & overlays
  • Custom color resolver (color_fn)
  • Custom neighbor filters in pathfinding
  • Click signals per cell

No subclassing required. Pass a Callable and it works.

560+ automated tests

Every module is covered by gdUnit4. Tests run before each release.

HexGrid(98) · HexRenderer(71) · HexMiniMap(52) · FogOfWar(49) · PathFinder(36) · TurnManager(32) · HexCell(29) · UnitRegistry(24) · MapToken(23) · BatchHexLayer(20) · SaveManager(19) · MapGenerator(17) · 10 more suites

Examples included

ExampleShows
grid_only HexGrid + HexRenderer basics
pathfinding Dijkstra vs A* vs Flow Field — interactive comparison
texture_tiles Textures, atlases, animated sprites
fog_reveal Fog of war revealing as a unit moves
camera_only Camera controls + procedural map
map_gen Interactive procedural generation with sliders

Requirements

  • Godot 4.6+
  • No external dependencies — pure GDScript
  • Works in 2D scenes; rendering layer is decoupled from grid logic

Installation

  1. Install the asset from the Godot Asset Store (or copy addons/hex_strategy_map/ into your project's addons/ folder)
  2. Enable the plugin in Project → Project Settings → Plugins
  3. Use the modules directly via their global class names (HexGrid, PathFinder, etc.)

Pro tier — 9 more modules

If you need the full turn-based strategy toolkit, Hex Strategy Map Pro adds the pieces most strategy games need:

  • MapToken — unit movement, path following, signals
  • TurnManager — turn cycle, player phases, interval hooks
  • CombatResolver — injectable damage, terrain, flanking, outcome
  • MapGenerator — procedural terrain via noise, rivers, locations
  • FlowField — one field serves N units via trace_path
  • UnitRegistry — coordinate index with auto-sync, stacking rules
  • HexMiniMap — minimap with per-player fog and token markers
  • TiledImporter — import Tiled Map Editor JSON maps
  • SaveManager — JSON-based save/load slot management

Pro also ships a visual @tool map editor (HexMapNode) for painting terrain directly in the Godot editor with auto-serialization, and a full 2-player skirmish demo with combat, city capture, fog of war, flow-field group movement and victory conditions. Available on itch.io.

Acknowledgments

Hex coordinate algorithms informed by Red Blob Games — Hexagonal Grids by Amit Patel.

MIT License — free for commercial and non-commercial projects.
Documentation · 6 examples · 560+ tests

Changelog for version v1.2.0-free

No changelog provided for this version.

Reviews (0)

Hexagonal grid toolkit for Godot 4.6+ Free has no reviews yet.

Login to write a review.