A downloadable Godot Plugin

Hexagonal grid toolkit for Godot 4.6+

Coordinates · Pathfinding · Fog of War · Camera · Render-agnostic logic + bundled 2D renderer

The foundation for hex-based strategy, tactical RPGs, hex crawls, wargames, and roguelikes. 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.

What it's for

  • Turn-based strategy — 4X, civ-likes, wargames.
  • Tactical RPGs / CRPGs — XCOM, Wasteland, Banner Saga style. Movement points, LOS with elevation, flanking, terrain bonuses; plug your stats / inventory / skills into HexCell.metadata.
  • Hex-and-counter wargames — Panzer General, Combat Commander, Memoir '44 style.
  • Hex crawls and exploration games — fog of war + terrain costs, no combat code required.
  • Roguelikes with hex grids — LOS, pathfinding, terrain costs, fog out of the box.

Why this addon (not roll-your-own)

  • Deterministic, JSON-serializable logic. Grid, pathfinding and fog operate on coordinates and data — no rendering or hidden randomness baked in. Suitable for play-by-email, lockstep multiplayer, headless servers, replays, and AI/ML training environments. Bring your own netcode; the addon won't fight you.
  • Render-agnostic simulation. Bundled 2D renderer is optional. Drive the logic from a 3D scene, a headless server, or any custom renderer.
  • Everything injectable. Terrain costs, edge costs, visibility formulas, tile visuals, neighbor filters — all callables, no subclassing, 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.

Benchmarks, published

Microbenchmarks for every free-tier module ship in benchmarks/. Run them yourself with godot --headless --script benchmarks/run_benchmarks.gd. Reference results, hardware notes, and a guide on choosing between A*, cached Dijkstra and FlowField live in docs/benchmarks.md.

269 automated tests

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

HexGrid(92) · FogOfWar(44) · HexRenderer(39) · PathFinder(36) · HexCell(24) · BatchHexLayer(20) · MapCamera(14)

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

Pro tier — 10 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
  • FogTextureRenderer (new in 1.4.0) — texture-based fog of war that scales to 250×250 grids. Single quad + shader sampling a visibility texture; bilinear smoothing for continuous fog instead of hexagonal holes. Incremental update_cell is ~84 000× faster than the full sweep — fog cost becomes O(changed cells), not O(map area)

Pro also ships a visual @tool map editor (HexMapNode) for painting terrain directly in the Godot editor with auto-serialization, the large_world example (250×250 batch-rendered map with token, fog and camera fully wired up), and a full 2-player skirmish demo with combat, city capture, fog of war, flow-field group movement and victory conditions.

Get Hex Strategy Map Pro on itch.io →

Not for

To save you a download, here's what this addon is not:

  • Square or isometric grids — use Godot's built-in TileMap.
  • Free-form 3D movement on meshes — use NavigationServer3D.
  • A full RPG framework — provides the tactical / map layer. Stats, inventory, dialogue and quests are your game's responsibility.
  • Real-time action games — designed around turn-based and step-based simulation.

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 · 269 tests · benchmarks included

Published 10 hours ago
StatusReleased
CategoryTool
AuthorDimcairion
GenreStrategy
Tags2D, addon, fog-of-war, Godot, godot4, grid, hexagonal, pathfinding
AI DisclosureAI Assisted, Code

Download

Download
hex_strategy_map_free.zip 192 kB

Install instructions

Install

  1. Download and extract the ZIP
  2. Copy addons/hex_strategy_map/ into your project
  3. Enable in Project → Project Settings → Plugins
  4. Done — all classes are available globally

Leave a comment

Log in with itch.io to leave a comment.