The 2024 Developer Survey results are live! See the results

# Questions tagged [hexagonal-grid]

A regular tesselation of a surface where regular hexagons are used for grid tiling.

92 questions
Filter by
Sorted by
Tagged with
33k views

### Vertical vs horizontal hex grids, pros and cons [closed]

With hex grids, you can choose to arrange the tiles with the pointy sides up, so that you can move along the west-east axis, or you can arrange them with an edge up, so that you can move along the ...
• 1,739
53k views

### Why don't we use octogonal maps instead of hexagonal maps?

I understand the advantage of hexagonal tiles over square ones. But why aren't octagons used instead? I would think they would provide better, more natural movement in eight directions. I was ...
• 671
19k views

### How to create a hexagon world map in PHP from a database for a browser based strategy game

I'm trying to create a hexagon world map for my PHP browser based strategy game. I've created a table in my database with the following data per row: id, type, x, y and occupied. Where type is the ...
• 411
53k views

### Hexagonal grid/tiles tutorials [closed]

Are there any platform or language agnostic (preferably step by step) tutorials regarding creating hexagonal grid based maps/games? I'm mainly interested in grid/tiles basics and not advanced game ...
6k views

### Get ring of tiles in hexagon grid

Thanks to this post: Hexagonal tiles and finding their adjacent neighbours, I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of ...
• 3,577
3k views

### Recognizing a hexagonal clickbox

I'm working on a game that is going to involve gasp hexagons. At present, I have a hexagon image that I am using (all sides are the same length...it fits into a 50px by 50px image). I am somewhat ...
• 1,378
11k views

### Pleasing isometric hexagons

What angles and long-side/short-side ratios give the most aesthetically pleasing and graphically regular isometric (squashed and flat side up) hexes, that additionally resolve to whole pixel sizes for ...
• 1,550
14k views

### Finding shortest path on a hexagonal grid

I'm writing a turn based game that has some simulation elements. One task I'm hung up on currently is with path finding. What I want to do is move each turn an AI adventurer one tile closer to his ...
2k views

### Elevation model for hexagonal game grids

TL;DR: Where should elevation be anchored on a civ-style hexagonal grid? Center, side or vertex? (Or more complex?) Question proper: Consider for a moment a classic game we all know and love (maybe?...
• 1,550
1k views

### How to divide hex grid evenly among n players?

I'm making a simple hex grid based game, and I want the map to be divided evenly among the players. The map is created randomly, and I want the players to have about equal amount of cells, with ...
• 1,048
2k views

### Generate equal regions in a hex map

Taking for example a large (X by Y) hex map, how can I divide it into N regions of connected hexes to simulate countries? The goal is to generate a hex map that looks like a real life map with ...
• 151
12k views

### How can I implement hexagonal tilemap picking in XNA?

I have a hexagon tiled map in which I need to check when a hexagon is clicked. The hexagons aren't actually touching, rather they have a slight gap in between each of them. Does anyone know how could ...
• 1,507
5k views

### Efficient Algorithm for the boundary of a set of tiles

I have a grid of tiles of a known finite size that forms a map. Some of the tiles inside the map are put into a set known as a territory. This territory is connected, but nothing is known about its ...
• 318
11k views

### How do I rotate a structure of hexagonal tiles on a hexagonal grid?

My 2D isometric game uses a hexagonal grid map. In reference to the image below, how do I rotate the light blue hexagon structures by 60 degrees around the pink hexagons? EDIT: Main hex is (0,0). ...
• 111
12k views

### How do I get pixel to hex coordinates on an array based hex map?

I'm trying to make a pixel to coord function for a hex map but I'm not getting the math correctly, everything I try seems to be a little off, and the examples I've found were based on circled centered ...
• 1,031
3k views

### Showing range on hexagonal grid

Here is the situation. I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range. My solution ...
• 101
6k views

### Storing a hex grid

I've been creating a small hex grid framework for Unity3D and have come to the following dilemma. This is my coordinate system (taken from here): It all works pretty nicely except for the fact I have ...
• 439
6k views

### Is there a library that handles hexagon tiled 2D maps? [closed]

It would represent a map that is semi-square of arbitrary size. It would have a simple system for representation of the map coordinates, such as 0101 (first column, 1st hex). I'd want the map to be ...
2k views

### Finding cells within range on hexagonal grid

First up - I know I'm being super-dense here. With that out of the way, I'm trying to write a C# implementation of this algorithm: ...
• 225
1k views

### Is it better to hard code data or find an algorithm?

I've been working on a boardgame that has a hex grid as this board: Since the board will never change and the spaces on the board will always be linked to the same other spaces around it, should I ...
• 655
5k views

### Are there any hex tile sizes where both width and height are integers?

I'm trying to figure out the optimal width and height (in pixels) to start building hex tiles for game development. My preference is for "flat topped" hex grids, but the math is similar for both. I ...
• 201
6k views

### How to draw the contour of a hexagon area, like in Civ 5

I am trying to achieve the hexagon contour look you find in Civilization V: I want to outline the area a unit can move to on a hexagon grid, so far I can get a list of all the tiles a unit can move ...
• 177
1k views

### Inconsistent movement / line-of-sight around obstacles on a hexagonal grid

In a roguelike game I've been working on, one of my core design goals has been to allow the player to "Play the game, not the grid." In essence, I want the player's positioning to be tactical because ...
• 173
898 views

### How can I create a six sided tillable perlin noise image?

I'm attempting to create a tillable hex shaped terrain map using c++. As part of the process I'd like to use perlin noise, but it seems that in order to make it tillable I'll need to generate it 5 ...
• 103
4k views

### Converting between Spiral Honeycomb Mosaic and axial hex coordinates

There seems to be quite a lot of logic in dealing with hexagonal grids using a system of axial coordinates like the one described here. In doing some reading about hex grids, though, I ran across the ...
• 171
4k views

### How to orient a hexagonal tile on a geodesic sphere (Goldberg polyhedron)?

I've recently ported the hexasphere implementation by Rob Scanlon at https://github.com/arscan/hexasphere.js to objective-c for use in a project I'm exploring. As a port, it works very well, and I ...
• 225
6k views

### Technical differences between square and hexagon for a grid?

I'm developing a 2D city-building game and trying to decide on the type of grid. There will be vehicles, so the unit movement is important too. I know there are visual differences for using Squares ...
• 95
3k views

### How do I sort edge tiles for a hex grid in order to draw a border?

I am trying to sort the edge tiles of a region in my hexagon map. Once it is properly sorted, I can then try to walk through them and attempt at creating a Civ style border map, but I can't seem to ...
• 339
4k views

### Creating an isometric map with hexagonal tiles for iPad

I'm new to game development, so I need a little help. I have to write down a little game which has a floor with hexagonal tiles, but it must be seen in an isometric view like The Sims. Ignoring the ...
• 163
6k views

### 3D terrain map with hexagon grids

I'm working on a hobby project (I'm a web/backend developer by day) and I want to create a 3D tile (terrain) engine. I'm using XNA, but I can use MonoGame, OpenGL, or straight DirectX, so the answer ...
• 161
657 views

### A* search in hexagonal grid with minimum turn radius

I need to run an A* search through a hexagonal grid. However, I have one nasty constraint: my vehicle can only turn so sharp. It has a specified minimum turn radius. I can't quite see how to translate ...
• 163
3k views

### How to generate seamless hexagonal textures

I'm doing a tactical game (X-Com / Fallout style) for fun. I've decided to use a hexagonal map, but I'm having a graphic problem. My current map display is HUD-like, with only the border of the map ...
839 views

### Are there definitive, unambiguous terms for hexagon tile orientations?

I have been working on a tile map editor and plan to support two orientations for hexagons. I have seen various terms used, but these all seem ambiguous to me. Horizontal, Vertical (ambiguous: does ...
• 153
359 views

### How to determine what hexes are in an area bounded by 3 hexes

I've been searching for hex grid algorithms for a while now, but I'm not having much luck. I'm working on a game that will be using hex grids for the board. There seems to be sufficient resources to ...
• 153
1k views

### Line draw on “even-q” vertical flat topped hex grid

I'm trying to implement a Line Draw or Line of Sight algorithm for my hex boardgame. Upon reading several different solutions from most common places like the Hex Bible, none of the algorithms adapted ...
1k views

### Why is libGDX's HexagonalTiledMapRenderer adding extra space?

Why are there large spaces between the hexes when rendered by HexagonalTiledMapRenderer? The tiles ARE black bordered, but that doesn't account for all the extra space. I was also able to get them ...
• 153
355 views

### Elegantly transition from 4-grid to 6-grid and back

I find in general map creation that I prefer hex grids for natural environments, but square grids for interior and urban/constructed environments. Is there a smooth or elegant way to transition ...
• 832
5k views

### Creating a hexagonal wraparound map

I'm trying to create a wraparound map for a hexagonal map, so when you exit a tile on one side of the big hexagon-shaped map, you enter a tile on the other side. Example image from Red Blob Games ...
• 153
502 views

### Find a encircliement in Hexagonal grid (optimization issue)

I have a hex grid of 10000 cells (100x100). The player can grab a cell next to one of his cells (borders). If the player has formed a ring after placing a cell, I want to get a list of cells that ...
575 views

### Map coordinates system [closed]

I am planning to implement in my game a very big map. I won't be showing all map at once but rather only a selected part of it. Additionally, I would need to connect hexes into bigger pieces (...
• 173
630 views

### How to efficiently (no pointers) store hex grid with shared edges and vertices?

I have a hex grid stored in a 2d array; now I want to add some properties to the edges of the grid (e.g. rivers between hexes) and also potentially to the vertices. How can I store edges and vertices ...
• 141
2k views

### Pointy top hexagonal A* pathfinding

I'm trying to create a game with a hex based map with the points at the top. I have most of it working, however the path finding is being a little awkward. The heuristic I'm using is called Euclidean ...
• 43
3k views

### Pathfinding in hex grid based game

I'm making a TBS using a hex grid. Player can move units from one hex to another using bridges, which will be randomly generated. I'm using cubic and axial coordinate system for my grid, it's well ...
• 125
3k views

### Tweaking Heightmap Generation For Hexagon Grids

Currently I'm working on a little project just for a bit of fun. It is a C++, WinAPI application using OpenGL. I hope it will turn into a RTS Game played on a hexagon grid and when I get the basic ...
279 views

### Magnitude of a vector in Generalized Balanced Ternary?

Generalized Balanced Ternary is a fairly obscure but very elegant method of indexing a hex grid, using only a single integer coordinate. Operations like addition and multiplication on these ...
• 161
8k views

### Drawing hexagonal grid on Android

I'm trying to draw a hexagon grid in my Android application. I don't want to reinvent the wheel here, so I'm looking for some frameworks/libraries or just some basic ideas about how should one do this....
• 193
467 views

### What is the easiest way to move towards and along the edge on a hex grid?

I have a hexagonal grid with variable radius. My entity can move exactly two hexes per turn. How should I calculate next step towards border and afterwards travelling clockwise around map? Preferred ...
• 153
1k views

### How do I calculate hex coordinates from a ring and index?

I am trying to implement field of view (FOV) in a hex grid. I am using the cube coordinate system from here. Then, I am using shadow casting to find FOV as from here. I have a system like in the ...
• 175