Hex Grid Spatial Utilities for Openclaw

A specialized spatial utility skill for managing odd-r offset hexagonal grid coordinate systems and geometric calculations.

wu-uk
v0.1.0
Apr 13, 2026
0
725
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install civ6-adjacency-optimizer-hex-grid-spatial

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install civ6-adjacency-optimizer-hex-grid-spatial using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Hex Grid Spatial Utilities?

The Hex Grid Spatial Utilities skill provides a robust mathematical foundation for developers working with hexagonal maps. It specifically targets the odd-r offset coordinate system, where odd rows are shifted right, making it an essential tool for game developers and UI engineers building hex-based layouts.

By abstracting the complexities of hexagonal geometry—such as the differing neighbor logic between even and odd rows—this entry in the Openclaw Skills library allows for rapid implementation of spatial queries. Whether you are building a strategy game or a complex data visualization, these utilities handle the heavy lifting of coordinate conversion and distance metrics.

Hex Grid Spatial Utilities Use Cases

  • Pathfinding and movement validation in hex-based strategy games.
  • Calculating the area of effect or 'tiles in range' for game abilities.
  • Implementing spatial partitioning for hexagonal maps to optimize rendering.
  • Determining adjacency and neighbor relationships for procedurally generated terrain.
  • Mapping screen coordinates to hex grid indices in interactive web applications.

How Hex Grid Spatial Utilities Works

  1. The skill identifies the coordinate context based on the odd-r offset system where the origin (0,0) is bottom-left.
  2. Neighbor detection logic branches based on whether the current Y-coordinate is even or odd to account for the visual horizontal shift.
  3. Distance calculations are performed by converting offset coordinates into a 3D cube coordinate system (x, y, z) where the sum of coordinates equals zero.
  4. Range queries iterate through potential candidates and filter them using the cube-based Manhattan distance formula divided by two.
  5. Results are returned as standard coordinate tuples for easy integration into existing game loops or state managers.

Hex Grid Spatial Utilities Setup

To integrate these spatial utilities into your environment, ensure you have a Python-based execution context within your Openclaw Skills workspace:

# Navigate to your skills directory
cd skills/spatial-utils

# Install as a local module
pip install . 

Alternatively, copy the core functions into your helper directory to allow your AI agent to reference them during the development process.

Hex Grid Spatial Utilities Data Schema & Taxonomy

The skill operates primarily with coordinate tuples and handles data using the following structures:

Data Type Format Description
Coordinate (int, int) Represented as (x, y) offset coordinates.
Direction Index 0-5 Integer mapping: 0=East, 1=NE, 2=NW, 3=West, 4=SW, 5=SE.
Cube Coordinate (cx, cy, cz) Internal representation used for distance math where cx + cy + cz = 0.

Hex Grid Spatial Utilities Advanced Features

  • Multi-agent support for pathfinding simulations across shared hexagonal maps.
  • Optimized range calculation using cube-coordinate bounding boxes to reduce iteration cycles.
  • Support for adjacency validation hooks to trigger events when units move into neighboring tiles.
  • Seamless conversion logic between offset and cube coordinate systems for complex geometric operations.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*