Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

Hex Strategy Map free

An asset by Dimcairion
The page banner background of a mountain and forest
Hex Strategy Map free hero image

Quick Information

0 ratings
Hex Strategy Map free icon image
Dimcairion
Hex Strategy Map free

Hexagonal grid toolkit for Godot 4.6+ with coordinates, pathfinding, flow fields, rendering, camera controls, and save management. The foundation for any hex-based game.

Supported Engine Version
4.6
Version String
1.0.0-Free
License Version
MIT
Support Level
community
Modified Date
11 hours ago
Git URL
Issue URL

Hex Strategy Map

Hexagonal grid toolkit for Godot 4.6+ with coordinates, pathfinding, flow fields, rendering, camera controls, and save management. The foundation for any hex-based game.

Features

  • HexGrid β€” Offset and cube coordinates, neighbors, distances, terrain costs, edge costs, LOS
  • HexCell β€” Cell model with terrain, tag, metadata, per-player fog state, locations
  • PathFinder β€” Dijkstra and A* pathfinding, reachable hex calculation (O((V+E) log V))
  • FlowField β€” Flow field for efficient group movement (one computation serves N units)
  • HexRenderer β€” Visual rendering with injectable terrain colors, highlights, edges. Batch mode for large maps
  • MapCamera β€” Follow target, drag, zoom, edge-scroll
  • SaveManager β€” JSON-based save/load slot management

Installation

  1. Copy addons/hex_strategy_map/ into your project's addons/ folder
  2. Enable the plugin in Project β†’ Project Settings β†’ Plugins

Quick Start

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

# Render hexes
var renderer := HexRenderer.new(HexRenderer.DEFAULT_TERRAIN_COLORS, func(_cell): return "")
for coord in grid.cells:
    renderer.create_hex_visual(hex_container, coord, HexGrid.offset_to_pixel(coord), grid.cells[coord])
renderer.render_edges(edge_container, grid)

# Pathfinding (Dijkstra, A*, and flow fields)
var reachable := PathFinder.find_reachable(grid, Vector2i(2, 2), 4.0)
var path := PathFinder.find_path(grid, Vector2i(2, 2), Vector2i(8, 8))
var astar_path := PathFinder.find_path_astar(Vector2i(2, 2), Vector2i(8, 8), grid)

var field := FlowField.build(grid, Vector2i(8, 8))
var unit_path := FlowField.trace_path(field, Vector2i(2, 2))

# Batch mode for large maps (200x200+)
renderer.render_batch(hex_container, grid)

# Save / Load
var save_mgr := SaveManager.new()
save_mgr.save(0, grid.serialize())
var data := save_mgr.load(0)

# Camera
var camera_ctrl := MapCamera.new(camera_node)
camera_ctrl.follow(target_node)
camera_ctrl.enable_drag()

Customization

Everything is injectable via constructor parameters and callables:

  • Terrain costs: HexGrid.new(15, 15, custom_cost_table)
  • Edge costs: HexGrid.new(15, 15, {}, 0.0, edge_cost_table)
  • Terrain colors: HexRenderer.new(my_colors, my_icon_callback)
  • Textures: HexRenderer.new(colors, icon_fn, fog_colors, texture_fn)
  • Animations: HexRenderer.new(colors, icon_fn, fog_colors, null, animation_fn)
  • Batch rendering: renderer.render_batch(container, grid) for large maps with viewport culling

Classes

Class Base Description
HexGrid RefCounted Grid, coordinates, neighbors, terrain costs, edge costs, LOS
HexCell RefCounted Cell with terrain, tag, metadata, fog state, locations
PathFinder RefCounted Dijkstra + A* pathfinding, reachable hex calculation
FlowField RefCounted Flow field for group movement: build + trace_path
HexRenderer RefCounted Visual rendering, highlights, edges, batch mode
MapCamera RefCounted Camera follow, drag, zoom, edge-scroll
SaveManager RefCounted JSON-based save/load slot management

Examples

Mini Description
grid_only/ HexGrid + HexRenderer basics
pathfinding/ PathFinder β€” Dijkstra vs A* vs Flow Field comparison
texture_tiles/ HexRenderer with texture/atlas/animated sprite support

Testing

257 automated tests (gdUnit4):

HexGrid(92) Β· HexCell(24) Β· PathFinder(36) Β· FlowField(15) Β· HexRenderer(39) Β· BatchHexLayer(20) Β· MapCamera(14) Β· SaveManager(17)

Go Pro

Need fog of war, unit movement, turn management, procedural generation, combat, or a minimap?

Hex Strategy Map Pro adds:

  • FogOfWar β€” 3-state fog per player (Hidden/Explored/Visible) with LOS-based reveal
  • MapToken β€” Unit movement with configurable points, path following, signals
  • TurnManager β€” Turn cycle with player phases and configurable interval hooks
  • MapGenerator β€” Procedural terrain, rivers, scatterable locations
  • UnitRegistry β€” Unit tracking by owner, coordinate index, auto-sync, stacking
  • CombatResolver β€” Pluggable combat with injectable damage, terrain bonus, flanking
  • HexMiniMap β€” Minimap rendering with fog per player and token markers
  • TiledImporter β€” Import Tiled Map Editor JSON maps

Includes visual map editor (@tool HexMapNode) for in-editor terrain painting and full skirmish demo with 2 players, combat, city capture, fog of war, and victory conditions.

License

MIT β€” use freely in commercial and non-commercial projects.

Hexagonal grid toolkit for Godot 4.6+ with coordinates, pathfinding, flow fields, rendering, camera controls, and save management. The foundation for any hex-based game.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Hex Strategy Map free icon image
Dimcairion
Hex Strategy Map free

Hexagonal grid toolkit for Godot 4.6+ with coordinates, pathfinding, flow fields, rendering, camera controls, and save management. The foundation for any hex-based game.

Supported Engine Version
4.6
Version String
1.0.0-Free
License Version
MIT
Support Level
community
Modified Date
11 hours ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers