hex-grid-spatial

Computes neighbors, distances, and ranges for odd-r hex grids in Python.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill hex-grid-spatial
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hex-grid-spatial
Source: https://github.com/KaiserWhoLearns/skillsbench/tree/main/tasks/civ6-adjacency-optimizer/environment/skills/hex-grid-spatial
Command: npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill hex-grid-spatial

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Hex grid spatial utilities for offset-coordinate systems help developers calculate neighbors, distances, and ranges on odd-r hex maps used in Civ6-style grids.

Core Features & Use Cases

  • Neighbor discovery for any tile in an odd-r hex grid.
  • Accurate hex distance calculations and range queries for gameplay mechanics.
  • Use Case: determine all tiles within a given radius from a point for area effects or path planning.

Quick Start

Import hex_utils and call get_neighbors, hex_distance, or get_tiles_in_range to perform common hex-grid calculations.

Frequently Asked Questions about hex-grid-spatial

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate neighbors on an odd-r hex grid in Python?

To calculate neighbors on an odd-r hex grid in Python, import the hex utilities and call the neighbor discovery function. This applies offset-to-cube conversion to compute adjacent tiles for pathfinding and spatial queries.

What is the best way to find all tiles within a specific range on a hex map?

The best way to find tiles within a specific range on a hex map is using a dedicated range query function. It computes all valid hex coordinates within a given radius from a central point for area effects or territory calculations.

How does hex distance calculation work with offset coordinates?

Hex distance calculation with offset coordinates works by converting odd-r offsets into cube coordinates. This conversion enables robust distance measurement between any two tiles, essential for gameplay mechanics and path planning on Civ6-style grids.

Can I use these hex grid spatial utilities for game territory calculations?

Yes, you can use these hex grid spatial utilities for game territory calculations. They provide neighbor discovery, distance measurement, and range queries specifically built for grid-based pathfinding and spatial queries in simulations.

Do I need to manually convert odd-r offsets to cube coordinates before querying?

No, you do not need to manually convert odd-r offsets to cube coordinates before querying. The utilities apply input normalization and offset-to-cube conversion internally, allowing you to pass raw odd-r coordinates directly into distance and range functions.